Skip to content

Match experiment step solutions to steps by position - #54

Merged
brosaplanella merged 3 commits into
mainfrom
experiment-step-placeholders
Nov 1, 2026
Merged

brosaplanella merged 3 commits into
mainfrom
experiment-step-placeholders

Conversation

@brosaplanella

Copy link
Copy Markdown
Contributor

Summary

The experiment runner now matches step solutions to steps by position, as PyBaMM does, so step solutions no longer need labels (F-057).

  • A skipped step (its termination condition already holds at the start) keeps its place in solution.cycles[i].steps as a pybamm.EmptySolution. So does a cycle whose steps are all skipped. PyBaMM leaves that case out, so here PyTES goes one step further. As a result, solution.cycles[i].steps[j] always belongs to experiment.cycles[i][j].
  • Breaking: pytes.experiments.step_description is removed, without an alias (maintainer's decision). Read experiment.cycles[i][j].description instead.
  • src/pytes/compat/solution.py is removed. It stored the labels outside pybamm.Solution, which has __slots__ since PyBaMM 26.10 (F-026). The planned upstream request for a metadata field on Solution is withdrawn.
  • DESIGN D10 is updated, F-057 is logged and F-026 is marked superseded. The experiments notebook and Tutorial 6 now pair each step with its solution using zip.

Results are unchanged.

Tests

  • New: a skipped step leaves a placeholder in its place, and a cycle whose steps are all skipped keeps its place.
  • The reference experiment now checks that its step solutions match the steps by position.
  • Full fast suite: 781 passed. Both notebooks run cleanly with nbmake.

🤖 Generated with Claude Code

brosaplanella and others added 2 commits November 1, 2026 08:57
As in PyBaMM, a skipped step keeps its place in solution.cycles[i].steps
as a pybamm.EmptySolution, and so does a cycle whose steps are all
skipped, so solution.cycles[i].steps[j] always belongs to
experiment.cycles[i][j]. The step solutions no longer need labels, so
the compat/solution.py workaround for the __slots__ of pybamm.Solution
is removed, and with it pytes.experiments.step_description (F-057).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@codecov

codecov Bot commented Nov 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@            Coverage Diff            @@
##              main       #54   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           47        46    -1     
  Lines         1767      1755   -12     
  Branches       157       158    +1     
=========================================
- Hits          1767      1755   -12     
Files with missing lines Coverage Δ
src/pytes/compat/__init__.py 100.00% <ø> (ø)
src/pytes/experiments/__init__.py 100.00% <100.00%> (ø)
src/pytes/experiments/experiment.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Ruff's B905 asks for an explicit strict; the steps and their solutions
match one to one, so strict=True.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@brosaplanella
brosaplanella merged commit 1560e21 into main Nov 1, 2026
20 checks passed
@brosaplanella
brosaplanella deleted the experiment-step-placeholders branch November 1, 2026 09:09
@read-the-docs-community

read-the-docs-community Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

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