From ac51b82d78bf46442146ea5647d005734b43ec9c Mon Sep 17 00:00:00 2001 From: Panos Athanasiou Date: Wed, 30 Oct 2024 10:57:27 +0100 Subject: [PATCH] small correction based on change of spatial join read in hydromt fiat --- flood_adapt/database_builder/create_database.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/flood_adapt/database_builder/create_database.py b/flood_adapt/database_builder/create_database.py index 97e68f7a..9c51a208 100644 --- a/flood_adapt/database_builder/create_database.py +++ b/flood_adapt/database_builder/create_database.py @@ -686,22 +686,22 @@ def read_fiat(self): else: for aggr in self.fiat_model.spatial_joins["aggregation_areas"]: # Make sure paths are correct - aggr.file = str( - self.static_path.joinpath("templates", "fiat", aggr.file) + aggr["file"] = str( + self.static_path.joinpath("templates", "fiat", aggr["file"]) .relative_to(self.static_path) .as_posix() ) - if aggr.equity is not None: - aggr.equity.census_data = str( + if aggr["equity"] is not None: + aggr["equity"]["census_data"] = str( self.static_path.joinpath( - "templates", "fiat", aggr.equity.census_data + "templates", "fiat", aggr["equity"]["census_data"] ) .relative_to(self.static_path) .as_posix() ) - self.site_attrs["fiat"]["aggregation"].append(aggr.model_dump()) + self.site_attrs["fiat"]["aggregation"].append(aggr) self.logger.info( - f"The aggregation types {[aggr.name for aggr in self.fiat_model.spatial_joins['aggregation_areas']]} from the FIAT model are going to be used." + f"The aggregation types {[aggr['name'] for aggr in self.fiat_model.spatial_joins['aggregation_areas']]} from the FIAT model are going to be used." ) # Read SVI