Skip to content

Compare runs on one chart: comparison_chart, study_comparison, MCP compare (charts step 4a) - #1097

Merged
ctdegroot merged 1 commit into
mainfrom
charts-comparison
Dec 4, 2026
Merged

ctdegroot merged 1 commit into
mainfrom
charts-comparison

Conversation

@ctdegroot

Copy link
Copy Markdown
Member

Part of the charts design (.claude/notes/charts-design.md): the first half of step 4. Remaining: compliance_chart, which waits for #1036's evaluate study kind, as decision C5 says (main has check_limit but not the kind yet).

Summary

Compare runs on one chart: one channel of one stream across several runs, a line per run.

  • aquakin.plant.comparison_chart(sources, stream, channel, *, params=None, max_rows=None, t=None) takes {name: source}, where a source is a solution in memory, saved results (load_results) or a table either gives.
    • params gives a solution its own parameter vector, by run name.
    • Each run is read through the same source reader stream_chart now shares (_source_table), so a run's line is exactly its own stream_chart.
    • Runs whose times are in different units are refused, and a run missing the channel is named in the error.
    • The axis carries a unit only when every run gives the same one.
  • aquakin.study.study_comparison(paths, stream, channel, t=None) takes simulation study folders. Each line is named after its study; when two studies share a name, as many of their project's folders are added as it takes to tell them apart (full paths as a last resort). A study named twice, or one without series in time, is refused.
  • MCP compare(paths, stream, channel, t=None, limit=None) (effect "read") returns one picture with its summary, as chart does, so an assistant can show scenarios side by side with a permit limit drawn. The server's instructions, the tool table in docs/ai_assistants.md and the run-study skill mention it.
  • Docs: a paragraph in plant_files.md, a row in public_api.md, the design note's status, and a changelog fragment.

Things a reviewer should know

  • compliance_chart is not built. C5 puts it after the evaluate study kind, and its numbers must come from check_limit (the design note: never recomputed). The Performance indices and effluent compliance from a study #1036 session will say when the kind lands.
  • Two bugs found by the tests before this was pushed:
    • The first naming rule (project and study) still collided for two projects whose folders share a name, and the second study silently replaced the first, since the series are keyed by name. Names now grow until they are unique.
    • A saved run missing the channel raised a KeyError that did not say which run. The error now names it.
  • The comparison is a builder over the existing readers: it adds no reading of its own.

Testing

  • tests/integration/test_plant_charts.py:
    • A solution, the same solution saved, and a run solved with another muH (read with its own params) each give their own stream_chart values.
    • A time window; units that differ (no unit on the axis); different clocks; no run; a missing channel, named by run.
  • tests/integration/test_mcp_charts.py:
    • compare through a real MCP client: the image is byte for byte to_png of the expected comparison with its limit, and the text is its summary (counts above the limit worked out by hand in the test).
    • Naming across two projects both called project, and across folders that differ only between project and study (full paths); a study named twice; an unknown channel.
  • After rebasing onto main (Name unit settings in words, fold advanced ones away, and move a model in one step #1091): 268 tests (charts, MCP, plot, plugin, extension build, editor results, study charts and the repo-rule checks) pass.
  • Ruff check and format, scripts/check_types.py, the strict docs build and scripts/check_test_integrity.py ("No test was weakened") all pass. full-ci is not required. claude plugin validate passes.
  • Not run locally: the whole fast tier, slow, validation, tests/browser (no editor code changed).

Patch coverage

python scripts/patch_coverage.py: 100.00% of 71 changed lines.


Generated by Claude Code

…mpare

One channel of one stream across several runs, a series per run named as the
caller names it. aquakin.plant.comparison_chart takes solutions in memory
(each with its own parameters), saved results or tables, read through the one
source reader stream_chart now shares (_source_table); runs on different
clocks are refused, and a run missing the channel is named.
aquakin.study.study_comparison takes study folders, each series named after
its study, with as many of its project's folders as it takes to tell two
apart. aquakin mcp gains a `compare` tool, so an assistant can show scenarios
side by side, with a permit limit drawn.

compliance_chart, the rest of step 4 of .claude/notes/charts-design.md,
waits for the evaluate study kind (#1036), as decision C5 says.

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 4bdc8b7 Dec 4, 2026
66 of 67 checks passed
@ctdegroot
ctdegroot deleted the charts-comparison branch December 4, 2026 01:50
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.

2 participants