-
Notifications
You must be signed in to change notification settings - Fork 2
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
Improving WithinRadius performance #196
Conversation
Documentation for this PR at https://poisotlab.github.io/SpeciesDistributionToolkit.jl/previews/PR196/ |
I will go and find tomatillos for you, thank you. Gonna wait until the doc builds, and I'll merge this. |
I'll take a look this weekend |
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## main #196 +/- ##
==========================================
- Coverage 53.36% 52.32% -1.05%
==========================================
Files 59 38 -21
Lines 1692 1034 -658
==========================================
- Hits 903 541 -362
+ Misses 789 493 -296
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
This now builds the figure, but on of the doc blocks fails:
|
yeah for some reasons cellsize sometimes returns nothing, can you drop this block for now and then I'll merge? |
working on it |
I think we still need
fails when building the current docs on main |
Ah, because it's a top level function... Yep, the dep needs to be in the main package, and so the version change needs to be there too |
Off the cuff idea: pseudoabsence models included with Fauxcurrences.jl as a rebranded PA package |
Post compilation, this takes this example for generating pseudoabsences with
WithinRadius
copied from that docs from ~120 seconds to ~20 seconds.It uses a single mask for removing sites within the provided distance. This ends up being way faster than the repeated
filter
calls, which are particularly slow because comparing the (long,lat) float pair is much slower than comparing cartesian indices.This scales much better, e.g. on a separate dataset with ~4000 occurrences, the old method took ~30 mins and the new one takes ~30 seconds.