Repository navigation
Audit fixes: optimizer limits, safe workbook writes, time_limit handling - #3
Draft
matveygreschner wants to merge 4 commits into
Draft
matveygreschner wants to merge 4 commits into
matveygreschner wants to merge 4 commits into
Conversation
The test failed on a busy machine (10 to 13 s wall against an 8 s limit). Profiling the 19,000-debit solve showed about 0.9 s of CPU under cProfile and 0.6 s wall when idle, so there is no code regression and no clean speed-up to take. The assertion now uses process_time, which ignores time spent waiting for other jobs but still catches a real slowdown.
optimize_mix: time_limit must be above 0 and at most 300 s per solve, horizon_weeks 1 to 520, with errors that name the argument. Results gain a warnings list for any solve stopped at its time limit, a CAUTION first summary line, and an optimal flag on each sensitivity row. workbook: refuses a directory, and refuses to overwrite the workbook or its .cells.json unless force is true. CI and release workflows pass force to rebuild the committed workbook. Docs, skill references and CHANGELOG updated; vendored skill copies rebuilt.
… symlink workbook paths, fix horizon range in docs Vendored skill copies and generated references rebuilt with scripts/build_skills.py.
…cept numpy time_limit workbook: build in a scratch folder beside the target, then place with an exclusive create (no force) or an atomic replace (force), so a file or link appearing after the checks is never written through. Symbolic link as the file is still refused, with or without force. A symlinked containing folder is allowed on purpose (macOS /tmp is one) and is now documented in the docstring, skill reference and CHANGELOG. optimize_mix: time_limit accepts any real number (numpy int and float included); bool, str and None are still refused. Regression tests for all three; vendored skill copies rebuilt.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes from the 2026-12-05 audit (low-severity items).
optimize_mixguards its limits and flags plans the solver could not prove optimal.time_limit: errors show the real value, non-numeric values are rejected, numpy whole numbers are accepted.test_long_schedules_solve_quicklymeasures CPU time instead of wall time.331 tests pass locally. QA review approved.