Add ShowDiffraction analysis modules, update UI, phase identification#142
Add ShowDiffraction analysis modules, update UI, phase identification#142henryhng wants to merge 27 commits into
Conversation
40483cc to
3cb076e
Compare
74afa25 to
2a8dfc1
Compare
|
ready for review? |
|
Yup, this is ready to review thanks! |
25e82a8 to
2a8dfc1
Compare
bobleesj
left a comment
There was a problem hiding this comment.
So ideally under the widget folder, we don't want to have non-widget code as much as you can. So do you think it is possible for you to create like a folder, put it there under there? ideally no seprate file if possible at all, this is to ensure we don't create files that aren't used by EVERY widget.
colormap, fft, these can have separeate files.
|
Thanks! A few structural points before the detailed review: Module layout — we don't want to create a separate Python file unless it is used by every other widget. Tutorial notebook — good scope. Keep updating the existing PR checklist — we just added a PR template: .github/PULL_REQUEST_TEMPLATE.md. Take a look. It has a small core checklist plus sections (API/docs, UI/theming, performance, data, export) that you use selectively — complete only the sections your change touches and delete the rest, so reviewers see only relevant boxes. Since this PR predates the template, please copy the core checklist and the relevant sections into the PR description. Since this PR is LLM-written, the same agent can work through the checklist and verify each box for you. T |
2a8dfc1 to
a3aec81
Compare
bobleesj
left a comment
There was a problem hiding this comment.
for tests, let's also have it more explciit so that we know hwere these are used
test_showdiffracion.py, test_showdiffraction_center.py, explicit is better for humans to have an overall undrsetanding in this case.
…ebook # Conflicts: # CHANGELOG.md # README.md
|
Also, whenever you're done, you can let me know in the comment tagging me, it's ready for review so that I get notified. So that we can reduce round trip if needed Also, I'm wondering about force push. Well, we don't want to rewrite the histories of previous users, right? Do you think it would be possible for you to use agents to perhaps resolve those conflicts and get pull and push again? |
|
@bobleesj thank you for the feedback! not quite ready for review as still figuring out how to reconcile the conflicts and figuring out the force-push for now. The reason I force-push is because it's the only solution I am aware of catching up on branches, since commits are often made to the main repository before the PR is ready to merge. I'll try to figure out another way to account for this
Yup, put all of the ShowDiffraction modules under showdiffraction.py, thanks for the suggestion
Updated in the original post of the pull request and will change it as the PR progresses
Split the test into different modules:
|
…ebook # Conflicts: # docs/tutorials/showdiffraction.ipynb
…ebook # Conflicts: # .github/workflows/widget-ci.yml # CHANGELOG.md # docs/tutorials/showdiffraction.ipynb
…ays, and input guards
…ebook # Conflicts: # CHANGELOG.md
|
@bobleesj ready to review! |
Summary
Introduce a complete ShowDiffraction workflow and matching UI (Auto pipeline, Phase/Exclude menus, profile/azimuthal/quality panels) with mobile support
Checklist
PYTHONPATH=src pytest -qandnpm run build, or runscripts/widget_local_signoff.sh.git status --shortandgit diff --stat; do not commit generated HTML, docs builds, screenshots, local notebooks, private data, or machine-specific notes.Python API and docs — new widget, loader, or API change
(row, col)coordinate wording where positions are shown.display(...)and extra display imports; let the returned widget render naturally.UI design and theming — frontend / viewer changes
Auto,Smooth,Zoom,Pan,Contrast,fps,avg, and similar labels must not separate from their switch, menu, slider, or button.Scale,Color,Auto,Link,Zoom,Pan, andROIin dense toolbar rows; keep colons for explanatory prose and tooltips.Copy,Export,Reset,Add,Clear, andUndo. Keep scientific acronyms and file formats uppercase, for exampleFFT,ROI,BF,ADF,HTML,PNG, andMP4.Performance and real-time interaction — drag, live controls, big data paths
*_master.h5acquisitions into the same live viewer without rebuilding the notebook. Verify new masters appear in the Dataset slider, partial files are skipped until ready, and detector/scan interactions remain real time after append. See Show4DSTEM live scope folders. n/a — this PR does not touch Show4DSTEM.verbose=Trueoutput that users and agents can copy; usequantem.widget.profile_widgetfor profiling notebooks when possible. See performance notes.scripts/widget_local_signoff.sh --quick --browserfor exported HTML/UI paths, fix issues immediately, rebuild, refresh, and redrive before claiming the widget is ready. See Automation and Agent signoff.Measured on the real Fe3O4 SAED (512x512 float32, 1.0 MB, CPU backend, exact full-precision export, no crop/bin/quantize): data load 7 ms, widget build 85 ms, Auto pipeline 303 ms, export 37 ms (1.9 MB single-file HTML), first contentful paint 1.98 s; drag FPS in exported HTML: canvas pan 49, wheel zoom 59, histogram thumbs 60; live JupyterLab canvas drag 53 FPS; saved-state check: interact, Ctrl+S, reload without rerun restores the full view (metadata.widgets present). Zero page errors in all drives.
widget_local_signoff.sh --quick --browserbrowser smoke: showdiffraction.html passed at 61.7 FPS; the two failing pages (Show3D reorder drag, Show3DSlices WebGPU-unavailable) are in widgets this PR does not touch, in a headless container without WebGPU.Data honesty and repo size — data loaders, tutorial data, CI fixtures
uint8.mainlightweight: small real rendered examples are fine, but large tutorial arrays or HTML payloads should be generated during docs builds or downloaded from public data hosting only when the size justifies it.Export and saved state — HTML export, widget state, sharing
export_html(path=None, title=None, mode="single", encoding="full", downsample=None)when it can be exported. Follow the HTML export protocol.This PR workflow follows the packaging standards for reproducible scientific software described in scikit-package: S. Lee, C. Myers, A. Yang, T. Zhang, Y. Xiao, and S. J. L. Billinge, Digital Discovery (2026), DOI 10.1039/d6dd00121a.