Skip to content

Show a missing score in the README results example; add run-meta regression tests - #139

Open
avalyset wants to merge 3 commits into
SimulaMet:devfrom
avalyset:fix/run-meta-followups
Open

avalyset wants to merge 3 commits into
SimulaMet:devfrom
avalyset:fix/run-meta-followups

Conversation

@avalyset

@avalyset avalyset commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to the run metadata from #138. The two code fixes this PR first carried came in with #143 (584f120): RepeatedExperimentResults.load() keeps each run's meta, and AuditExperiment records scenario_pack when it is given a pack name. After the rebase on dev, this PR has the rest.

Show a missing score in the README results example (README.md)
AuditResults.score is None when nothing was graded, so the example printed Score: None/100. It now prints n/a (nothing graded), the same text summary() uses.

Two regression tests (tests/test_repeated_experiments.py)

  • TestSerialization::test_save_load_preserves_each_runs_meta: each run's meta survives save()/load(), and a run saved without meta loads with {}.
  • TestAuditExperimentRepetitions::test_pack_name_is_recorded_in_each_runs_meta: a run started with a pack name records it, and a run started with a list of scenarios records none.

dev has its own tests for both fixes (test_audit_regressions_experiment.py:161-168, test_audit_regressions_pass6.py:84-86). These two add the run without meta and the scenario-list case. If you would rather not keep them, the README change stands on its own.

Testing: full suite in a fresh Python 3.13 venv with .[dev,tracing], run with pytest -p no:randomly -n 4. dev (6b108cc) gave 2441 passed and 13 skipped; this branch gives 2443 passed and 13 skipped. The only per-test difference is the two new tests. ruff check --select E9,F821 . is clean.

AI disclosure: implemented with Claude Code.

@avalyset
avalyset force-pushed the fix/run-meta-followups branch from 9721918 to 0972e70 Compare November 4, 2026 13:11
@kelkalot
kelkalot changed the base branch from main to dev November 5, 2026 10:28
dev already passes meta=run_data.get("meta") in RepeatedExperimentResults.load (584f120). This keeps the regression test from the original fix, which also checks that a run saved without meta loads with an empty dict.
dev already sets result.meta["scenario_pack"] when AuditExperiment is given a pack name (584f120). This keeps the regression test from the original fix, which also checks that a run given a scenario list records none.
AuditResults.score is None when nothing was graded, so the example
printed "Score: None/100". It now prints the same "n/a (nothing graded)"
that summary() prints in that case.
@avalyset
avalyset force-pushed the fix/run-meta-followups branch from 0972e70 to 0919c58 Compare November 6, 2026 20:00
@avalyset avalyset changed the title Keep run meta on load, record scenario_pack in experiment runs, and handle a missing score in the README Show a missing score in the README results example; add run-meta regression tests Nov 6, 2026

This branch has not been deployed

No deployments
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