Skip to content

Commit

Permalink
bump makie and rasters compat (#23)
Browse files Browse the repository at this point in the history
* bump makie and rasters compat

* use Rasters.sample
  • Loading branch information
tiemvanderdeure authored Jan 21, 2025
1 parent 50811e3 commit b0cb48f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ GLM = "1.9.0"
GeoInterface = "1"
Loess = "0.6"
MLJBase = "1.7.0"
Makie = "0.20, 0.21"
Makie = "0.20, 0.21, 0.22"
PrettyTables = "2"
Rasters = "0.13"
Rasters = "0.13, 0.14"
ScientificTypesBase = "3"
Shapley = "0.1"
StatisticalMeasures = "0.1.5"
Expand Down
9 changes: 3 additions & 6 deletions docs/src/eucalyptus_regnans.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,12 @@ occurrences = thin(occurrences_raw.geometry, 5000)
## Background points
Next, we sample random points to use as background points.

From Rasters 0.12.1 on, this will be easier with Rasters.sample!

Let's plot both the occurrence and background points to see where _Eucalyptus regnans_ is found.

```@example test
using StatsBase
bg_indices = sample(findall(boolmask(bio_aus)), 500)
bg_points = DimPoints(bio_aus)[bg_indices]
using StatsBase # to active Rasters.sample
bg_data = Rasters.sample(bio_aus, 500; skipmissing = true, geometry = (X,Y))
bg_points = getproperty.(bg_data, :geometry)
fig, ax, pl = plot(bio_aus.bio1)
scatter!(ax, occurrences; color = :red)
scatter!(ax, bg_points; color = :grey)
Expand All @@ -54,7 +52,6 @@ SpeciesDistributionModels.jl has a [sdmdata](@ref) function to handle input data
```@example test
using SpeciesDistributionModels
p_data = extract(bio_aus, occurrences; skipmissing = true)
bg_data = bio_aus[bg_indices]
data = sdmdata(p_data, bg_data; resampler = CV(nfolds = 3))
```

Expand Down

0 comments on commit b0cb48f

Please sign in to comment.