epinowcast / primarycensored

Primary event censored distributions in R and Stan.
https://primarycensored.epinowcast.org/
Other
7 stars 1 forks source link

use local environment for `fitdist` call #113

Closed sbfnk closed 1 week ago

sbfnk commented 1 week ago

With reference to https://github.com/epinowcast/primarycensoreddist/issues/62#issuecomment-2353255911 shouldn't this work? (tested locally it does but might be missing some complexity).

codecov[bot] commented 1 week ago

Codecov Report

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

Project coverage is 99.76%. Comparing base (1dbaf5f) to head (79c0c6b). Report is 2 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #113 +/- ## ========================================== - Coverage 99.76% 99.76% -0.01% ========================================== Files 10 10 Lines 427 424 -3 ========================================== - Hits 426 423 -3 Misses 1 1 ``` | [Flag](https://app.codecov.io/gh/epinowcast/primarycensoreddist/pull/113/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=epinowcast) | Coverage Δ | | |---|---|---| | [](https://app.codecov.io/gh/epinowcast/primarycensoreddist/pull/113/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=epinowcast) | `?` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=epinowcast#carryforward-flags-in-the-pull-request-comment) to find out more.

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

seabbs commented 1 week ago

Nice this does look like it works though I find this confusing as I tested nearly the same approach with withr (maybe nearly is the key point)!

seabbs commented 1 week ago

Checked this out locally and it does work. I have no idea why it wasn't before. Updated this to add you as a contributor and update the news. Thanks for checking this out!

sbfnk commented 1 week ago

Do we need to add a requireNamespace() check for withr to the head of the function?

seabbs commented 1 week ago

yes

seabbs commented 1 week ago

I'll hotfix