Skip to content

Monitor modernization + few cleanups and fixes - #131

Merged
ShantanuKodgirwar merged 31 commits into
mainfrom
monitor-modernization
Oct 9, 2026
Merged

ShantanuKodgirwar merged 31 commits into
mainfrom
monitor-modernization

Conversation

@ShantanuKodgirwar

Copy link
Copy Markdown
Contributor

What and why

Modernizes the reconstruction monitor that every engine uses, and fixes issues found along the way.

  • New interface: engines pass one MonitorFrame per update to monitor.update(frame). Cropping and FPM handling moved from BaseEngine into the monitor. Existing monitors keep working through the old hooks.
  • Jupyter: figures update in place instead of the cell being cleared, and progress bars use tqdm.auto, so they no longer print a line per iteration.
  • New figures and saving:
    • A parameter-history figure (zo, theta, purity, scan positions), shown only for quantities that change.
    • reconstruction.saveResults(..., snapshot=monitor) and monitor.saveFigures() save PNGs of the final figures.
  • Quieter logs: per-iteration messages are logged once, and the error/overlap summary prints at the end of the run.
  • Fixes:
    • DummyMonitor crashed with TV_autofocus on.
    • ePIE never updated the monitor.
    • NapariMonitor used the wrong layer name.
    • The error plot was squeezed and had overlapping ticks.
    • HDF5 files are now closed with with.
  • Cleanup: removed dead code and unused hooks, BaseEngine-style docstrings, Literal type hints, no more global warning filter.

How it was tested

  • 136 passed, 17 skipped, including new tests/Monitor/ tests. The engine regression goldens are unchanged.
  • Checked live in Jupyter, VS Code # %% cells and a GUI window, plus an FPM run, using example_scripts/exampleMonitorGUI.py.

Notes

None

…work but untested; minor mismatch of name "probe_estimate" + adds a small test for this
…onitor to store some png results with your datasets wraps around monitor.saveFigures
@ShantanuKodgirwar
ShantanuKodgirwar merged commit 0a41910 into main Oct 9, 2026
5 of 6 checks passed
@ShantanuKodgirwar
ShantanuKodgirwar deleted the monitor-modernization branch October 9, 2026 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant