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

Proof-of-concept data/compare in odin #294

Closed richfitz closed 1 year ago

richfitz commented 1 year ago

This PR provides parse support for the new compare syntax (see https://github.com/mrc-ide/odin.dust/issues/130 and the corresponding PR https://github.com/mrc-ide/odin.dust/issues/131). I doubt we'll ever support this in O.G. odin, but we will eventually in the js version which uses a dust-like target.

Here, we just try and wrangle the input and do as little validation as possible. One nice thing about this approach is that all the bits for checking unused variables etc come along for free.

Note that this is intentionally undocumented; we'll document it properly in odin.dust when supported, and it really will just represent a ghost feature in odin

Alex; just adding you here as a FYI, but any comments very welcome

A reminder of the order of PRs:

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 (e069323) 100.00%.

:exclamation: Current head e069323 differs from pull request most recent head 17925a0. Consider uploading reports for the commit 17925a0 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #294 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 46 46 Lines 5416 5502 +86 ========================================= + Hits 5416 5502 +86 ``` | [Impacted Files](https://app.codecov.io/gh/mrc-ide/odin/pull/294?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/294?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/generate\_c.R](https://app.codecov.io/gh/mrc-ide/odin/pull/294?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mrc-ide#diff-Ui9nZW5lcmF0ZV9jLlI=) | `100.00% <100.00%> (ø)` | | | [R/generate\_js.R](https://app.codecov.io/gh/mrc-ide/odin/pull/294?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mrc-ide#diff-Ui9nZW5lcmF0ZV9qcy5S) | `100.00% <100.00%> (ø)` | | | [R/generate\_r.R](https://app.codecov.io/gh/mrc-ide/odin/pull/294?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mrc-ide#diff-Ui9nZW5lcmF0ZV9yLlI=) | `100.00% <100.00%> (ø)` | | | [R/ir\_parse.R](https://app.codecov.io/gh/mrc-ide/odin/pull/294?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\_serialise.R](https://app.codecov.io/gh/mrc-ide/odin/pull/294?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mrc-ide#diff-Ui9pcl9zZXJpYWxpc2UuUg==) | `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.