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

Bounding coordinates can easily be inversed #103

Closed
gabrieldansereau opened this issue Jun 2, 2021 · 0 comments · Fixed by #101
Closed

Bounding coordinates can easily be inversed #103

gabrieldansereau opened this issue Jun 2, 2021 · 0 comments · Fixed by #101

Comments

@gabrieldansereau
Copy link
Member

gabrieldansereau commented Jun 2, 2021

#102 made me realize how easily the bounding coordinates can be inversed by mistake, and how they can pass silently for the same layers.

I don't really see any use in allowing constructing layers with inversed bounds, where top < bottom & right < left, so I'll add an argument error to prevent this.

l1 = SimpleSDMPredictor(WorldClim, BioClim, 1)
l2 = SimpleSDMPredictor(copy(l1.grid), 180.0, -180.0, 90.0, -90.0) # looks the same, but bounds really are inversed
# This should throw an error

l1.grid == l2.grid # same grid
extrema(longitudes(l1)) == extrema(longitudes(l2)) # same longitude extremas (displayed by show method)
extrema(latitudes(l1)) == extrema(latitudes(l2)) # same latitude extremas too

longitudes(l1) == longitudes(l2) # false, inversed
latitudes(l1) == latitudes(l2) # false, inversed

Edit: Fixed in a40267e and 77eca5d

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant