Skip to content

Handle input containing division by zero better#77

Merged
clinssen merged 14 commits intonest:masterfrom
clinssen:handle_div_by_zero
Feb 24, 2025
Merged

Handle input containing division by zero better#77
clinssen merged 14 commits intonest:masterfrom
clinssen:handle_div_by_zero

Conversation

@clinssen
Copy link
Copy Markdown
Contributor

In case of numerical issues with the input, throw a user-friendly error, like:

NumericalIssueException: The variable "zoo" was found. This indicates a numerical problem while solving the system of ODEs. Please check the input for correctness (such as the presence of divisions by zero).

Comment thread odetoolbox/sympy_helpers.py Outdated
@clinssen
Copy link
Copy Markdown
Contributor Author

Sadly, sympy 1.4 seems to not work well with newer Python versions (starting from 3.9). This is probably triggered now by fixing the bug where "Mul" was missing from the list of sympy operators. If #70 is merged, we can drop support for sympy 1.4 altogether. I would suggest to wait for that PR to be merged first.

@clinssen clinssen marked this pull request as draft November 21, 2024 13:07
@clinssen clinssen marked this pull request as ready for review December 4, 2024 14:06
Comment thread .github/workflows/ode-toolbox-build.yml Outdated
@clinssen clinssen requested a review from pnbabu January 31, 2025 17:20
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 12, 2025

Codecov Report

Attention: Patch coverage is 94.33962% with 3 lines in your changes missing coverage. Please review.

Project coverage is 61.67%. Comparing base (b692284) to head (beee2a7).

Files with missing lines Patch % Lines
odetoolbox/sympy_helpers.py 86.95% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #77      +/-   ##
==========================================
+ Coverage   60.77%   61.67%   +0.90%     
==========================================
  Files          15       15              
  Lines        1420     1456      +36     
==========================================
+ Hits          863      898      +35     
- Misses        557      558       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Copy Markdown
Contributor

@pnbabu pnbabu left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@clinssen clinssen merged commit 4d8d531 into nest:master Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants