flood-adapt 1.0.5__py3-none-any.whl → 1.0.6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
flood_adapt/__init__.py CHANGED
@@ -1,5 +1,6 @@
1
1
  # has to be here at the start to avoid circular imports
2
- __version__ = "1.0.5"
2
+
3
+ __version__ = "1.0.6"
3
4
 
4
5
  from flood_adapt import adapter, database_builder, dbs_classes, objects
5
6
  from flood_adapt.config.config import Settings
@@ -1304,10 +1304,14 @@ class SfincsAdapter(IHazardAdapter):
1304
1304
  )
1305
1305
  return
1306
1306
 
1307
+ model_rivers = self._read_river_locations()
1308
+ if model_rivers.empty:
1309
+ logger.warning(
1310
+ "Cannot add discharge forcing: No rivers defined in the sfincs model."
1311
+ )
1312
+ return
1307
1313
  logger.info(f"Setting discharge forcing for river: {discharge.river.name}")
1308
-
1309
1314
  time_frame = self.get_model_time()
1310
- model_rivers = self._read_river_locations()
1311
1315
 
1312
1316
  # Check that the river is defined in the model and that the coordinates match
1313
1317
  river_loc = shapely.Point(
@@ -1705,17 +1709,22 @@ class SfincsAdapter(IHazardAdapter):
1705
1709
 
1706
1710
  def _read_river_locations(self) -> gpd.GeoDataFrame:
1707
1711
  path = self.get_model_root() / "sfincs.src"
1708
-
1709
- with open(path) as f:
1710
- lines = f.readlines()
1712
+ lines = []
1713
+ if path.exists():
1714
+ with open(path) as f:
1715
+ lines = f.readlines()
1711
1716
  coords = [(float(line.split()[0]), float(line.split()[1])) for line in lines]
1712
1717
  points = [shapely.Point(coord) for coord in coords]
1713
1718
 
1714
1719
  return gpd.GeoDataFrame({"geometry": points}, crs=self._model.crs)
1715
1720
 
1716
1721
  def _read_waterlevel_boundary_locations(self) -> gpd.GeoDataFrame:
1717
- with open(self.get_model_root() / "sfincs.bnd") as f:
1718
- lines = f.readlines()
1722
+ path = self.get_model_root() / "sfincs.bnd"
1723
+ lines = []
1724
+ if path.exists():
1725
+ with open(path) as f:
1726
+ lines = f.readlines()
1727
+
1719
1728
  coords = [(float(line.split()[0]), float(line.split()[1])) for line in lines]
1720
1729
  points = [shapely.Point(coord) for coord in coords]
1721
1730
 
@@ -233,7 +233,7 @@ class Database(IDatabase):
233
233
  if _type == FloodmapType.water_level:
234
234
  paths = [base_dir / "max_water_level_map.nc"]
235
235
  elif _type == FloodmapType.water_depth:
236
- paths = [base_dir / f"FloodMap_{self.name}.tif"]
236
+ paths = [base_dir / f"FloodMap_{scenario_name}.tif"]
237
237
  elif mode == Mode.risk:
238
238
  if _type == FloodmapType.water_level:
239
239
  paths = list(base_dir.glob("RP_*_maps.nc"))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: flood-adapt
3
- Version: 1.0.5
3
+ Version: 1.0.6
4
4
  Summary: A software package support system which can be used to assess the benefits and costs of flood resilience measures
5
5
  Author-email: Gundula Winter <Gundula.Winter@deltares.nl>, Panos Athanasiou <Panos.Athanasiou@deltares.nl>, Frederique de Groen <Frederique.deGroen@deltares.nl>, Tim de Wilde <Tim.deWilde@deltares.nl>, Julian Hofer <Julian.Hofer@deltares.nl>, Daley Adrichem <Daley.Adrichem@deltares.nl>, Luuk Blom <Luuk.Blom@deltares.nl>
6
6
  License: ====================================================
@@ -712,14 +712,12 @@ Requires-Dist: cht-cyclones==1.0.3
712
712
  Requires-Dist: cht-meteo==0.3.1
713
713
  Requires-Dist: cht-observations==0.2.1
714
714
  Requires-Dist: cht-tide==0.1.1
715
- Requires-Dist: dask==2024.11.2
716
- Requires-Dist: numba_celltree==0.2.2
717
715
  Requires-Dist: fiat-toolbox==0.1.20
718
716
  Requires-Dist: fiona<2.0,>=1.0
719
717
  Requires-Dist: geojson<4.0,>=3.0
720
718
  Requires-Dist: geopandas<2.0,>=1.0
721
- Requires-Dist: hydromt-fiat==0.5.5
722
- Requires-Dist: hydromt-sfincs==1.2.0
719
+ Requires-Dist: hydromt-fiat<1.0,>=0.5.5
720
+ Requires-Dist: hydromt-sfincs[quadtree]<2.0,>=1.2.2
723
721
  Requires-Dist: numpy<2.0,>=1.0
724
722
  Requires-Dist: numpy-financial<2.0,>=1.0
725
723
  Requires-Dist: pandas<3.0,>=2.0
@@ -1,8 +1,8 @@
1
- flood_adapt/__init__.py,sha256=r1l4YoUpNQQHhzmOgNZqrf50Wumk3lrZbM-ixuidPp0,779
1
+ flood_adapt/__init__.py,sha256=th2A3Ub_atS7QHg1y2SxGCiECW7BKlWrXZX7fuHd4M8,781
2
2
  flood_adapt/flood_adapt.py,sha256=g-OpS0spvi-puwQFhvsfu_vvduozTPXk9DU2ay9ypgs,38698
3
3
  flood_adapt/adapter/__init__.py,sha256=vnF8NCkEVX-N-gtGS-J_A1H1YYAjihWjJZFyYGwcp8Q,180
4
4
  flood_adapt/adapter/fiat_adapter.py,sha256=s6M-_bwr4NUWLZvlc619BUmnA_z-DNMggVcnlG-jrqM,60075
5
- flood_adapt/adapter/sfincs_adapter.py,sha256=I144KFNLlE8ZZCk4qXs76gwt6yw9o3hyCaIQGvwN85o,78551
5
+ flood_adapt/adapter/sfincs_adapter.py,sha256=QIfD_7UnciN4MdminT5BRDEKCyubJBGf8RsSOd2hs9s,78864
6
6
  flood_adapt/adapter/sfincs_offshore.py,sha256=DkqGwx0Fx4dojY1YH8tW3MUS4Omgd5DC6QINEsTP0Uk,7659
7
7
  flood_adapt/adapter/interface/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
8
  flood_adapt/adapter/interface/hazard_adapter.py,sha256=S2NIUAMSRgxC_E-tZRJ2qIP06U1zEVdn-MnvMTrn86s,2828
@@ -76,7 +76,7 @@ flood_adapt/database_builder/templates/infometrics/US_NSI/without_SVI/infographi
76
76
  flood_adapt/database_builder/templates/infometrics/US_NSI/without_SVI/infographic_metrics_config_risk.toml,sha256=VLO7NRWTPzYRj3jYDb_mImPTppSm8Lh1ajCdNPuyc4U,2045
77
77
  flood_adapt/database_builder/templates/output_layers/bin_colors.toml,sha256=yN3_h2IimOyjtfhZ-ZoWyNa-2cAeFRNlbvaNTLhEMfA,417
78
78
  flood_adapt/dbs_classes/__init__.py,sha256=J-a6BEkjDhuUzzRKuAn_AtTg_D9wNIsmY3BnVTiC2JA,731
79
- flood_adapt/dbs_classes/database.py,sha256=-PFj-H_huKzlwehh-M0578OtqDS5LmLNAENSBmScAMg,23405
79
+ flood_adapt/dbs_classes/database.py,sha256=oR0aC2HRsGGe0pwFrPtPAzXxfv_lqtTdjY9UrS9wwtU,23409
80
80
  flood_adapt/dbs_classes/dbs_benefit.py,sha256=ayEYz8ga49HLdYuUsDWZOuZnpRnBpTuyhvfe2IyWAKI,1825
81
81
  flood_adapt/dbs_classes/dbs_event.py,sha256=ak3kHan6L1EfC8agDLKiCe8gaY5leOmj_qUBsI61q9A,1869
82
82
  flood_adapt/dbs_classes/dbs_measure.py,sha256=vVs-LtnHJN7eSGIFUglJdpbtfq_QI_Ftkv4lh5mfnNM,4085
@@ -134,8 +134,8 @@ flood_adapt/objects/strategies/strategies.py,sha256=Jw-WJDCamL9p_7VEir3AdmYPMVAi
134
134
  flood_adapt/workflows/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
135
135
  flood_adapt/workflows/benefit_runner.py,sha256=VtYt0sHFymNyErpzOtuN55cKJGVm5hT2a_Qzprg6T88,21786
136
136
  flood_adapt/workflows/scenario_runner.py,sha256=9_Y6GmMYhYoTRkBUIlju0eBy6DosGf4Zl2tgu1QEubI,4119
137
- flood_adapt-1.0.5.dist-info/LICENSE,sha256=Ui5E03pQ0EVKxvKA54lTPA1xrtgA2HMGLQai95eOzoE,36321
138
- flood_adapt-1.0.5.dist-info/METADATA,sha256=UWG30Lfy1nJk7jm5uT8MLdBHdfhwD84XzIDbx6qvRcQ,53259
139
- flood_adapt-1.0.5.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
140
- flood_adapt-1.0.5.dist-info/top_level.txt,sha256=JvzMi6cTcQPEThCfpgMEeVny3ghI1urSH0CCgVIqSzw,12
141
- flood_adapt-1.0.5.dist-info/RECORD,,
137
+ flood_adapt-1.0.6.dist-info/LICENSE,sha256=Ui5E03pQ0EVKxvKA54lTPA1xrtgA2HMGLQai95eOzoE,36321
138
+ flood_adapt-1.0.6.dist-info/METADATA,sha256=FvbH5BpNMV_cXv23oWzPC2APQvSzPmGBwQKZjyBIFGY,53209
139
+ flood_adapt-1.0.6.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
140
+ flood_adapt-1.0.6.dist-info/top_level.txt,sha256=JvzMi6cTcQPEThCfpgMEeVny3ghI1urSH0CCgVIqSzw,12
141
+ flood_adapt-1.0.6.dist-info/RECORD,,