Closed fneum closed 1 year ago
I don't think the test failures are related to this PR.
a.) Your code for testing does not affect the code lines you have changes, The test is for a geometry, and the changes you proposed affect raster exclusions ;-)
b.) With rasterio>1.3.2
reading from URL is now enabled, so we don't need to change anything (free new features - yeah! 🥳 )
For testing:
from atlite.gis import ExclusionContainer
import geopandas as gpd
world = gpd.read_file(gpd.datasets.get_path('naturalearth_lowres'))
shape = world.query("iso_a3 == 'PRT'").to_crs(CRS).geometry
CRS = 3035
excluder = ExclusionContainer(crs=CRS)
excluder.add_raster(
"https://fex.hrz.uni-giessen.de/fop/sJ3xfVzn/g250_06.tif",
codes=[12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 31, 32]
)
excluder.plot_shape_availability(shape)
Closes #307
Popular feature request in the Data Science for Energy System Modelling course.
Follows PyPSA implementation.
Test with: