Closed richfitz closed 1 year ago
Base: 100.00% // Head: 100.00% // No change to project coverage :thumbsup:
Coverage data is based on head (
fc50393
) compared to base (fa7b074
). Patch coverage: 100.00% of modified lines in pull request are covered.:exclamation: Current head fc50393 differs from pull request most recent head 5bdb6f7. Consider uploading reports for the commit 5bdb6f7 to get more accurate results
:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
This PR adds a new syntax for getting debugging information out of an odin model by printing internal variables as the model runs.
There's quite a bit of checking still to add here - it would be fairly easy to provide a
print()
statement that can't be satisfied or can't compile. But that's just a case of accumulating bad cases and putting in some protection - given this is already big (and useful in scope) it's probably worth holding off on for a bit.The main use I have for this is calling from odin.dust, so the main focus here is making sure that we get something sensible included into the intermediate model representation. Actually wiring it up is fairly straightforward. I've added a vignette at the same time as the implementation (which does make this a bit bigger) but at least provides some background for the idea. The corresponding odin.dust implementation is here: https://github.com/mrc-ide/odin.dust/pull/125
This is not implemented for the js target yet, as there is not a native sprintf that we can use - because this might be useful from wodin I'll have a separate think about that