Repository navigation
[feat] Extract and format data for asar to SIS function - #365
Conversation
| #' | ||
| #' @details This function acts within the following workflow: | ||
| #' | ||
| #' 1. When a stock assessment is scheduled to conclude, SIS will generate an |
There was a problem hiding this comment.
What do you mean SIS will generate? I think clarity here is needed saying a specific function.
There was a problem hiding this comment.
How about "automatically assign"?
| #' 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. |
There was a problem hiding this comment.
Maybe we should make a wrapper like add_accessibility that performs this fxn and export_to_sis together
There was a problem hiding this comment.
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
| "recruitment" = "Recruitment", | ||
| "catch" = "Catch", | ||
| "spawning_biomass" = "Spawners", | ||
| "abundance" = "Abundance", # aka biomass |
There was a problem hiding this comment.
abundance and biomass are not the same
There was a problem hiding this comment.
I was confused too; Jeff confirmed that "Abundance = Biomass - or - Spawners". I'm going to inquire further
|
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 I think we need to really think about the purpose of this function. Is it only for users who use I can see both sides to this. Since 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. |
db5fd88 to
a9c028b
Compare
1383027 to
7ad12e8
Compare
bb9eadf to
64a9184
Compare
…emove it in next commit
…es with different figures/tables available
…cumentation and tests
… add in a couple new values
|
When testing this out I got the error:
What I did: Was there a different step to follow? I think the directions in the documentation aren't clear if it is. I almost feel like there are a lot of directions included for documentation for a standard function and it needs to be made simpler, but just my opinion here. I think I am mainly confused if I am supposed to run all of the functions mentioned for plotting and creating tables to run this or if I only have to run one of them. |
Ah, the error was that "example_data" is not an appropriate value for any of the arguments, which are all directories. |
|
Ahh I knew I was doing something wong! |
|
@sbreitbart-NOAA just ran it again but without the example_data in the function. Is this expected? I do not see any new file in my folder. Also does this only export whatever time series is made in a plot or do you only need to make one? |
No, that error is not expected (but the console messages above it are). I can't replicate this by running your example above. This extracts TS data from the relevant rdas, then inserts them into the time series csv. You only need one relevant rda to run this (e.g., SB, B, index, etc.) Is this the same code you ran? |
|
Yes, that's what I ran. Let me start fresh and make sure everything is up to date then try again |
|
Woop! Got it to work, but I have a few questions. (1) I am a bit confused still if you need to create more figures/tables to export everything due to this message (2) It is unclear what you mean in this message: I think it might be helpful to put a vignette explaining it or just changing the terminology. It might also just be too much information. Otherwise, this works! I am not sure if there are ways to check the validity of it, so I will just trust that it's extracting the correct values. I need to still do checks on this for other models |
Glad it works for you! There's a lot of info that's useful to know when using this function, and since it's not being conveyed clearly enough, I'll make a vignette. Re: your questions:
|
|
Sounds good! I am not sure if you need to include the "primary" category designations. I think it would be better to use a different term or not include the message unless you intend for the user to use that to indicate it to Jeff or the SIS team. I don't know if they would be up for trying to learn it and retain it for one step at the end of the process. If you feel like it isn't much more work to add it in the vignette then go for it, but I am hesitant to continue using that language. I am unsure what being eligible for a primary designation means to provide an alternative. |
… to website; extract last year data from F instead of landings plot
|
@Schiano-NOAA I wrote a vignette in an effort to give more information about the new function, including the purpose of the Primary category. Let's ask Jeff for a review once he's back in the office too. But if you're on board with this, I say let's merge it and update as necessary |
|
@sbreitbart-NOAA sounds like a plan! Merge away |
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: