Repository navigation
refactor(api): the carry is an argument of the axis rather than of solve_over, so an archive's axis holds its carry - #1980
Conversation
…lve_over, so an archive's axis holds its carry Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G1TmcQZZCctsVr54HE93qS
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G1TmcQZZCctsVr54HE93qS
Merging this PR will degrade performance by 14.76%
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
Note
The following content was generated by AI.
carry=moves fromsolve_overontoEachCoordinateandEachWindow, as #1888 has it, for one axis. An archive's axis now holds its carry, sosolve_over(spec, sources, archive.axis)runs a sweep again.axis.jsonis unchanged byte for byte.What changed
EachCoordinate(..., carry=)andEachWindow(..., carry=), a keyword-only{parameter: variable}, empty by default.solve_overlosescarry=.SweepArchive.carryandArchivedInputs.carryare gone. The carry isarchive.axis.carry.mainare hashable, and a new test (test_an_axis_that_carries_is_still_hashable) holds that.carry=on the axis.Why no layout number rises
On
main, the archive wrote the carry as acarrykey beside the axis's own keys inaxis.json. The axis now writes the same key in the same place. I wrote the same carried rolling horizon with released 0.8.1 and with this branch, andcmpreports the twoaxis.jsonfiles identical:So
INPUTS_LAYOUTstays at 1, and an 0.8.1 archive reads back with its carry on the axis.Breaking, and where coverage moved
solve_over(..., axis, carry=c)→solve_over(..., EachWindow(..., carry=c)), orreplace(axis, carry=c)for an axis held in a constant. Every call in tests, examples and docs moved. The rewrite matches feat(api): a sweep can be cut by several axes at once, each carrying its own state, such as a rolling horizon per scenario or a pathway whose decades roll through their hours #1888's (4cb40c4c) call for call, so feat(api): a sweep can be cut by several axes at once, each carrying its own state, such as a rolling horizon per scenario or a pathway whose decades roll through their hours #1888 mergesmainwith few conflicts.archive.carry→archive.axis.carry, andinputs.carry→inputs.axis.carry. The two assertions that read them now read the axis.test_a_rolling_horizon_archive_reads_back_its_answernow compares against the axis with its carry.Mutation table, gates, and what was not done
axes.py:hash=Falsedropped from bothcarryfieldstest_an_axis_that_carries_is_still_hashable[coordinate]and[window],TypeError: unhashable type: 'dict'I took it by hand: committed tree,
git checkout --restore,__pycache__dropped. Before the probe existed, the full suite passed with this mutation (5605 passed). That is why the probe was added.pixi run check: lint, format and typecheck clean, 5605 passed, 566 skipped, 4 xfailed.pixi run -e docs docs-build: strict, no issues; the sweep tour runs its examples. Not run:docs-test,test-bench,test-floors.to_dict) is a separate PR.🤖 Generated with Claude Code
https://claude.ai/code/session_01G1TmcQZZCctsVr54HE93qS
Generated by Claude Code