mrc-ide / odin

ᚩ A DSL for describing and solving differential equations in R
https://mrc-ide.github.io/odin
Other
102 stars 12 forks source link

Minor typos #287

Open CGMossa opened 1 year ago

CGMossa commented 1 year ago

Thanks for accepting my previous issue. I'm exploring odin. I find it very lovely.

Found more typos. This time a PR is submitted instead.

I'd like to also hijack this PR and ask about this:

odin::odin({
  update(S) <- -beta * S * I
  update(I) <- +beta * S * I
  N <- S + I

  beta <- user(0.005)
  initial(S) <- 100.0
  initial(I) <- 1.0
}, verbose = TRUE, validate = TRUE, target = "c", pretty = TRUE,
  skip_cache = TRUE) ->
  model_generator
model_generator$new() -> model
model$run(seq.default(0, 5, length.out = 25))
Error: Expected integer input for 'step'
Called from: as_integer(step)

Why is that? Passing numeric steps for the lorenz example works.

> traceback()
4: stop(sprintf("Expected integer input for '%s'", name), call. = FALSE)
3: as_integer(step)
2: private$odin$wrapper_run_discrete(self, private, step, y, ..., 
       use_names = use_names) at odin.R#100
1: model$run(seq.default(0, 5, length.out = 25))
CGMossa commented 1 year ago

Somehow it works when I correct the albeit stupid mistake deriv instead of update.. But I guess that makes total sense.

CGMossa commented 1 year ago

Perfect! This works and may get reviewed now.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (938cb5d) 100.00% compared to head (bf2c834) 100.00%.

:exclamation: Current head bf2c834 differs from pull request most recent head 048ad05. Consider uploading reports for the commit 048ad05 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #287 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 46 46 Lines 5416 5416 ========================================= Hits 5416 5416 ``` | [Impacted Files](https://app.codecov.io/gh/mrc-ide/odin/pull/287?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mrc-ide) | Coverage Δ | | |---|---|---| | [R/common.R](https://app.codecov.io/gh/mrc-ide/odin/pull/287?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mrc-ide#diff-Ui9jb21tb24uUg==) | `100.00% <ø> (ø)` | | | [R/ir\_parse.R](https://app.codecov.io/gh/mrc-ide/odin/pull/287?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mrc-ide#diff-Ui9pcl9wYXJzZS5S) | `100.00% <100.00%> (ø)` | | | [R/ir\_parse\_config.R](https://app.codecov.io/gh/mrc-ide/odin/pull/287?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mrc-ide#diff-Ui9pcl9wYXJzZV9jb25maWcuUg==) | `100.00% <100.00%> (ø)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.