-
Notifications
You must be signed in to change notification settings - Fork 31
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
Conversation
Codecov Report
Additional details and impacted files@@ 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
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@@ -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": |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Closes #2109