Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make is-zero-checks compatible with the upcoming sympy>1.12 #2350

Merged
merged 1 commit into from
Mar 5, 2024

Conversation

dweindl
Copy link
Member

@dweindl dweindl commented Mar 5, 2024

Current sympy master (tested: 0ededfcfc033ddca2d1d54a0eda85bf53c63761c):

IPython console for SymPy 1.13.dev (Python 3.12.2-64-bit) (ground types: python)
In [1]: Float(0) == 0
Out[1]: False
In [2]: Float(0).is_zero
Out[2]: True

vs 1.12:

Python console for SymPy 1.12 (Python 3.12.2-64-bit) (ground types: python)
>>> Float(0) == 0
True
>>> Float(0).is_zero
True

Therefore, replace == 0 by .is_zero.

Amongst other potential issues, this fixes zeros in sparse matrices. Closes #2320.

@dweindl dweindl linked an issue Mar 5, 2024 that may be closed by this pull request
@dweindl dweindl changed the title Make is-zero-checks compatible to the upcoming sympy>1.12 Make is-zero-checks compatible with the upcoming sympy>1.12 Mar 5, 2024
@dweindl dweindl self-assigned this Mar 5, 2024
Copy link

codecov bot commented Mar 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.94%. Comparing base (2235ab7) to head (d3e069e).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2350      +/-   ##
===========================================
+ Coverage    77.86%   77.94%   +0.07%     
===========================================
  Files          324      324              
  Lines        20731    20731              
  Branches      1449     1449              
===========================================
+ Hits         16143    16159      +16     
+ Misses        4585     4569      -16     
  Partials         3        3              
Flag Coverage Δ
cpp 73.74% <100.00%> (+0.07%) ⬆️
cpp_python 34.34% <100.00%> (ø)
petab 36.86% <66.66%> (ø)
python 72.52% <100.00%> (+0.07%) ⬆️
sbmlsuite ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
python/sdist/amici/cxxcodeprinter.py 90.19% <100.00%> (ø)
python/sdist/amici/de_model.py 92.63% <100.00%> (ø)

... and 4 files with indirect coverage changes

Current sympy master (tested: 0ededfcfc033ddca2d1d54a0eda85bf53c63761c):

```python
IPython console for SymPy 1.13.dev (Python 3.12.2-64-bit) (ground types: python)
In [1]: Float(0) == 0
Out[1]: False
In [2]: Float(0).is_zero
Out[2]: True
```
vs 1.12:
```python
Python console for SymPy 1.12 (Python 3.12.2-64-bit) (ground types: python)
>>> Float(0) == 0
True
>>> Float(0).is_zero
True
```

Therefore, replace `== 0` by `.is_zero`.

Amongst other potential issues, this fixes zeros in sparse matrices. Closes AMICI-dev#2320.
@dweindl dweindl marked this pull request as ready for review March 5, 2024 15:56
@dweindl dweindl requested a review from a team as a code owner March 5, 2024 15:56
@dweindl dweindl merged commit 89b00cf into AMICI-dev:develop Mar 5, 2024
20 checks passed
@dweindl dweindl deleted the fix_2320_iszero branch March 5, 2024 17:59
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.

Result of amici.de_export.DEModel.sparseeq sometimes contains zeros
2 participants