Repository navigation
Choose the spectral axis with a union of groups - #1426
Draft
SimonHeybrock wants to merge 4 commits into
Draft
SimonHeybrock wants to merge 4 commits into
SimonHeybrock wants to merge 4 commits into
Conversation
Monitor and detector-view params selected TOA or wavelength with a `coordinate_mode` field next to four groups, `toa_edges`, `toa_range`, `wavelength_edges` and `wavelength_range`. A request carried the fields of both modes, the UI showed all of them, and each range filter had its own `enabled` flag. They are now one field, `spectral_axis`, a union discriminated by `kind` (ADR 0008 of essapps): `TOASpectralAxis | WavelengthSpectralAxis`. Each alternative holds its bin edges and a range filter typed `X | None`, so the selector's two groups per mode merge into one alternative. TOA-only specs narrow the field to `TOASpectralAxis`, which replaces the validator that rejected wavelength. The dashboard's param widgets learn the two components the ADR asks of a UI generator: a radio choice for a union of groups, and a checkbox for a group typed `X | None`. Groups nested in groups are shown as indented blocks, and a `Literal` of one value, such as a tag, has no widget. Stored configs in the old shape lose their spectral settings and start from the defaults; pixel weighting is kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A union of groups becomes one card whose header is a row of segmented buttons, so the choice visibly owns the fields below it; plain radio buttons above the fields did not read that way. A group typed `X | None` is a card with a switch in its header, collapsed while off: a checkbox read as a bool field of the group. A group nested in a group is a card titled by its field. The error highlight of a field is an outline rather than a border, since clearing it with `border: none` would remove a card's own border. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The segmented buttons outweighed the tabs above them. Radio buttons in the header match the switch in the header of an optional group's card: in both, the header holds the control and the body what it controls. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A union of groups is refused as a field of a group, as ADR 0008 of essapps now states; it is a parameter of its own. - UnionWidget clears the error state of every alternative, so an error does not stay on an alternative the user switched away from. - Stored params that do not validate against the current model fall back to the defaults in the config dialog. A wavelength axis stored for a spec that is now TOA-only no longer breaks it. - The range filter defaults to one pulse period in ms, not 0-10 µs. - The wavelength alternative explains itself, as the TOA one does. - Literal labels via json_schema_extra are gone; their only user was the coordinate-mode selector. - The wavelength-instantiation test collects only specs with a spectral axis, instead of every spec whose params all have defaults. - A round-trip test runs the real params models through ModelWidget. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 23, 2026
SimonHeybrock
added a commit
to scipp/essapps
that referenced
this pull request
Oct 26, 2026
An app without a client or a backend: specs and their bindings, a dataset source, and the outputs computed so far. The form is generated from the pydantic models; one choice widget serves a group, a union of groups, and a parameter typed X | None. A place without a default starts unset. The widgets follow scipp/esslivedata#1426, in Panel. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SimonHeybrock
added a commit
to scipp/essapps
that referenced
this pull request
Oct 26, 2026
An app without a client or a backend: specs and their bindings, a dataset source, and the outputs computed so far. The form is generated from the pydantic models; one choice widget serves a group, a union of groups, and a parameter typed X | None. A place without a default starts unset. The widgets follow scipp/esslivedata#1426, in Panel. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SimonHeybrock
added a commit
to scipp/essapps
that referenced
this pull request
Oct 26, 2026
An app without a client or a backend: specs and their bindings, a dataset source, and the outputs computed so far. The form is generated from the pydantic models; one choice widget serves a group, a union of groups, and a parameter typed X | None. A place without a default starts unset. The widgets follow scipp/esslivedata#1426, in Panel. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 26, 2026
Merged
This branch has not been deployed
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.
Monitor and detector-view params selected the spectral axis with a
coordinate_modegroup next to four groups,toa_edges,toa_range,wavelength_edgesandwavelength_range, each range with anenabledflag. A request carried the fields of both axes, and the UI showed all of them as separate tabs, whichever axis was selected.This applies ADR 0008 of essapps ("a choice between ways is a union of groups;
X | Nonemeans without X"): the five fields become one,spectral_axis, a union discriminated bykind:The selector controlled two groups per axis, so each alternative holds both, and the
enabledflags becomerange_filter: X | None. TOA-only specs subclass the params model and narrow the field toTOASpectralAxis, which replaces the validator that rejected wavelength. Factories readaxis.kind,axis.edgesandaxis.range_filterinstead of theget_active_*methods.Dashboard param UI
The generic param widgets gain the two components the ADR asks of a UI generator, plus nesting:
X | Noneis a card with a switch in its header, collapsed while off.Literalof one value, such as a tag, has no widget.The error highlight of a field is now an outline, since clearing it with
border: noneremoved a card's own border. Literal labels viajson_schema_extra, whose only user was the coordinate-mode selector, are removed.Behaviour changes
OutputView.paramsnames top-level fields only, so every axis-dependent output now listsspectral_axisin "Affects outputs", without distinguishing edges from range filter.Test plan
🤖 Generated with Claude Code