nmfs-ost / asar

Partially automate a U.S. stock assessment report.
https://nmfs-ost.github.io/asar/
MIT License
15 stars 3 forks source link

Bugs found in testing asar (running list) #42

Closed DHennen1 closed 1 month ago

DHennen1 commented 2 months ago

bugs in satf::table_indices

flextable::add_header_row(top = TRUE, values = c(
        "", rep(ind_fleets, each = 2))
      )

lacks the colwidths argument which causes an error - I am not sure how to fix this - one I tried

 flextable::add_header_row(top = TRUE
          ,values = c("", rep(intersect(ind_fleets,fleet_names), each = 2))
          ,colwidths = c(1,rep(2,length=length(ind_fleets)))
      )

but this does not put the header in the correct place

bugs in satf::plot_spawning_biomass

the first line

model <- match.arg(model, several.ok = FALSE)

causes an error because the call to the function redefines model from the vector of possible values to 'SS3'. I think this needs an argument

choices= c('SS3','BAM', 'ASAP', 'AMAK', 'WHAM', "standard")

or some way to make this the default? I am not sure what you are going for here, but it throws an error for me.

I think you need to add else endyr=end_year in several places. For example line 68 - basically anywhere that if (is.null(end_year)){ is tested.

Schiano-NOAA commented 2 months ago

@DHennen1 thanks for testing the tool Dan! I have addressed your first bullet by designating the output directory to the user's working directory with the option of changing it using the parameter file_dir. I have also added the direction to install the satf package in the readme (third bullet).

In regards to the remaining bullets,

"example should load the parameter files, or at least the report.sso from "simple" SS3 example (I think that is the intended example file)" The example is a generic input of a SS3 report file with no linked example. The current blank template or example does not actually use or convert the data. I am in the works of changing this chunk in the base template. https://github.com/nmfs-ost/asar/blob/d9b69a1912f36a127e8d52dd69ef93f9f475f662/R/create_template.R#L466-L487 I plan to upload a full working example with what should be produced in the next week that will be reflected in the example in the README.

"Bugs in SATF [functions]" satf is still in the beginning stages of development and I have recently had to make changes with how it worked specifically for SS3 output files. Thank you for pointing out these bugs. I opened a new issue in the satf repo describing these bugs.