Repository navigation
Conversation
|
Collaborator
|
Either we can wait for architecture refactoring or merge now. up to you. probably I can do this during the weekend or so. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does it solve?
This PR adds
DiffractionSim, an interactive electron diffraction simulator, and removes abTEM from quantem.widget.DiffractionSimshows a crystal and its diffraction pattern side by side for any orientation, computed live with Bloch waves: nanobeam disks, CBED and Kikuchi patterns, with thickness, convergence, precession and energy controls. It was developed alongside the orientation and phase mapping work in quantEM (electronmicroscopy/quantem#297), whoseCrystalandblochmodules it uses. A framework-free build of the same frontend (npm run build:web) runs on the group website.abTEM was used only for Lobato scattering factors, one projected potential, cell orthogonalization and the interaction constant, but it brings in a large dependency stack including dask. We replaced these four pieces with quantEM's Lobato factors (Lobato and Van Dyck, Acta Cryst. A 70, 636 (2014), https://doi.org/10.1107/S205327331401643X) and short numpy implementations:
The
crystalextra is nowase>=3.23,spglib>=2.5andpandas(pandas is used byPlanPtycho.report()and was previously supplied by abTEM).DiffractionSim, ShowCIF and PlanPtycho do not need quantem.gpu at runtime.What should reviewer(s) do?
This is a draft until quantEM PR #297 is released.
DiffractionSim, the ShowCIF potential preview and PlanPtycho now needquantem.diffractionfrom that PR. Thequantem>=pin cannot be raised before the release, so their tests skip with that requirement, and the docs CI will fail on the PlanPtycho tutorial until quantEM is installed from #297.Please review:
DiffractionSimagainst the widget conventions: naming (diffractionsim), the export bridge,state_dict/save/load_state_dict,save_statewith a frontend PNG fallback, validators, and the Title Case UI (src/quantem/widget/diffraction_sim.py,js/diffractionsim/).src/quantem/widget/_lobato.py,_showcif_potential.pyandplanptycho.py, and the reference values intests/test_showcif_potential.pyandtests/planptycho/.Verification
tests/diffractionsim: 53 passed with quantEM from PR #297 (52 passed and 1 skipped without quantem.gpu installed). All DiffractionSim cases pass intests/test_html_export_protocol.pyandtests/test_save_state.py.import abtemfails.npx vitest run js/diffractionsimandjs/showcif: pass.tscreports no new errors.Generated with Claude Code