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

[Bug]: SSexecutivesummary(tables = ()) only works for a subset of combinations #888

Open
1 task done
kellijohnson-NOAA opened this issue Oct 27, 2023 · 1 comment
Open
1 task done
Assignees
Labels
bug low priority A low-priority item that does NOT have to be worked on output issues related to output processing

Comments

@kellijohnson-NOAA
Copy link
Contributor

Describe the bug

In 86f4b21 @iantaylor-NOAA added the capacity to produce a selection of the tables output by SSexecutivesummary() by adding the tables argument but some tables depend on information created from previous tables. In an offline conversation we discussed how users could build all tables, move them to a new location, and augment them via a script rather than having to worry about rerunning SSexecutivesummary() and having it mess up tables that they had augmented by hand. The function only takes ~15 seconds to run and therefore being able to create individual tables is not a high priority. I suggest that we remove this feature that allows some tables to be made by themselves but not all. This will increase the readability of the code by decreasing the number of if statements. Maybe even speed it up a little bit for the case when every table is created by default. If we choose to leave the feature in, then we really should augment the code to allow users to run each table individually.

To Reproduce

output<- SS_output(
  system.file("extdata", "simple_small", package = "r4ss"),
  verbose = FALSE,
  printstats = FALSE
)
SSexecutivesummary(output, plotfolder = getwd(), tables = c("e"))
# Error in SSexecutivesummary(output, plotfolder = getwd(), tables = "e") :
#  object '"e"' not found
SSexecutivesummary(output, plotfolder=getwd(),tables="h")
# CSV files will be written in:
# c:/github/r4ss/r4ss/tables
# Skipping the decision table (not yet implemented)
# Error in dimnames(x) <- dn :
#  length of 'dimnames' [2] not equal to array extent
 SSexecutivesummary(output, plotfolder=getwd(),tables="timeseries")
# CSV files will be written in:
# c:/github/r4ss/r4ss/tables
# Creating time-series table
# Catch includes estimated discards for total dead.
# Exploitation = Total dead (including discards) divided by the summary biomass.
# Error in SSexecutivesummary(output, plotfolder = getwd(), tables = "timeseries") :
#   object '"timeseries"' not found
> SSexecutivesummary(output, plotfolder=getwd(),tables="numbers")   
# CSV files will be written in:
# c:/github/r4ss/r4ss/tables
# Creating numbers-at-age table
# Error in dimnames(x) <- dn : 
#  length of 'dimnames' [2] not equal to array extent
SSexecutivesummary(output, plotfolder=getwd(),tables="biomass")
# CSV files will be written in:
# c:/github/r4ss/r4ss/tables
# Creating biomass-at-age table
# Error in dimnames(x) <- dn :
#  length of 'dimnames' [2] not equal to array extent

Expected behavior

The documentation for the function does warn users that not all tables are available as individual tables but the function call does not indicate which should NOT be removed from the input vector, which is conditional on what you want. If a table cannot be produced alone and we leave the code we should at least give warnings to the user rather than the warnings listed above.

Screenshots

No response

Which OS are you seeing the problem on?

Windows

Which versions of r4ss and SS3 are you seeing the problem on?

Since v1.46.1

Additional Context

No response

Code of Conduct

@kellijohnson-NOAA kellijohnson-NOAA added bug output issues related to output processing low priority A low-priority item that does NOT have to be worked on labels Oct 27, 2023
@kellijohnson-NOAA kellijohnson-NOAA added this to To do in Executive Summary via automation Oct 27, 2023
@chantelwetzel-noaa
Copy link
Contributor

I agree that removing this option is the simplest approach to ensure that the produced tables work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug low priority A low-priority item that does NOT have to be worked on output issues related to output processing
Projects
Development

No branches or pull requests

3 participants