Closed sgaichas closed 1 month ago
Thanks for flagging it, and sorry to hear about the difficulty! VAST had units built in to match SS3 inputs (back in 2015 or something), and I added explicit units to avoid confusion when generalizing it later. obviously tinyVAST / sdmTMB assume that the user can manage them, and therefore have less code-entropy about it.
Well brainstorming here ... there's several avenues:
amend_output
to have some default when a_x has no unitsextrapolation_list
, then assign units extrapolation_list$Area_km2 = as_units(extrapolation_list$Area_km2, "km2")
, and then pass it back fit_model( ..., extrapolation_list = extrapolation_list)
Any thoughts on which you'd prefer? #1 might be the smoothest workflow.
Thanks Jim, exactly what I was looking for. I edited the workflow to modify the custom extrapolation list with one new line of code (option 3) and it all runs now. Much appreciated!
I am updating a previously fitted model that uses a modified extrapolation grid based on
northwest_atlantic_grid
with an additional strata set. This model and grid were created prior to the Feb 4 2023 release of FishStatsUtils.The model runs, creates a parameter file output, then fails prior to producing the fit object:
I believe it is hanging up here https://github.com/James-Thorson-NOAA/FishStatsUtils/blame/6f600332c377f783533b1be5a4c355fb3dd9031a/R/amend_output.R#L170
I can run models without issue using the unmodified
northwest_atlantic_grid
in the current VAST/FishStatsUtils versions.I cannot see any structural difference between the custom grid I create and the
northwest_atlantic_grid
in VAST that would cause one to work and the other to fail.Is there a way to assign units to the
Area_km_x
field in the custom grid to prevent this error?Thanks for any thoughts, --Sarah