-
Notifications
You must be signed in to change notification settings - Fork 31
Support for event priorities #2730
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
base: develop
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #2730 +/- ##
===========================================
+ Coverage 77.94% 77.95% +0.01%
===========================================
Files 327 327
Lines 23065 23079 +14
Branches 1484 1484
===========================================
+ Hits 17977 17991 +14
Misses 5077 5077
Partials 11 11
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
7126ffc
to
0929828
Compare
Support plain numeric priorities of SBML events (not the arbitrary expressions that SBML would allow). Also removes an incorrect check for whether we support useValueFromTriggerTime.
pending_events_.sort([](Event const& a, Event const& b) { | ||
// The priority is NaN if not defined. In this case, the execution | ||
// order is undefined, so this does not need any special treatment. | ||
return a.get_priority() > b.get_priority(); |
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.
what about mixed defined and undefined event priories (sbml spec says we can do whathever we want with undefined prios). Also in the case of equal priority SBML spec says events should be picked randomly.
@@ -736,6 +737,13 @@ def __init__( | |||
self._state_update = state_update | |||
self._initial_value = initial_value | |||
|
|||
if priority is not None and not priority.is_Number: | |||
raise NotImplementedError( | |||
"Only fixed numbers are currently supported as event priority." |
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.
"Only fixed numbers are currently supported as event priority." | |
"Currently, only numeric values are supported as event priority." |
Support plain numeric priorities of SBML events (not the arbitrary expressions that SBML would allow).
If there are multiple event assignments to be executed at the same model time, the ones with higher priority values come first.
Closes #2718.
Also:
useValueFromTriggerTime=True