-
Notifications
You must be signed in to change notification settings - Fork 1
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
73 climate matching function #77
Conversation
#73 This .rda contains the following future climate scenarios: - "2001-2025-A1FI" - "2026-2050-A1FI" - "2051-2075-A1FI" - "2071-2100_Beck" - "2076-2100-A1FI" from Rubel & Kottek 2010 & Beck et al. 2018
This .rda file contain these observed climate scenarios - "1901-1925" - "1926-1950" - "1951-1975" - "1976-2000" from Rubel & Kottek 2010.
#73 @damianooldoni is this ok ?
#73 Simple function to get/store credentials from/into system environment.
@damianooldoni I've added an example, switched the default state of the rerun to "no" and allowed the use of a custom region shape. Besides the warnings & errors from the check below I think (and hope) the function is now ready for your review.
|
@damianooldoni I'm trying to implement #78 but sofar I'm having little luck. Since this is an extra feature I think it is a good idea to merge the current "working" state of the function into the master. |
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.
Sorry @SanderDevisscher for this late answer. I have just solved the small bug behind the automatic test failures. I was also checking your function, but I stopped: I was stuck as I could not find anymore which curly bracket I erroneously deleted etc.
You can merge this PR if you need to, but these points should be tackled sooner or later:
- GBIF instead of gbif in documentation
taxon_key
instead oftaxonkey
,zip_file
instead ofzipfile
etc.: ALL functions in this package use snake_case. I don't find any reason to have an exception for this function.- This function is way too long. Splitting in subfunctions will help readibility and debugging: future-you, the maintainer (that's me 😮 ) and anyone else trying to understand the workflow will be grateful. Notice that these subfunctions can be written in the same R file, just append them below the "main" function. For example, the leaflet part is clearly something you can put in a subfunction, isn't?
- Unit-testing are needed: I can do it, but first 3 needs to be solved.
- About the entire workflow behind this function, I really suggest you to write a vignettte about. I mean, it's a pity the schema you drew in 73 climate matching function #77 (comment) would be "lost" in this PR.
So, if you need, I approve this PR: this is what you prefer, if I understood your comment above correctly. I will then translate all my thoughts in some issues. Otherwise, I will officially "request changes" and you can work further on this branch. Let me know!
Anyway, I really appreciate your work and what this function does! 💪 A great function, an added value for this package. It's now a question of refactoring and polishing.
Just glad we can make some progress
No specific need. But letting the branches diverge has proven a recipe for conflicts. Also since I'm very busy atm I think its best to merge this branch after I tackled remarks 1 & 2 and to work with issues for the rest.
I'll fix the issues above before the merge. Those below should be turned into issues.
I agree I just don't exactly know how besides this is a huge work for which I do not have time atm.
I'll do this if you show me how (so I can do it for future functions I write)
Again I agree but do not know how to make a vignette
|
Thanks @SanderDevisscher. I agree 100% with your answer. I will be very glad to provide you with the help you need for both unit tests and vignettes. Maybe a kind of "sprint" day in a remote place without being by nobody and any other request, will be the most effective way for this. About snake case, be careful: not easy to change all of them without making an error. I speak about my personal experience. But you know your code better than me, of course, and so, it will work. I will now bump the version if still not done. So, please, pull from remote within 5 minutes. |
@damianooldoni I fixed issues 1 & 2 (partially, I'll implement more snake_case when I split the function). |
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.
Nice work. 💪
Fixes #73
Fixes #74
I've created a new function for the Trias package which uses GBIF observations to create a series of rudimentary climate matching outputs.
To use this function 3 datapackages (observed, future & legend) have been added. These contain the shapes for the observed and future climate zones based on the Koppen Geiger classifications and their respective legends. These shapes originate from Rubel & Kottek 2010 and Beck et al 2018.
The flowchart below depicts the steps taken to create the outputs:
As extra functionality 3 extra outputs were added, namely a current climate map, future climate maps and single species maps