Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various fixes to calc_CentralDose() and snapshot tests #304

Merged
merged 4 commits into from
Oct 10, 2024
Merged

Conversation

mcol
Copy link
Contributor

@mcol mcol commented Oct 10, 2024

Fixes #302 as discussed in #302 (comment):

  • deprecates the na.rm argument, removing missing values by default
  • deals with negative values in De and De.error

It also stops the fixed-point early iteration if sigma converges to zero, so that we don't produce avoidable infinities.

This also adds some snapshot tests (part of #243).

mcol added 4 commits October 10, 2024 13:54
We deprecate the `na.rm` argument as allowing the user to set it to FALSE
would lead to unusable results (all NAs) or buggy behaviour.
If sigma converges to zero we stop the fixed-point interation early, as
otherwise a zero sigma value would cause divisions by zero and produce
infinities, which would eventually lead to this error message:

  Error in sig/delta : non-numeric argument to binary operator

thrown when computing

  if(!log) sig <- sig / delta

as sig is of class "try-error", as it is computed as:

  sig <- try(seq(sig0, sig1, sig1 / 1000), silent = TRUE)

where sig1 is Inf.
@mcol mcol merged commit d5ee08d into master Oct 10, 2024
9 of 18 checks passed
@mcol mcol deleted the issue_302 branch October 10, 2024 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

calc_CentralDose() ... a few bugs
1 participant