-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
Modifies rateinterval API to accept computed urate
.
#288
base: master
Are you sure you want to change the base?
Conversation
Pull Request Test Coverage Report for Build 4044857921Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
Let me think about the interface here a bit. This may be the easiest way to go, but I wonder if it would be better to have some kind of dispatch-based resolution where one can either have |
Take your time. It might also be worth taking into account how to handle the I tried playing with the multiple dispatch mechanism but could not find an elegant solution. |
Seconding the idea of allowing a single function to return multiple quantities. Also, to throw another spanner into the works: in my use case, it would be most efficient to compute all three of |
Perhaps it would be best to just have a separate kwarg? E.g. the user can specifiy |
This requires some thought since I think frequently one won't want to evaluate the rate simultaneous to the rate bounds for performance reasons, so we'd also want to support versions that don't evaluate I wonder if we might instead have a way of communicating to users that we haven't updated time and/or the system state since the last time one of the rate functions was called (so a user could just cache the values and know they are still valid if it makes sense for them to generate them all at once). |
A problem with the current implementation of
Coevolve
is that it might computeurate
twice. Once when computing the actualurate
and another time ifrateinterval
callsurate
.This problem is clear in the Hakwes benchmark. Below you can see a profile of the simulation:
This PR modifies the API of
rateinterval
torateinterval(u, p, t, urate)
. With this modification, you can see that much less time is spent inrateinterval
.The downside is a more verbose API. The API will also break for when using
VariableRate
withCoevolve
. However, since the aggregator is relatively new, it might be worth considering this change. I am happy to discuss more elegant alternatives.