-
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
#' @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
@@ -143,3 +143,7 @@ version.py | |||
# pixi environments | |||
.pixi | |||
*.egg-info | |||
.Rproj.user |
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 has a conflict with the main branch because additional lines were also added there. Looks like what you want is to keep both sets of changes. Here are general instructions on resolving conflicts. But basically you want to keep both changes, i.e.
From this:
.pixi
*.egg-info
<<<<<<< array_workflow
.Rproj.user
# tier_1 file that exceedes 25Mb
tier_1/data/climate/historical_array.rds
=======
outputs/
*.DS_Store
# Ignore processed species files
data-raw/bien_ranges/processed/
>>>>>>> main
Just remove the conflict markers to get to this:
.pixi
*.egg-info
.Rproj.user
# tier_1 file that exceedes 25Mb
tier_1/data/climate/historical_array.rds
outputs/
*.DS_Store
# Ignore processed species files
data-raw/bien_ranges/processed/
Workflow to implement the exposure analyses using arrays