-
Notifications
You must be signed in to change notification settings - Fork 0
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
Allowed delayed expressions, not just variables #129
Conversation
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.
There's one typo in the instructions - and a couple of comments to help my understanding.
For a future ticket maybe - the error could be better if I try to do multiple delays on the same line -
dat <- odin_parse({
deriv(x) <- a
deriv(y) <- 2
initial(x) <- 0
initial(y) <- 0
a <- (x + y) / 2
c <- delay(a, 1) + delay(a, 2)
output(z) <- c
})
Error in `odin_parse()`:
! Unsupported function 'delay'
→ Context:
c <- delay(a, 1) + delay(a, 2)
ℹ For more information, run odin2::odin_error_explain("E1027")
And we'll have some doc tickets for vignettes (eg, functions) / odin-monty later...
## The delay time must be constant | ||
|
||
We require that the delay time is known at first model initialisation and not updated subsequently (i.e., that it is numeric, a literal value assigned to symbol or a paramter with `constant = TRUE`). | ||
|
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.
So does this mean:
We can't write a model that says... depending on how fat our mosquitos have grown, they will... excrete what they ate f(size) time ago - where f(size) varies in the model....
(Would anyone want such a thing...)
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.
yeah, that's right. This sort of non-constant-time delay could theoretically be interesting I'm sure, but it creates some issues in the solving and I did not add support for that into the way that delays were implemented in dust
Co-authored-by: Wes Hinsley <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #129 +/- ##
===========================================
+ Coverage 99.85% 100.00% +0.14%
===========================================
Files 20 20
Lines 3421 3504 +83
===========================================
+ Hits 3416 3504 +88
+ Misses 5 0 -5 ☔ View full report in Codecov by Sentry. |
Fixed now by 1d9ce17, we have a nice hook for this that I've reused |
This is required for the malaria folk and it introduces quite a few new complexities.
After this is in, I can start on delayed delays, though first I'll probably do a bit of a triage through the odin1 tests to see what we actually do with delays