-
-
Notifications
You must be signed in to change notification settings - Fork 2
EarthEnv landcover + WorldClim 2.1 + CHELSA V1 #21
Conversation
Codecov Report
@@ Coverage Diff @@
## master #21 +/- ##
==========================================
+ Coverage 81.09% 81.40% +0.30%
==========================================
Files 11 16 +5
Lines 201 285 +84
==========================================
+ Hits 163 232 +69
- Misses 38 53 +15
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@gabrieldansereau Can you make sure that nothing in this PR is going to break what you are about to present at JuliaCon? This is a fairly big rewrite internally, but it didn't break any of the existing unit tests. |
I'll make sure it works while finishing my poster. I mean to show something similar to the examples in the documentation. As long as these are not broken, what I present shouldn't be either. |
@tpoisot Is this normal? The following
returns The |
@gabrieldansereau I have no idea why that's the case. I'll check this evening. |
So, this is because the code of worldclim(1; left=-11.0, right=31.1, bottom=29.0, top=71.1) gives the correct result in terms of which area is covered. Let me check the size issue, it's weird. |
Mmhhh. You're right @gabrieldansereau , it looks like the size is inverted: julia> latitudes(temperature) |> length
2160
julia> longitudes(temperature) |> length
1080
julia> stride(temperature)
(0.16666666666666666, 0.04158950617283951) In particular, the stride should have the same values - let me add a test to check this and then fix the bug. |
GREAT now the github actions are not running. This is just fantastic. I'm ready to start a new life hoarding goats or something - nevermind, https://www.githubstatus.com/ says it's a site wide problem. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All fine for me! Works with my JuliaCon poster. I had no problems running the examples and playing with it a bit after the small fix to similar()
.
Thanks for the fix to worldclim()
& layer sizes!
@@ -240,7 +240,7 @@ the use of `copy`, manual update, and `convert`. | |||
function Base.similar(layer::T) where {T <: SimpleSDMLayer} | |||
emptygrid = similar(layer.grid) | |||
for i in eachindex(emptygrid) | |||
emptygrid[i] = isnothing(layer.grid[i]) ? nothing : zero(eltype(layer.grid)) | |||
emptygrid[i] = isnothing(layer.grid[i]) ? nothing : zero(eltype(layer.grid[i])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
similar()
didn't work without this for climate layers & all. eltype(temperature.grid)
is always Union{Nothing, Float32}
, which has no method for zero()
The new data have the same API as
worldclim
, but the files are much larger. In fact, the tests do not run as GitHub actions using the whole layer, and it takes a solid machine to run them at all. They work, but they can't be tested automatically -- as a quick check, I still run them using the new ability to only load parts of a dataset.Because these new data do not always have a
NaN
type, the absence of data is now represented asnothing
- this had all sort of consequences for almost everything in the package, none of which broke the API at all. But internally, this is a very extensive rewrite.This PR also comes with improvements, specifically the sliding window analysis, the ability to broadcast over layers, and the ability to get a subset of the data from a file. The last point in particular makes a lot of data loading much faster.
bioclim
function (high-res)