EvolEcolGroup / tidysdm

R package to fit species distribution models (SDMs) using the 'tidymodels' framework
https://evolecolgroup.github.io/tidysdm/
GNU Affero General Public License v3.0
23 stars 6 forks source link

Bug fixes to sample_pseudoabs_time and sample_pseudoabs #19

Closed japilo closed 1 year ago

japilo commented 1 year ago

Two bug fixes here.

One bug that was causing major issues for me personally was that sample_pseudoabs_time threw errors when I used a terra::SpatRaster input for the raster argument. I realized that the function basically required the raster argument to be a region_series object from pastclim. I fixed the function so that it will accept either terra::SpatRaster or terra::SpatRasterDataset input, and changed the documentation accordingly.

Second minor bug was that there was a time function in sample_pseudoabs that was not defined (both terra and stats have a time function.) I surmised that it was meant to be terra::time and changed it.

There are a bunch of problems in the vignettes right now that I don't feel qualified to fix, which means this branch doesn't pass standard checks, but if I run devtools::check(vignettes = F) then everything checks out fine.

dramanica commented 1 year ago

@japilo It looks like your branch is out of sync with the base (i.e. dev). See this article on how to fix that: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/keeping-your-pull-request-in-sync-with-the-base-branch Once you have done that, there should be no conflicts left, and it should then be easier to understand what is going on as only your changes will be flagged.

codecov[bot] commented 1 year ago

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (c7ee981) 90.35% compared to head (b321265) 90.21%.

:exclamation: Current head b321265 differs from pull request most recent head 5a1e058. Consider uploading reports for the commit 5a1e058 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## dev #19 +/- ## ========================================== - Coverage 90.35% 90.21% -0.14% ========================================== Files 52 52 Lines 1192 1196 +4 ========================================== + Hits 1077 1079 +2 - Misses 115 117 +2 ``` | [Files](https://app.codecov.io/gh/EvolEcolGroup/tidysdm/pull/19?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=EvolEcolGroup) | Coverage Δ | | |---|---|---| | [R/sample\_pseudoabs.R](https://app.codecov.io/gh/EvolEcolGroup/tidysdm/pull/19?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=EvolEcolGroup#diff-Ui9zYW1wbGVfcHNldWRvYWJzLlI=) | `100.00% <100.00%> (ø)` | | | [R/sample\_pseudoabs\_time.R](https://app.codecov.io/gh/EvolEcolGroup/tidysdm/pull/19?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=EvolEcolGroup#diff-Ui9zYW1wbGVfcHNldWRvYWJzX3RpbWUuUg==) | `89.65% <66.66%> (-6.35%)` | :arrow_down: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.