Skip to content

[feat] Extract and format data for asar to SIS function - #365

Open
sbreitbart-NOAA wants to merge 11 commits into
mainfrom
sis-kq-csv
Open

sbreitbart-NOAA wants to merge 11 commits into
mainfrom
sis-kq-csv

Conversation

@sbreitbart-NOAA

@sbreitbart-NOAA sbreitbart-NOAA commented Sep 4, 2026 •

Copy link
Copy Markdown
Collaborator

Extract and format data for asar to SIS function
Note: this branch is a companion to https://github.com/nmfs-ost/asar/tree/sis-data, which intakes the templates (blank or filled in, with this function) and sends them to Google Drive

@Schiano-NOAA This works by extracting data from rdas, not creating them within the function. I'm not sure that it'd be worth adding in the capability to create rdas within the function, as it'd need to be highly interactive (asking authors for arguments that impact key quantities), and this works even if rdas are missing.

This still needs some work (see below) but wanted to share it/ask for feedback/spark discussion before I got too far:

  • unit tests
  • documentation: what the output should look like, which rdas are expected (and how to export them via the functions), etc. (in a vignette?)

Comment thread R/extract_sis_data.R Outdated
Comment thread R/extract_sis_data.R Outdated
Comment thread R/extract_sis_data.R
#'
#' @details This function acts within the following workflow:
#'
#' 1. When a stock assessment is scheduled to conclude, SIS will generate an

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean SIS will generate? I think clarity here is needed saying a specific function.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about "automatically assign"?

Comment thread R/extract_sis_data.R Outdated
Comment thread R/extract_sis_data.R
Comment thread R/extract_sis_data.R
#' 2b. Locate the files in the "report" folder generated by running `asar::create_template()`.
#' 2c. Run `stockplotr::extract_sis_data()`, which will populate the templates with data originating from a converted model results file.
#' 3. The user will add the remaining necessary data into the csv files, ensuring that all required fields are completed.
#' 4. Run `export_to_sis()`, which will format and upload this data to a specific Google Drive folder.

@Schiano-NOAA Schiano-NOAA Sep 4, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should make a wrapper like add_accessibility that performs this fxn and export_to_sis together

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea of saving the user time, but that might come at the cost of them not inspecting their files before sending to SIS. I think we should encourage them to make sure it looks right before doing so

Comment thread R/extract_sis_data.R
"recruitment" = "Recruitment",
"catch" = "Catch",
"spawning_biomass" = "Spawners",
"abundance" = "Abundance", # aka biomass

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

abundance and biomass are not the same

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was confused too; Jeff confirmed that "Abundance = Biomass - or - Spawners". I'm going to inquire further

@Schiano-NOAA

Copy link
Copy Markdown
Collaborator

This is really coming together! I do feel quite strongly that the users should be able to use this function without creating the RDAs; however, I do see why the approach here is more reasonable. Playing devil's advocate, I do think that if a user wants to send their info to SIS and doesn't use stockplotr for their figures and tables, they will need to make all of the necessary ones before running this function, which is just as highly interactive as having this function operate without rdas.

I think we need to really think about the purpose of this function. Is it only for users who use stockplotr in its entirety or is it for people to pick and choose what they want to do even if it's simply converting their output and easily sending their results to SIS?

I can see both sides to this. Since stockplotr isn't in v1.0 quite yet and not planned to get there until end of June 2027, adoption by a large potion of the community wouldn't be expected for sometime after that. I think this approach to separating functions out though will be a big help to the transition for SIS and the user base.

With that said and thinking on it, proceed as planned and continue with this approach. I think we can assess the utility of it with some test cases (the steering committee or other willing users) once we get this out there and talk with the SIS devs.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants