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

Refactor DEExporter/DEModel/csc_matrix #2311

Merged
merged 2 commits into from
Feb 26, 2024

Conversation

dweindl
Copy link
Member

@dweindl dweindl commented Feb 23, 2024

Reduce unnecessary coupling:

  • csc_matrix as free function - removes the need for the codeprinter in DEModel
  • Move the codeprinter from DEModel to DEExporter where it's actually needed

Not other changes in functionality.

Related to #2306

Reduce unnecessary coupling:

* `csc_matrix` as free function - removes the need for the codeprinter in DEModel
* Move the codeprinter to `DEExporter` where it's actually needed
@dweindl dweindl requested a review from a team as a code owner February 23, 2024 20:07
Copy link

codecov bot commented Feb 23, 2024

Codecov Report

Attention: Patch coverage is 94.73684% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 77.78%. Comparing base (8b324bc) to head (8380038).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #2311   +/-   ##
========================================
  Coverage    77.78%   77.78%           
========================================
  Files          318      318           
  Lines        20534    20535    +1     
  Branches      1436     1436           
========================================
+ Hits         15973    15974    +1     
  Misses        4558     4558           
  Partials         3        3           
Flag Coverage Δ
cpp 73.57% <94.73%> (+<0.01%) ⬆️
cpp_python 34.01% <94.73%> (+<0.01%) ⬆️
petab 36.39% <94.73%> (+<0.01%) ⬆️
python 72.35% <94.73%> (+<0.01%) ⬆️
sbmlsuite ∅ <ø> (∅)

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

Files Coverage Δ
python/sdist/amici/de_export.py 92.14% <100.00%> (ø)
python/sdist/amici/pysb_import.py 94.00% <100.00%> (+0.01%) ⬆️
python/sdist/amici/cxxcodeprinter.py 89.79% <93.54%> (ø)

@dweindl dweindl self-assigned this Feb 23, 2024
# Sympy code optimizations are incompatible with PySB objects, as
# `pysb.Observable` comes with its own `.match` which overrides
# `sympy.Basic.match()`, breaking `sympy.codegen.rewriting.optimize`.
exporter._code_printer._fpoptimizer = None
Copy link
Member

Choose a reason for hiding this comment

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

:( sounds like this is something we want to get fixed. We could convert everything to expressions.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ideally there wouldn't be any PySB objects anymore at the stage of code generation.

@dweindl dweindl added this pull request to the merge queue Feb 26, 2024
Merged via the queue into AMICI-dev:develop with commit 16ec8b2 Feb 26, 2024
25 of 26 checks passed
@dweindl dweindl deleted the refactor_printer_model_exporter branch February 28, 2024 09:27
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.

None yet

2 participants