Skip to content

Name a unit's output streams in the form, fit the panel's tabs, and write YAML without anchors - #1098

Merged
ctdegroot merged 4 commits into
mainfrom
editor-saved-file-and-stream-names
Dec 4, 2026
Merged

ctdegroot merged 4 commits into
mainfrom
editor-saved-file-and-stream-names

Conversation

@ctdegroot

Copy link
Copy Markdown
Member

Part of the editor usability pass (findings 4, 13 and 14 from building a plant from scratch in the editor; 7, 8 and 11 were #1091). Nothing tracks them as issues.

Summary

  • Naming a unit's output streams. Results listed outlets as clarifier1.overflow and there was nowhere to call them effluent or waste sludge. The unit form now has a "Name of the stream" field per output port (a combobox, stream.<port> rows), suggesting the stream roles a plant evaluation reads. The catalogue sends them as stream_roles (performance.ROLES), so the editor lists none of its own. A name another stream already has, or two of the unit's own, is refused at its field: streams: maps one name to one endpoint. Flowsheet.name_streams applies them, so Undo takes a name back. Studies and their results already use a stream's name when it has one (simulation_study, plant_choices).
  • The side panel's tabs fit. The five tabs needed about 414 px in the 340 px panel, hiding Model and Spec behind scroll arrows; with 8 px padding and no letter spacing they take 296 px.
  • YAML without anchors. A saved spec held &id001 / *id001 where two units shared a default list. aquakin/utils/yaml_text.py's dump_yaml (a SafeDumper that never writes aliases) now writes every YAML file aquakin writes for a person: specs, studies, model edits, results summaries, the project file. A spec also leaves out unset influent_endpoint / effluent_endpoint instead of writing null.

Things a reviewer should know

  • Unit-level nulls stay (aeration: null, series: null): plant-spec.md says a unit is written with every setting so a later change of default cannot change a saved plant. Only the top-level endpoints, which have no default to change, are left out. They read back as unset and the fingerprint is unchanged (tested).
  • Sites that wrote without allow_unicode (the run record, the project file, named values) now write non-ASCII characters as themselves; they read back the same.
  • A Simulate study created before a stream was named keeps the port names it was created with; naming a stream does not rewrite an existing study.
  • main (with Name unit settings in words, fold advanced ones away, and move a model in one step #1091) was merged in: the stream rows follow Name unit settings in words, fold advanced ones away, and move a model in one step #1091's label style, are never folded into "More settings", and the combobox moved into page._form_rows.
  • One existing test edited: test_a_reagent_composed_in_the_form_builds_that_reagent read the composition row as rows[-1]; the stream rows now come last, so it looks the row up by key, asserting the same thing.
  • CLAUDE.md's list of shared places gains utils/yaml_text.py; docs/package_structure.md lists it.

Testing

  • pytest tests/ui tests/unit tests/integration/test_plant_spec.py tests/integration/test_study.py -m "not slow and not validation": 3426 passed (tests/unit/test_pre_push_hook.py deselected: the shell's python3 here lacks tomllib, an environment issue).
  • pytest tests/browser: 31 passed, including the new tab and stream-name tests. The tab test was seen to fail with the old padding; the anchor test was seen to fail on main's spec.py.
  • pytest README.md docs -m "not slow": 101 passed; the strict docs build, the yaml_text doctest, ruff, ruff format --check, pyright (0), scripts/check_types.py and check_test_integrity.py --base origin/main ("No test was weakened") pass.
  • Checked by hand in the browser on BSM1: the tabs, and the stream field's suggestions.
  • Not run: slow and validation tiers (no solver code changed).

Patch coverage

scripts/patch_coverage.py: 100.00% of the changed lines.

🤖 Generated with Claude Code

Christopher DeGroot and others added 2 commits December 3, 2026 17:49
…rite YAML without anchors

From building a plant from scratch in the editor:

- Results listed outlets as clarifier1.overflow; there was nowhere to call
  them effluent or wastage. The unit form now has a name field per output
  port, suggesting the catalogue's stream_roles (performance.ROLES, sent by
  catalog()); a name another stream has is refused at its field, since a
  stream name maps to one endpoint. Studies and results already use a
  stream's name when it has one.
- The side panel's five tabs overflowed its 340 px, hiding Model and Spec
  behind scroll arrows; the tabs now use 8 px padding and no letter spacing.
- A saved spec held &id001 / *id001 where two units shared a default list.
  Every YAML file aquakin writes for a person (spec, study, model edit,
  results summary, project file) now goes through utils/yaml_text.dump_yaml,
  which never writes aliases. A spec leaves out unset influent and effluent
  endpoints; a unit's unset settings stay as null by design, so a later change
  of default cannot change a saved plant.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	aquakin_ui/document.py
#	aquakin_ui/forms.py
#	aquakin_ui/page.py
#	tests/browser/test_unit_form.py
#	tests/integration/test_plant_spec.py
#	tests/ui/test_editor.py
#	tests/ui/test_forms.py
#	tests/unit/test_plant_catalog.py
@ctdegroot
ctdegroot added this pull request to the merge queue Dec 4, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Dec 4, 2026
Christopher DeGroot and others added 2 commits December 3, 2026 20:40
# Conflicts:
#	aquakin/plant/spec.py
#1093 added primary_sludge, thickener_underflow and disposal_sludge to ROLES,
which the editor's stream-name field offers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ctdegroot
ctdegroot added this pull request to the merge queue Dec 4, 2026
Merged via the queue into main with commit 3e29957 Dec 4, 2026
34 checks passed
@ctdegroot
ctdegroot deleted the editor-saved-file-and-stream-names branch December 4, 2026 02:34
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