mrc-ide / odin

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

Prefer glue_data() when data might be list-ish, not an actual environment #310

Closed jennybc closed 8 months ago

jennybc commented 9 months ago

This PR is inspired by doing revdep checks for glue. I'm going to temporarily back off on the associated change in glue, just so I can release without any breakage of other packages.

But please do consider this a heads up that, in the future, glue::glue() will error when .envir is not an actual environment. .envir has always been documented to be an environment and I'd like to make that actually true.

OTOH glue_data() does officially accept something "list-ish" as .x. So I think it's a better choice for your usage.

Backstory in glue:

https://github.com/tidyverse/glue/issues/308 https://github.com/tidyverse/glue/commit/e2b74ff17704261b5a7da25b4ebd2dec94740764

richfitz commented 9 months ago

Thanks Jenny - I'll get this sorted shortly in the new year. For various reasons the CRAN version is miles behind these sources and I'll backport these changes to the CRAN branch so that I can get it released there if this ends up being an issue for you.

codecov[bot] commented 9 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (c51efee) 99.98% compared to head (4683f20) 99.98%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #310 +/- ## ======================================= Coverage 99.98% 99.98% ======================================= Files 48 48 Lines 5560 5559 -1 ======================================= - Hits 5559 5558 -1 Misses 1 1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

jennybc commented 9 months ago

Sounds good! I didn't get glue released before the CRAN holiday hiatus anyway. But I am going to release when it reopens, without the change that breaks odin (and a couple of other packages).

Then I'll re-implement the change in the dev version of glue. So presumably we're just laying the groundwork for a smooth release of glue in the future, in terms of revdep breakage.

jennybc commented 8 months ago

I released glue 1.7.0 today without this change and then re-introduced the change. So you can expect it to be present in glue's next release, which I have no concrete plans for. But barring an unforeseen release in the next ~2 weeks, I will consider this issue as me having given plenty of notice of the change.

This also means you can check your package in the presence of dev glue to test your own fix for the issue.

jennybc commented 2 weeks ago

At long last I am about to make a glue release. I think this PR was merged but this is not available in the CRAN version of odin yet? I still see it in my failed revdeps:

https://github.com/tidyverse/glue/blob/main/revdep/problems.md#odin

So this is a just another heads up. Some new revdeps have cropped up since I last made all the PRs, so it will take me a little while to submit. So you would be able update on CRAN before this new glue version hits and breaks odin.

richfitz commented 2 weeks ago

Thanks Jenny. I'm in the middle of rewriting this whole thing, but I'll do an update for CRAN tomorrow or next week. I've been dealing with strict headers this week so I have my systems fairly dialed and flameproof clothing handy

richfitz commented 1 week ago

This is on CRAN now