Skip to content

A live fit another program controls: MicroClaw support (smappy 0.3.0) - #7

Merged
jries merged 4 commits into
mainfrom
microclaw-live-session
Oct 8, 2026
Merged

jries merged 4 commits into
mainfrom
microclaw-live-session

Conversation

@jries

@jries jries commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

What changed

For the MicroClaw skill package (ries-lab/smappy-microclaw): SMAPpy's own GUI opened on a fit that MicroClaw starts while it acquires, so the reconstruction builds up on screen during the acquisition.

  • The watch ends on the writer's word, not on idle time. watch_stack / NDTiffSource.watch take a finished event that replaces the 30 s idle timeout: a pause (refocus, laser change, time-lapse interval) no longer ends a live fit. MicroClaw's protocol (its design/84) requires exactly this.
  • Idle blocks. With idle_blocks=True the watch yields empty blocks while it waits, and pipeline.drive(flush_seconds=...) fits what is buffered on them -- before, a live fit showed nothing buffered before a pause until frames arrived again. The GUI's live fit flushes every 5 s (LIVE_FLUSH_SECONDS).
  • Context.stop and Context.writer_finished (threading.Events). The Fit plugins honour both; a stopped fit closes its file, skips the finishing steps (MicroClaw allows 10 s) and says data["stopped"].
  • smappy.gui.live_session: LiveSession opens the usual two windows, fills the Localize tab's fitter, starts the run without its preflight question, reports one LiveOutcome (succeeded / cancelled / failed, input complete or not); closing the windows mid-fit is a cancellation. fit_settings builds a fitter's settings strictly (a misspelt setting is an error, not a default).
  • Session.protected: Save / Ctrl+S refuse to overwrite the fit's file (MicroClaw records its digest while the window stays open); Save as offers ..._edited.hdf5.
  • NDTiff under Full resolution/ is found from the folder above, as MicroClaw writes datasets.
  • PluginPanel.start_run(ask=False, **context) and an ended signal; version 0.3.0 (already tagged v0.3.0 from this branch and published to PyPI).
  • NOTES.md "Online analysis" records the decisions; CLAUDE.md gains the plugin-shape row and the two Context events.

For the reviewer

  • No fitted numbers change; no plugin version or page changes.
  • The tag v0.3.0 points at this branch's tip, so main matches PyPI once this is merged.
  • smappy-live (smappy.live.LiveFit) still has its own loop and does not send idle blocks yet: a separate task.

--slow -n auto: 1362 passed, 5 skipped

🤖 Generated with Claude Code

jries and others added 4 commits October 8, 2026 11:26
… the GUI opened on a running fit

The watch takes a finished event that replaces the idle timeout (a pause is
not the end of an acquisition), and sends empty blocks while idle so the
timed flush still runs.  Context carries stop and writer_finished; the Fit
plugin honours both and skips the finishing steps when stopped.
smappy.gui.live_session opens the ordinary GUI with the fit running, reports
its outcome once, and protects the fit's file from Save.  For the MicroClaw
package (ries-lab/smappy-microclaw).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…es it

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jries
jries merged commit cb7a9b3 into main Oct 8, 2026
11 checks passed
@jries
jries deleted the microclaw-live-session branch October 8, 2026 11:55

This branch was successfully deployed

1 active deployment
pypi — d1560ceb Deployed Oct 8, 2026 by jries via publish #16
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