Skip to content

125: Stop check_* masking return values - #208

Merged
AnderBiguri merged 7 commits into
CambridgeCIA:mainfrom
TimLeach635:125-fix-checks
Oct 12, 2026
Merged

AnderBiguri merged 7 commits into
CambridgeCIA:mainfrom
TimLeach635:125-fix-checks

Conversation

@TimLeach635

@TimLeach635 TimLeach635 commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Most of this code was written by AI, but I'm writing this description myself.

Fixes #125. Previously, each check in LIONsolver overwrote the return_code. Now, use max to collate the return codes (not a perfect method, so I've raised #209 to improve how the codes work, but it's alright for now).

Secondly, fixes a few incorrect function signature usages.

Thirdly, fixes a problem whereby verbose=True causes the return code to drop entirely.

claude and others added 6 commits September 23, 2026 14:19
Tests for the return codes of check_*_ready/check_complete, the argument
mismatch in check_complete's call to check_validation_ready, and the CPU
device fallback. Currently failing.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Assert check_checkpointing_ready passes for a configured solver, and drop
mock LION modules left in sys.modules by other test files so this module
imports the real ones regardless of test order.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Accumulate return codes across checks instead of overwriting them, return a
code regardless of verbosity, pass autofill/verbose correctly from
check_complete, check the do_load_checkpoint flag rather than the
load_checkpoint method, and fall back to CPU when CUDA is unavailable.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Drop commentary that described past behaviour and shorten the rest.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@AnderBiguri

Copy link
Copy Markdown
Member

Great thanks! I think Claude overdoes a bit the tests and in this case are not necesary, can you remove them?

@TimLeach635

Copy link
Copy Markdown
Contributor Author

Done, ready for re-review @AnderBiguri 😄

@AnderBiguri
AnderBiguri merged commit 4243360 into CambridgeCIA:main Oct 12, 2026
1 check passed
@AnderBiguri

Copy link
Copy Markdown
Member

Done!

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.

LIONSolver check_*** can cover up issues

3 participants