While working on the sardine case study (edit: here's the link to the line causing the error: https://github.com/NOAA-FIMS/case-studies/blob/render-case-studies-separately/content/SWFSC-sardine.qmd#L135), I got a series of errors starting with
Group-level information for age composition errors
* type = age_comp
* fleet = fleet1
* timing = 2005
* unit = proportion
* uncertainty = 124.28
! Errors are as follows:
x The sum is equal to 1.0000001158674, not 1.0.
This is frustrating because the case-study code explicitly divides by the sum to create proportions and also because for purposes of R's typical rounding, the result IS equal to 1, so it's not clear how to fix the problem:
data_4_model |> dplyr::filter(type == "age_comp", timing == 2005, fleet == "fleet1") |> dplyr::pull(value) |> sum()
[1] 1
I know the integer vs decimal proportion debate is still ongoing in #326, but will it break anything if we relax this tolerance value a bit without breaking anything for the sake of avoiding unnecessary frustration:
|
if (all(units == "proportion") && abs(sum_of_value - 1.0) > 1e-8) { |
While working on the sardine case study (edit: here's the link to the line causing the error: https://github.com/NOAA-FIMS/case-studies/blob/render-case-studies-separately/content/SWFSC-sardine.qmd#L135), I got a series of errors starting with
This is frustrating because the case-study code explicitly divides by the sum to create proportions and also because for purposes of R's typical rounding, the result IS equal to 1, so it's not clear how to fix the problem:
I know the integer vs decimal proportion debate is still ongoing in #326, but will it break anything if we relax this tolerance value a bit without breaking anything for the sake of avoiding unnecessary frustration:
FIMS/R/fimsframe.R
Line 766 in 1055ae1