Repository navigation
FEAT: swap cost model core - #193
Conversation
|
What's coming after this PR This is the first of a stack that builds a preflight time and cost estimate on top of 1. Rest of the engine (next PR)
2. Estimate data in preflight (backend only, no UI)
3. Estimate card in the preflight dialog (first UI)
4. Swap timeline and live recompute
5. Purge controls (only if you want them)
6. Purge guard (only if you want it)
Groups 2 to 4 come with tests, and the UI ones with screenshots. Nothing changes for users until group 3. Everything in this PR and in group 1 is library code that nothing calls yet. Happy to reorder, merge or drop any of these. Groups 5 and 6 are the ones where your steer matters most. |
Estimate lane, slice E1a of 2.
Adds
multiace/tools/swap_cost.py, the first half of the swap cost model: how many seconds one swap adds to a print.ace.cfg(length / speed): the retract, the load and the seat overshoot. Per-ACE and per-slot overrides follow the same precedence asget_swap_retract_length.UNMEASURED_S. They are guesses, not measurements. With the shippedace.cfgdefaults they reproduce the existingBG_SWAP_COST_INLINE_S = 210andBG_SWAP_COST_BG_S = 30.ace.pyor the post-processor, so the same file can later run in the backend and in the browser worker.Nothing imports the module yet, so there is no behaviour change. The purge model, header parser and estimate block follow in E1b.
Tests: 16 new tests in
tests/unit/test_swap_cost.py(arithmetic from config, background vs inline, overrides, calibration).pytest tests/unit: 257 passed.Size: 223 lines of code, 117 lines of tests.