-
Notifications
You must be signed in to change notification settings - Fork 8
Array workflow #113
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
base: main
Are you sure you want to change the base?
Array workflow #113
Conversation
…e using monthly climate data
feat: function to summarize results added
…_range.R, but faster
R/exposure_fast.R
Outdated
| #' @export | ||
| #' | ||
|
|
||
| exposure_fast <- function(species.names, species.data, climate.data, niche.data, monthly = TRUE){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of a boolean monthly, it could be useful to have a mode argument that can be set to "monthly" or "extreme", which allows for additional calculations to be added without changing the interface
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually R/exposure_fast.R should be replaced by array_workflow/exposure.R. I’ve added the mode argument in the latter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. Then this file will get removed?
| @@ -0,0 +1,122 @@ | |||
| #' Transform climate data in array format to tibble format | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a duplicate of R/array_to_tibble.R? can it be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, R/array_to_tibble.R can be removed. Please keep the code from the array_workflow/code folder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok great. In that case please remove it from your branch so it doesn't get merged upon completion of your PR
|
|
||
| # here I will convert the array into a tibble | ||
|
|
||
| lons <- climate$lon + 0.5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this could source R/array_to_tibble.R instead right? Using the common functions would shorten and simplify this script.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, how's is this different from scripts/array_workflow.R?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
scripts/array_workflow.R is an updated, cleaner version of the array_workflow/code/array_to_tibble_workflow.R. It basically shows how all the functions work together. That pdf document I shared on slack is based on the scripts/array_workflow.R. Is this script useful for you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to the previous comment, please remove array_workflow/code/array_to_tibble_workflow.R from your branch so it doesn't get merged upon completion of your PR
Basically the aim is to not have duplicate code merged into the main branch.
Remove duplicated version of array_to_tibble.R
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like tier_1 folder needs to be removed, it's already under data-raw
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also array_workflow/ needs to be removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
@schwarzmeyer you can test the yearly workflow with test data with: Rscript scripts/main.R exposure --input_yml data-raw/shp_config.yml --workers 1Currently this fails with: |
Workflow to implement the exposure analyses using arrays