Skip to content
This repository has been archived by the owner on Dec 11, 2022. It is now read-only.

v0.8.0 in main #124

Merged
merged 122 commits into from
Oct 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
4e59668
CompatHelper: bump compat for "ArchGDAL" to "0.7"
github-actions[bot] Jun 25, 2021
ade18f0
Merge remote-tracking branch 'origin/compathelper/new_version/2021-06…
tpoisot Sep 2, 2021
a209ce7
✨ add a grid function to get the grid of a layer
tpoisot Sep 2, 2021
f2890eb
Merge pull request #115 from EcoJulia/tpoisot/issue112
tpoisot Sep 2, 2021
f5aef9a
⚙️ wip to rely on cartesian indices a LOT more
tpoisot Oct 1, 2021
0628f46
✨ getindex using coordinates
tpoisot Oct 1, 2021
0905c2e
⚙️ cleanup
tpoisot Oct 1, 2021
f43e6c5
✨ add more indexing
tpoisot Oct 1, 2021
007f490
🚢 update version and deps
tpoisot Oct 1, 2021
564f72b
➕ use GeometryBasics points instead of GeoInterface
tpoisot Oct 1, 2021
711549c
✨ more getindex methods
tpoisot Oct 1, 2021
e35f13b
clip using two points
tpoisot Oct 1, 2021
6bd626b
🐛 fix the stride for returned layers
tpoisot Oct 1, 2021
3981c4c
⚙️ use clip for explicit bounds
tpoisot Oct 1, 2021
6e90488
✅ clip v. getindex
tpoisot Oct 1, 2021
5ef316c
⚙️ drop joss
tpoisot Oct 1, 2021
f63f9fd
✅ overloading and clipping done
tpoisot Oct 1, 2021
ba55713
✅ iteration tests
tpoisot Oct 1, 2021
8c5e62a
work on doc
tpoisot Oct 2, 2021
b4d8354
doc update
tpoisot Oct 2, 2021
bfff61c
move data out
tpoisot Oct 2, 2021
fa06d4c
Merge branch 'next' into interfaces-iteration
tpoisot Oct 2, 2021
c551705
🐛 fix the subsetting leading to incorrect dimensions
tpoisot Oct 2, 2021
7777edb
🧑‍🏫 examples location update
tpoisot Oct 2, 2021
0be0a90
🧑‍🏫 move bioclim example to literate
tpoisot Oct 2, 2021
3a573ce
🧑‍🏫 remove old bioclim doc page
tpoisot Oct 2, 2021
8918dbe
🐛 GBIF access
tpoisot Oct 2, 2021
e866982
🚮 move assets
tpoisot Oct 2, 2021
c5175ea
CHELSA rather than bioclim
tpoisot Oct 2, 2021
aa6d8ff
💬 add clip dosctring
tpoisot Oct 2, 2021
eb46ce1
🧑‍🏫 reorganize docs
tpoisot Oct 2, 2021
d77624a
worldclim back in examples
tpoisot Oct 2, 2021
2cc04f0
🤖 use correct GKSwstype for build
tpoisot Oct 2, 2021
2eaa38e
🧑‍🏫 update links for data sources
tpoisot Oct 2, 2021
4f186af
🗄️ add CMIP6 for CHELSA
tpoisot Oct 2, 2021
029f5ea
🗄️ CHELSA CMIP6 works
tpoisot Oct 2, 2021
e298b45
🧑‍🏫 reorganize data section
tpoisot Oct 2, 2021
f7c2b43
🧑‍🏫 convert urban example to jl
tpoisot Oct 2, 2021
bcce2e7
🧑‍🏫 move future data to jl
tpoisot Oct 2, 2021
10f42f2
🧑‍🏫 add a Geometry demo page
tpoisot Oct 2, 2021
a34d670
🐛 fix using in example
tpoisot Oct 2, 2021
e1974cc
➖ temporarily drop DF
tpoisot Oct 2, 2021
5b81192
🐛 fix geometry type
tpoisot Oct 2, 2021
e185c6d
🧑‍🏫 move GBIF example to jl
tpoisot Oct 2, 2021
9824119
🟩 reorganize the tests
tpoisot Oct 2, 2021
cebab5f
🟩 adding tests to catch setindex bugs
tpoisot Oct 2, 2021
8136a21
🟩 the bug was in broadcast all along
tpoisot Oct 2, 2021
24a3872
👊 broadcast?
tpoisot Oct 3, 2021
05001af
⚙️ revert broadcast
tpoisot Oct 3, 2021
9412f99
revert to the sketchy broadcast
tpoisot Oct 3, 2021
2a7b852
✨ add keys for layers
tpoisot Oct 5, 2021
ee831e6
⚡ latitude matching is much faster
tpoisot Oct 5, 2021
b671699
⚡ coordinate matching is now much faster
tpoisot Oct 5, 2021
cbb4962
🐛 MATCHING BROKEN
tpoisot Oct 5, 2021
1adfa6d
💁 show uses the bounding box
tpoisot Oct 5, 2021
f136669
🐛 matching still not fully working
tpoisot Oct 5, 2021
d2ef4ce
🟩 split tests for clipping out of the overloads section
tpoisot Oct 5, 2021
d992666
⚙️ update matching code
tpoisot Oct 5, 2021
c897cd6
🐛 fix the coordinate matching
tpoisot Oct 5, 2021
c982bff
🗄️ new data - elevation from WorldClim
tpoisot Oct 5, 2021
42b1a8c
🧑‍🏫 documentation for elevation
tpoisot Oct 5, 2021
2349e33
💁 cleanup @info messages
tpoisot Oct 5, 2021
a88aa39
➕ add Distances
tpoisot Oct 5, 2021
b947e91
⚡ make sliding windows faster
tpoisot Oct 5, 2021
9cd946a
🧑‍🏫 fix a bug in the elevation vignette
tpoisot Oct 5, 2021
bea596f
🤖 fix github build for plots
tpoisot Oct 5, 2021
507dab3
🤖 fix github plots
tpoisot Oct 5, 2021
1dbb002
🗄️ allow 30s resolution for WorldClim
tpoisot Oct 5, 2021
5823650
✨ mask by polygon or multipolygon
tpoisot Oct 5, 2021
2380437
🧑‍🏫 update info on the masking
tpoisot Oct 5, 2021
09dd2ce
➕ add PolygonOps for masking
tpoisot Oct 5, 2021
eccb746
⬆️ freeze dependencies versions
tpoisot Oct 5, 2021
a3aa9e7
🧑‍🏫 doc clarification
tpoisot Oct 5, 2021
28bea63
🧑‍🏫 GBIF example redone
tpoisot Oct 6, 2021
e117049
✨ pseudo absences
tpoisot Oct 6, 2021
0ffb261
🐛 remove extra char in future worldclim url
tpoisot Oct 6, 2021
0737cea
🧑‍🏫 BRT example
tpoisot Oct 6, 2021
6fe686a
🧑‍🏫 updated BRT example
tpoisot Oct 6, 2021
c77ac7c
🧑‍🏫 fix layer name bug in geom example
tpoisot Oct 6, 2021
ce45417
🧹 apply formatting to the BRT code
tpoisot Oct 6, 2021
a13a4ee
💁 mute some code blocks in BRT
tpoisot Oct 6, 2021
fb4bf31
🧑‍🏫 VIF example
tpoisot Oct 6, 2021
0df353d
🧑‍🏫 bivariate help
tpoisot Oct 7, 2021
4e43b0e
🧑‍🏫 bivariate text
tpoisot Oct 7, 2021
76e6a85
🧑‍🏫 remove old comments in bivariate code
tpoisot Oct 7, 2021
1461634
🧹 format bivariate
tpoisot Oct 7, 2021
a676c46
🧹 format vif code
tpoisot Oct 8, 2021
74991c6
🧑‍🏫 change case study to use case
tpoisot Oct 8, 2021
1f726e0
🧑‍🏫 clarifications for pseudo-absences
tpoisot Oct 8, 2021
ec7c890
🐛 formatting introduced a bug in vif
tpoisot Oct 8, 2021
4d304f5
🧑‍🏫 update the BIOCLIM example
tpoisot Oct 8, 2021
8e257f2
🧑‍🏫 reoragnisation of the documentation for data
tpoisot Oct 8, 2021
78fabf9
💬 update to the docstrings for data
tpoisot Oct 8, 2021
5594a59
🧑‍🏫 landcover data examples merged
tpoisot Oct 8, 2021
464a2a2
🧑‍🏫 man page updates
tpoisot Oct 8, 2021
db6d3f5
🧑‍🏫 change taxa in gbif example
tpoisot Oct 8, 2021
d93384c
🧹 format the GBIF example
tpoisot Oct 8, 2021
38d7569
🧑‍🏫 fix VIF example
tpoisot Oct 8, 2021
2b7d200
🧑‍🏫 fix future data with correct species bounding box
tpoisot Oct 8, 2021
ff61f08
🧑‍🏫 update brt example
tpoisot Oct 8, 2021
d9cb326
🧑‍🏫 fix GBIF example
tpoisot Oct 8, 2021
7b3e8b8
✨ add layernames to identify the layers
tpoisot Oct 8, 2021
5eedb9d
🦆 INCOMPLETE topography for EarthEnv
tpoisot Oct 8, 2021
ad7d3d3
✨ add and document topography from EarthEnv
tpoisot Oct 9, 2021
ba4d718
➕ add Colors and ColorBlendModes
tpoisot Oct 10, 2021
753abfd
✨ add bivariate map
tpoisot Oct 10, 2021
5186181
✨ bivariatelegend function
tpoisot Oct 10, 2021
4f1a46e
Update bivariate.jl
tpoisot Oct 10, 2021
a73dd06
🐛 bivariate being fixed
tpoisot Oct 10, 2021
14bb6a5
full bivariate example
tpoisot Oct 11, 2021
a2e9f10
Merge branch 'interfaces-iteration' of https://github.com/EcoJulia/Si…
tpoisot Oct 11, 2021
fd84ca3
🧑‍🏫 doc update
tpoisot Oct 11, 2021
f3c5b78
🧑‍🏫 fix bivariate example
tpoisot Oct 11, 2021
be13a89
🐛 fixed the bivariate code and example for good
tpoisot Oct 11, 2021
ca4f307
🐛 old layer names
tpoisot Oct 11, 2021
705c022
🐛 fix bivariate bug 2
tpoisot Oct 11, 2021
2552e9b
🧑‍🏫 vif disclaimer
tpoisot Oct 11, 2021
b3d766c
🤖 YAML bug report
tpoisot Oct 11, 2021
386cd17
🗺️ bivariate BRT example
tpoisot Oct 11, 2021
80c8bf6
🧑‍🏫 update BRT example
tpoisot Oct 11, 2021
5db4a02
Merge pull request #120 from EcoJulia/interfaces-iteration
tpoisot Oct 11, 2021
913000f
🤖 update actions
tpoisot Oct 11, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Bug Report
description: File a bug report - this is the type of issue to use if you are fairly sure something is going awfully wrong with the package.
title: "[Bug]: "
labels: ["bug", "triage"]
assignees:
- tpoisot
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report! This is one of the most effective steps in making the project better.
- type: input
id: contact
attributes:
label: Contact Details
description: How can we get in touch with you if we need more info? This is mostly important if the bug can be reproduced only when using data you are not able to share publicly.
placeholder: ex. [email protected]
validations:
required: false
- type: textarea
id: what-happened
attributes:
label: What happened?
description: Also tell us, what did you expect to happen?
placeholder: Tell us what you see!
value: "A bug happened!"
validations:
required: true
- type: textarea
id: logs
attributes:
label: Stacktrace
description: Please copy and paste the stacktrace that give the error message.
render: shell
36 changes: 0 additions & 36 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

5 changes: 4 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: CI
on:
push:
branches:
- master
- main
pull_request:

jobs:
Expand All @@ -30,6 +30,9 @@ jobs:
arch: ${{ matrix.arch }}
- uses: julia-actions/julia-buildpkg@latest
- uses: julia-actions/julia-runtest@latest
env:
PYTHON: ""
GKSwstype: "100"
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
with:
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/CleanPR.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Doc Preview Cleanup

on:
pull_request:
types: [closed]

jobs:
doc-preview-cleanup:
runs-on: ubuntu-latest
steps:
- name: Checkout gh-pages branch
uses: actions/checkout@v2
with:
ref: gh-pages
- name: Delete preview and history + push changes
run: |
if [ -d "previews/PR$PRNUM" ]; then
git config user.name "Documenter.jl"
git config user.email "[email protected]"
git rm -rf "previews/PR$PRNUM"
git commit -m "delete preview"
git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree})
git push --force origin gh-pages-new:gh-pages
fi
env:
PRNUM: ${{ github.event.number }}
2 changes: 1 addition & 1 deletion .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
julia-version: [1.5.0]
julia-version: [1.6.3]
julia-arch: [x86]
os: [ubuntu-latest]
steps:
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/Documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
release:
push:
branches:
- master
- main
tags: '*'
pull_request:

Expand All @@ -15,10 +15,14 @@ jobs:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@latest
with:
version: '1.5'
version: '1.6'
- name: Install dependencies
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
env:
PYTHON: ""
GKSwstype: "100"
- name: Build and deploy
env:
GKSwstype: "100"
GITHUB_TOKEN: ${{ secrets.TOKEN }} # For authentication with GitHub Actions token
run: julia --project=docs/ docs/make.jl
20 changes: 15 additions & 5 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
name = "SimpleSDMLayers"
uuid = "2c645270-77db-11e9-22c3-0f302a89c64c"
authors = ["Timothée Poisot <[email protected]>", "Gabriel Dansereau <[email protected]>"]
version = "0.7.0"
version = "0.8.0"

[deps]
ArchGDAL = "c9ce4bd3-c3d5-55b8-8973-c0e20141b8c3"
ColorBlendModes = "60508b50-96e1-4007-9d6c-f475c410f16b"
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
Distances = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7"
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326"
PolygonOps = "647866c9-e3ac-4575-94e7-e3d426903924"
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
ZipFile = "a5390f91-8eb1-5f08-bee0-b1d1ffed6cea"

[compat]
ArchGDAL = "0.6, 0.7"
ArchGDAL = "0.7"
Distances = "0.10"
Downloads = "1.4"
RecipesBase = "0.7, 0.8, 1.0"
GeometryBasics = "0.4"
PolygonOps = "0.1"
RecipesBase = "1.0"
Requires = "1.0"
ZipFile = "0.8, 0.9"
julia = "1.5"
StatsBase = "0.33"
ZipFile = "0.9"
julia = "1.6"
12 changes: 9 additions & 3 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
[deps]
ColorBlendModes = "60508b50-96e1-4007-9d6c-f475c410f16b"
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
StatsPlots = "f3b207a7-027a-5e70-b257-86293d7955fd"
EvoTrees = "f6006082-12f8-11e9-0c9c-0d5d367ab1e5"
GBIF = "ee291a33-5a6c-5552-a3c8-0f29a1181037"
GLM = "38e38edf-8417-5370-95a0-9cbb8c7f171a"
GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
StatsPlots = "f3b207a7-027a-5e70-b257-86293d7955fd"
43 changes: 33 additions & 10 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,22 @@ push!(LOAD_PATH, joinpath("..", "src"))
using Documenter, SimpleSDMLayers
using GBIF
using Statistics
using Literate

# Literate files
for ENDING in ["examples", "sdm"]
expl = joinpath("docs", "src", ENDING)
corefiles = [joinpath(expl, f) for f in readdir(expl)]
filter!(f -> endswith(f, "jl"), corefiles)
vignetteconfig = Dict(
"repo_root_url" => "https://github.com/EcoJulia/SimpleSDMLayers.jl",
"flavor" => Literate.DocumenterFlavor(),
"credit" => false
)
for corefile in corefiles
Literate.markdown(corefile, expl; config=vignetteconfig)
end
end

makedocs(
sitename = "Simple SDM Layers",
Expand All @@ -11,22 +27,28 @@ makedocs(
"Home" => "index.md",
"Manual" => [
"Types" => "man/types.md",
"Indexing" => "man/indexing.md",
"Clipping" => "man/clip.md",
"Operations on values" => "man/changevalues.md",
"Overloads" => "man/overloads.md",
"Other operations" => "man/operations.md",
"Data" => "man/data.md",
"Data access" => "man/data.md",
"IO" => "man/io.md"
],
"Examples" => [
"Temperature data" => "examples/temperature.md",
"DataFrames integration" => "examples/dataframes.md",
"General examples" => [
"Introduction: elevation data" => "examples/elevation.md",
"Geometry for clipping" => "examples/geometry.md",
"Sliding window analysis" => "examples/slidingwindow.md",
"Landcover data" => "examples/landcover.md",
"Landcover consensus" => "examples/consensus.md",
"Importing and exporting" => "examples/import.md",
"Bivariate mapping" => "examples/bivariate.md"
],
"Building SDMs" => [
"SDM case studies" => [
"GBIF integration" => "sdm/gbif.md",
"BIOCLIM from scratch" => "sdm/bioclim.md",
"Future data" => "sdm/future.md"
"Variable selection (VIF)" => "sdm/vif.md",
"Building the BIOCLIM model" => "sdm/bioclim.md",
"Pseudo-absences" => "sdm/pseudoabsences.md",
"Dealing with future data" => "sdm/future.md",
"BRTs and climate change" => "sdm/brt.md"
]
]
)
Expand All @@ -35,5 +57,6 @@ run(`find . -type f -size +40M -delete`)

deploydocs(
repo = "github.com/EcoJulia/SimpleSDMLayers.jl.git",
push_preview = true
push_preview = true,
devbranch = "main"
)
75 changes: 75 additions & 0 deletions docs/src/examples/bivariate.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# # Bivariate maps

using SimpleSDMLayers
using StatsPlots
using StatsPlots.PlotMeasures

# **Justification for this use case:** We can show more than one (specifically,
# two) variables on a single map, using a bivariate color scale. In order to
# illustrate bivariate mapping, we will look at the joint distribution of two
# measures: eveness of land use, and terrain roughness.

boundaries = (left=-12.0, right=30.0, bottom=36.0, top=72.0)
layer1 = convert(
Float16,
SimpleSDMPredictor(EarthEnv, HabitatHeterogeneity, 2; resolution=5, boundaries...),
)
layer2 = convert(
Float16, SimpleSDMPredictor(EarthEnv, Topography, 7; resolution=5, boundaries...)
)
layer2 = mask(layer1, layer2);

# Note that bivariate maps usually work best when used with 9 classes in total
# (so 3 for each side). The next decision is to take a bivaraite color palette,
# and the combinations below are [commonly
# used](https://www.joshuastevens.net/cartography/make-a-bivariate-choropleth-map/).
# Note that you can definitely use [diverging
# colors](https://www.personal.psu.edu/cab38/ColorSch/Schemes.html) if you want.

p0 = colorant"#e8e8e8"
bv_pal_1 = (p0=p0, p1=colorant"#64acbe", p2=colorant"#c85a5a")
bv_pal_2 = (p0=p0, p1=colorant"#73ae80", p2=colorant"#6c83b5")
bv_pal_3 = (p0=p0, p1=colorant"#9972af", p2=colorant"#c8b35a")
bv_pal_4 = (p0=p0, p1=colorant"#be64ac", p2=colorant"#5ac8c8")

# The bivariate map itself is a call to plot. Internally, this will transform
# the layers into quantiles (determined by the `classes` keyword, defaults to
# 3):

plot(layer1, layer2; st=:bivariate, bv_pal_3...)

# Note that you can use the `bivariate` shorthand as well:

pl1 = bivariate(layer1, layer2; classes=3, frame=:box, bv_pal_4...)
xaxis!(pl1, "Longitude")
yaxis!(pl1, "Latitude")

# We can repeat essentially the same process for the legend:

pl2 = bivariatelegend(layer1, layer2; classes=3, bv_pal_4...)
xaxis!(pl2, layernames(EarthEnv, HabitatHeterogeneity, 2))
yaxis!(pl2, layernames(EarthEnv, Topography, 7))

# And now, we can plot the legend next to the map - future releases of the
# package will hopefully offer this in a far more user friendly way.

plot(pl1, pl2; layout=@layout [a{0.75w} b])

# Using the `subplot` and `inset` arguments of Plots.jl, we can have the legend
# within the figure. Note how in this example we expand the limits on the x axis
# to make the legend fit, but also use more classes in the map to have a
# smoother result.

p1 = bivariate(layer1, layer2; classes=6, bv_pal_2..., frame=:box, xlim=(-24, maximum(longitudes(layer1))))
xaxis!(p1, "Longitude")
yaxis!(p1, "Latitude")
p2 = bivariatelegend!(
layer1,
layer2;
bv_pal_2...,
inset=(1, bbox(0.04, 0.05, 0.28, 0.28, :top, :left)),
subplot=2,
xlab=layernames(EarthEnv, HabitatHeterogeneity)[2],
ylab=layernames(EarthEnv, Topography)[7],
guidefontsize=7,
)
Loading