From b6bf5ee2345dabb1cf8bc433c909a6d45dabbfcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Poisot?= Date: Sat, 28 Sep 2024 15:23:18 -0400 Subject: [PATCH] semver(sdt): v0.1.3 (#286) * semver(sdt): v0.1.3 * doc: change gainloss --- Project.toml | 2 +- docs/make.jl | 1 + docs/src/manual/utilities.md | 5 +++++ docs/src/tutorials/sdemo.jl | 2 +- src/utilities.jl | 4 +++- 5 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 docs/src/manual/utilities.md diff --git a/Project.toml b/Project.toml index 35c9c99a2..e98a8b2a9 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "SpeciesDistributionToolkit" uuid = "72b53823-5c0b-4575-ad0e-8e97227ad13b" authors = ["Timothée Poisot "] -version = "0.1.2" +version = "0.1.3" [deps] Distances = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7" diff --git a/docs/make.jl b/docs/make.jl index 888f06df5..87d8b822e 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -87,6 +87,7 @@ makedocs(; "manual/pseudoabsences.md", "manual/polygons.md", "manual/gadm.md", + "manual/utilities.md" ], ], ) diff --git a/docs/src/manual/utilities.md b/docs/src/manual/utilities.md new file mode 100644 index 000000000..fc0ea8712 --- /dev/null +++ b/docs/src/manual/utilities.md @@ -0,0 +1,5 @@ +# Other utility functions + +```@docs +gainloss +``` \ No newline at end of file diff --git a/docs/src/tutorials/sdemo.jl b/docs/src/tutorials/sdemo.jl index 376aac274..4bf6aff99 100644 --- a/docs/src/tutorials/sdemo.jl +++ b/docs/src/tutorials/sdemo.jl @@ -122,7 +122,7 @@ prd = predict(sdm, layers; threshold = false) # Decision trees, in oredr to avoid overfitting, are pretty small -- indeed, the # default version in `SDeMo` is capped at 12 nodes, with a maximal depth of 7. # This is because there is no limit to how much decision trees can overfit. But -# as a result, the map representing these predictions can look a little coase: +# as a result, the map representing these predictions can look a little coarse: # fig-initial-map f = Figure(; size = (600, 300)) diff --git a/src/utilities.jl b/src/utilities.jl index 638d548cf..0aa3bc045 100644 --- a/src/utilities.jl +++ b/src/utilities.jl @@ -2,7 +2,9 @@ gainloss(contemporary::SDMLayer{Bool}, future::SDMLayer{Bool}) Returns a layer with values -1, 0, and 1 corresponding to the difference in -ranges. +ranges. The two layers given as input must be layers with boolean values where +`true` indicates that the pixel is in the range. The presence of `false` pixels +is irrelevant as these are ignored internally. """ function gainloss(contemporary::SDMLayer{Bool}, future::SDMLayer{Bool}) rangemask = nodata((contemporary)|(future), false)