r4ss
r4ss copied to clipboard
`SS_tune_comps()` does not change input files if `niters_tuning = 0`
https://github.com/r4ss/r4ss/blob/2d1ceaa0a82d15102ead9c83a13fdcc7a1e5c142/R/SS_tune_comps.R#L305
I recently wanted to change the input files for hake based on the suggested tuning but I did not want to run the model because we run the model in MCMC, which is not supported by this function. I also did not want all of the associated output from a model run or the time it takes to run the model. As written, SS_tune_comps()
does not allow you to provide a directory with input files and a replist and get changed input files without running the model. Not entirely sure what the best way is to code this but it would be a great feature to have.
I see 2 options for this.
-
Already in r4ss, you could
SS_tune_comps(niters_tuning = 0)
and then use the table output insSS_varsadjust
(as shown in this example -
We could make changes to wrap a call to SS_varadjust within SS_tune_comps, which could be more intuitive for users. I'm not sure if we would want to create a new option (e.g., add a new argument
write_files_niters_0
so when TRUE and niters = 0, the tunings and new files are generated and when FALSE, only the tunings are generated), or just overwrite the existing niters_tuning = 0 option.
Sorry, I missed this issue back in January. Thanks for flagging this @kellijohnson-NOAA.
I think it's good to be extra cautious about overwriting user's model input files, so I like the additional argument here as implemented in the first attempt from @k-doering-NOAA 2a72141 rather than changing the behavior of the existing input. I think it's valuable to be able to see what the tuning would be without changing the input files but I also see the need for changing the input files without running the model. It might be more intuitive to have the new argument just be write_files
instead of write_files_niters_0
where if write_files == FALSE & niters_tuning > 0
then we would add a warning that the tuning won't work without writing the files.
I don't think I will get to this, unfortunately :( Perhaps if this issue comes up in the next assessment cycle, though, it is worth for someone else to pick it up.