Skip to content

settings_from: a part keeps the defaults its parent declares (fits from scripts and chains came out in pixels); 0.3.1 - #8

Merged
jries merged 3 commits into
mainfrom
settings-part-defaults
Oct 8, 2026
Merged

jries merged 3 commits into
mainfrom
settings-part-defaults

Conversation

@jries

@jries jries commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

What changed

settings_from built each part of a settings dataclass from the part's own class, so a default the parent declares for it was lost. GaussianFitSettings (and the other fitters) declare fit = FitSettings(output_unit="nm"); built from a map that did not name the unit, the fit came out in pixels. The GUI form was never affected -- param_specs already carries the parent's defaults down -- so the form and a script made different settings from the same values.

Now settings_from builds from the same resolved specs param_specs gives the form (_from_specs): a part starts from its parent's declared default, and the given values go on top.

Who sees a difference: anything that builds a fitter's settings from a partial map -- a chain or batch step that does not name fit.output_unit, a script calling settings_from, and smappy.gui.live_session.fit_settings. Those fits now come out in nm, as each fitter declares. Settings restored from a workspace or a log name every field and are unchanged.

Found by the MicroClaw worker (ries-lab/smappy-microclaw), whose fits had no xy_err_nm; the released package names fit.output_unit itself, so it does not depend on this.

Also: version 0.3.1, which includes the smappy-live pause flush already on main (d4299ed).

Tests

test_a_part_keeps_the_default_its_parent_declares_for_it (tests/test_batch_foundations.py) -- fails without the fix, passes with it.

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

🤖 Generated with Claude Code

jries and others added 3 commits October 8, 2026 13:14
…Source

live_view asks its source for idle blocks, as the GUI's Fit plugin does since
the last commit, and LiveFit skips pushing the empty ones but still checks its
flush timer -- so what was buffered before a pause is fitted and shown during
it rather than at the next frame.  QueueSource.watch takes idle_blocks too,
since live_view accepts one.  LiveFit keeps its own loop rather than drive's,
for its stop event.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GaussianFitSettings declares fit = FitSettings(output_unit="nm"), and the
form honours it (param_specs); settings_from built the part from its own
class instead, so a script, a chain step or smappy.gui.live_session.fit_settings
that did not name the unit fitted in pixels.  Found by the MicroClaw worker,
whose output had no xy_err_nm.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jries
jries merged commit 8c6ad31 into main Oct 8, 2026
5 checks passed
@jries
jries deleted the settings-part-defaults branch October 8, 2026 11:55
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