add Show4DSTEM to_showdiffraction handoff - #211
Draft
henryhng wants to merge 3 commits into
Draft
Conversation
Collaborator
|
thanks for this but not recommended in general to bridge within widgets, unless it's sth as simple as Show2D and Show3D, etc. vice versa. Since widget states are exposed as python variables, ShowDiffraction pattern could simply "attune" to that widget state and change accordingly if possible. |
henryhng
marked this pull request as draft
August 11, 2026 14:49
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.
Summary
Show4DSTEM -
to_showdiffraction(source="current", **kwargs)hands the currently displayed diffraction pattern, or the mean pattern over the scan, to a ShowDiffraction widget for indexing and ring/spot detection.Verification
pytest tests/test_show4dstem_handoff.py -q-> 2 passedto_showdiffraction()andto_showdiffraction(source="mean"), transferk_pixel_size, thek_calibratedflag, and passthrough constructor kwargChecklist
tests/test_show4dstem_handoff.pycovering both sources, calibration transfer, kwarg passthrough, and the invalid-source error.npm run buildn/a - no frontend code changed.git status --shortandgit diff --stat; 4 files, +114/-0. No generated HTML, docs builds, screenshots, local notebooks, private data, or machine-specific notes.Python API and docs — new widget, loader, or API change
to_showdiffractionhas a NumPy-style docstring with Parameters, Returns, Raises, and Examples, matching theset_pathconvention in the same module, plus a return annotation. No(row, col)wording is needed; the method exposes no coordinates.CHANGELOG.md. Export and README-catalog items are n/a - this adds a method to an already-exported widget, not a new public widget.docs/api/show4dstem.mdunder Handing a pattern to ShowDiffraction, and picked up automatically by theautoclass :members:reference block on the same page. A new tutorial notebook is n/a - no new widget or loader is added.