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

Fix import error for models with events and 0 states #2112

Merged
merged 2 commits into from
May 26, 2023
Merged

Conversation

dweindl
Copy link
Member

@dweindl dweindl commented May 24, 2023

Closes #2109

@dweindl dweindl requested a review from a team as a code owner May 24, 2023 05:54
@codecov
Copy link

codecov bot commented May 24, 2023

Codecov Report

Merging #2112 (cc540db) into develop (fd1e22e) will decrease coverage by 0.04%.
The diff coverage is 33.33%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2112      +/-   ##
===========================================
- Coverage    76.55%   76.51%   -0.04%     
===========================================
  Files           81       81              
  Lines        14850    14853       +3     
===========================================
- Hits         11368    11365       -3     
- Misses        3482     3488       +6     
Flag Coverage Δ
cpp 73.55% <ø> (-0.05%) ⬇️
petab 54.39% <33.33%> (-0.02%) ⬇️
python 76.79% <33.33%> (-0.03%) ⬇️
sbmlsuite ∅ <ø> (∅)

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

Impacted Files Coverage Δ
python/sdist/amici/de_export.py 91.43% <33.33%> (-0.18%) ⬇️

... and 2 files with indirect coverage changes

@@ -1992,6 +1992,9 @@ def _compute_equation(self, name: str) -> None:
for ie in range(self.num_events())
]

elif name == "deltasx" and self.num_states_solver() * self.num_par() == 0:
self._eqs[name] = []

elif name == "deltasx":
Copy link
Member

Choose a reason for hiding this comment

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

wouldn't it be better to integrate with the code below, i.e. add a special case for self.num_states_solver() * self.num_par() == 0?

Copy link
Member Author

@dweindl dweindl May 25, 2023

Choose a reason for hiding this comment

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

Generally, yes. But I didn't want to increase the nesting depth further. It's already a mess.

Copy link
Member

Choose a reason for hiding this comment

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

could reuse same initialization and return in case of self.num_states_solver() * self.num_par() == 0 since simplification doesn't do anything.

@dweindl dweindl enabled auto-merge May 25, 2023 20:09
@dweindl dweindl added this pull request to the merge queue May 25, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 25, 2023
@dweindl dweindl merged commit d301df6 into develop May 26, 2023
@dweindl dweindl deleted the fix_2109 branch May 26, 2023 07:14
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.

2 participants