PyPSA / atlite

Atlite: A Lightweight Python Package for Calculating Renewable Power Potentials and Time Series
https://atlite.readthedocs.io
255 stars 87 forks source link

fix exclusion for non overlapping geometries #289

Closed FabianHofmann closed 1 year ago

FabianHofmann commented 1 year ago

and add convenience functions to ExclusionContainer class

Change proposed in this Pull Request

In recent eligibility calculations in pypsa-eur we saw bugs coming up, when the raster and the geometries are not overlapping. This changes fix this issue.

Additionally this change introduces two new functions to the ExclusionContainer class that ease the inspection of excluded areas in a geometry.

The example notebook for show-casing the land-use calculation was update to show the new functions.

Type of change

Checklist

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 81.57% and project coverage change: +0.05 :tada:

Comparison is base (7fe57a3) 72.74% compared to head (f4fa4b5) 72.80%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #289 +/- ## ========================================== + Coverage 72.74% 72.80% +0.05% ========================================== Files 19 19 Lines 1596 1625 +29 Branches 270 277 +7 ========================================== + Hits 1161 1183 +22 - Misses 363 366 +3 - Partials 72 76 +4 ``` | [Impacted Files](https://codecov.io/gh/PyPSA/atlite/pull/289?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PyPSA) | Coverage Δ | | |---|---|---| | [atlite/gis.py](https://codecov.io/gh/PyPSA/atlite/pull/289?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PyPSA#diff-YXRsaXRlL2dpcy5weQ==) | `88.42% <81.57%> (-1.43%)` | :arrow_down: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

euronion commented 1 year ago

Nice. Did you intentionally remove ~Macedonia~ North Macedonia from all examples and plots?

FabianHofmann commented 1 year ago

Nice. Did you intentionally remove ~Macedonia~ North Macedonia from all examples and plots?

Not really, was there a renaming? It is still in the list of selected countries...

euronion commented 1 year ago

Yes, the country was officially renamed in 2019. Probably the name change took some time to propagate to the datasets.