Skip to content

Commit 89f9379

Browse files
authored
gis: Pass model to RasterLayer.from_file (#186)
Fixes the population and rainfall models by passing model to RasterLayer.from_file(). > The RasterLayer creates Cells, Cells inherit from Agents, Agents need model input, but RasterLayer doesn't have access to model.
1 parent dee6363 commit 89f9379

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

gis/population/population/space.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ def load_data(self, population_gzip_file, lake_zip_file, world_zip_file, model):
3838
world_size = gpd.GeoDataFrame.from_file(world_zip_file)
3939
raster_layer = RasterLayer.from_file(
4040
population_gzip_file,
41+
model=model,
4142
cell_cls=UgandaCell,
4243
attr_name="population",
4344
rio_opener=gzip.open,

gis/rainfall/rainfall/space.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def __init__(self, crs, water_height, model):
3737
def set_elevation_layer(self, elevation_gzip_file, crs):
3838
raster_layer = mg.RasterLayer.from_file(
3939
elevation_gzip_file,
40+
model=self.model,
4041
cell_cls=LakeCell,
4142
attr_name="elevation",
4243
rio_opener=gzip.open,

0 commit comments

Comments
 (0)