Skip to content

Conversation

@sabinala
Copy link
Contributor

@sabinala sabinala commented Feb 4, 2025

Adds a descriptive error message when an underflow error is thrown by an adaptive step size solver, or infinite/NaN values are returned for states and/or observables.

See #643.

@sabinala
Copy link
Contributor Author

sabinala commented Feb 4, 2025

The changes to compiled_dynamics have been tested (and shown to work for the simulate and calibrate interfaces, as well as the ensemble versions) in this notebook: https://github.com/ciemss/pyciemss/blob/sa-solver-error-msgs/docs/source/Solver_error_messages.ipynb.

Normally, I would write a unit test for this, but https://github.com/DARPA-ASKEM/simulation-integration has been archived, so I can no longer add models to this repo! @SamWitty let me know what you think, either we can merge the PR without a test, or I can add the test and add the offending model to another location and then to tests/fixtures.

@sabinala sabinala added the WIP PR submitter still making changes, not ready for review label Feb 4, 2025
@sabinala
Copy link
Contributor Author

sabinala commented Feb 4, 2025

Also, I do not know why linting is failing! I ran make format before committing, and now I'm getting this error message from lint:

32s
Run ./scripts/lint.sh
+ mypy --ignore-missing-imports pyciemss/
pyciemss/compiled_dynamics.py:267: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
pyciemss/compiled_dynamics.py:268: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
Success: no issues found in 30 source files
+ isort --check --profile black --diff pyciemss/ tests/
+ black --check pyciemss/ tests/
would reformat /home/runner/work/pyciemss/pyciemss/pyciemss/integration_utils/intervention_builder.py

Oh no! 💥 💔 💥
1 file would be reformatted, 42 files would be left unchanged.
Error: Process completed with exit code 1.

I have not touched intervention_builder.py, the only file that is touched in this PR is compiled_dynamics.py

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@sabinala sabinala added awaiting review PR submitter awaiting code review from reviewer and removed WIP PR submitter still making changes, not ready for review labels Feb 5, 2025
@sabinala sabinala requested a review from SamWitty February 5, 2025 19:35
Copy link
Contributor

@SamWitty SamWitty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@SamWitty SamWitty merged commit bbfa6e1 into main Feb 5, 2025
7 checks passed
@SamWitty SamWitty deleted the sa-solver-errors branch February 5, 2025 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review PR submitter awaiting code review from reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants