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

Speedup conservation law computation #1754

Merged
merged 2 commits into from
Apr 4, 2022
Merged

Speedup conservation law computation #1754

merged 2 commits into from
Apr 4, 2022

Conversation

FFroehlich
Copy link
Member

@FFroehlich FFroehlich commented Apr 3, 2022

So it turns out, using sum for symbolic variables is a really bad idea (see sympy/sympy#13945).

Tested on a model with ~8k species.
Previous:

2022-04-02 20:52:20.502 - amici.pysb_import - INFO - Finished computing PySB conservation laws    + (3.17E+03s)

Now:

2022-04-03 09:30:18.220 - amici.pysb_import - INFO - Finished computing PySB conservation laws    + (1.90E+02s)

@FFroehlich FFroehlich added python PySB PySB import related performance labels Apr 3, 2022
@FFroehlich FFroehlich requested a review from dweindl April 3, 2022 02:35
@codecov
Copy link

codecov bot commented Apr 3, 2022

Codecov Report

Merging #1754 (836391f) into develop (da56a08) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #1754   +/-   ##
========================================
  Coverage    77.76%   77.77%           
========================================
  Files           74       74           
  Lines        12012    12012           
========================================
+ Hits          9341     9342    +1     
+ Misses        2671     2670    -1     
Flag Coverage Δ
cpp 74.87% <ø> (+0.01%) ⬆️
petab 59.26% <0.00%> (ø)
python 68.20% <100.00%> (ø)

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

Impacted Files Coverage Δ
python/amici/pysb_import.py 93.90% <100.00%> (ø)
src/sundials_matrix_wrapper.cpp 80.08% <0.00%> (-0.45%) ⬇️
src/solver_cvodes.cpp 70.43% <0.00%> (+0.16%) ⬆️
src/exception.cpp 81.08% <0.00%> (+5.40%) ⬆️

Copy link
Member

@dweindl dweindl left a comment

Choose a reason for hiding this comment

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

😳 👍

python/amici/pysb_import.py Outdated Show resolved Hide resolved
python/amici/pysb_import.py Outdated Show resolved Hide resolved
Co-authored-by: Daniel Weindl <dweindl@users.noreply.github.com>
@sonarcloud
Copy link

sonarcloud bot commented Apr 3, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@FFroehlich FFroehlich merged commit 347a86d into develop Apr 4, 2022
@FFroehlich FFroehlich deleted the speedup_pysb_cls branch April 4, 2022 02:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance PySB PySB import related python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants