flood-adapt 1.1.1__py3-none-any.whl → 1.1.2__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,5 @@
1
1
  # has to be here at the start to avoid circular imports
2
- __version__ = "1.1.1"
2
+ __version__ = "1.1.2"
3
3
 
4
4
  from flood_adapt import adapter, database_builder, dbs_classes, objects
5
5
  from flood_adapt.config.config import Settings
@@ -1310,10 +1310,14 @@ class SfincsAdapter(IHazardAdapter):
1310
1310
  )
1311
1311
  return
1312
1312
 
1313
+ model_rivers = self._read_river_locations()
1314
+ if model_rivers.empty:
1315
+ logger.warning(
1316
+ "Cannot add discharge forcing: No rivers defined in the sfincs model."
1317
+ )
1318
+ return
1313
1319
  logger.info(f"Setting discharge forcing for river: {discharge.river.name}")
1314
-
1315
1320
  time_frame = self.get_model_time()
1316
- model_rivers = self._read_river_locations()
1317
1321
 
1318
1322
  # Check that the river is defined in the model and that the coordinates match
1319
1323
  river_loc = shapely.Point(
@@ -1711,17 +1715,22 @@ class SfincsAdapter(IHazardAdapter):
1711
1715
 
1712
1716
  def _read_river_locations(self) -> gpd.GeoDataFrame:
1713
1717
  path = self.get_model_root() / "sfincs.src"
1714
-
1715
- with open(path) as f:
1716
- lines = f.readlines()
1718
+ lines = []
1719
+ if path.exists():
1720
+ with open(path) as f:
1721
+ lines = f.readlines()
1717
1722
  coords = [(float(line.split()[0]), float(line.split()[1])) for line in lines]
1718
1723
  points = [shapely.Point(coord) for coord in coords]
1719
1724
 
1720
1725
  return gpd.GeoDataFrame({"geometry": points}, crs=self._model.crs)
1721
1726
 
1722
1727
  def _read_waterlevel_boundary_locations(self) -> gpd.GeoDataFrame:
1723
- with open(self.get_model_root() / "sfincs.bnd") as f:
1724
- lines = f.readlines()
1728
+ path = self.get_model_root() / "sfincs.bnd"
1729
+ lines = []
1730
+ if path.exists():
1731
+ with open(path) as f:
1732
+ lines = f.readlines()
1733
+
1725
1734
  coords = [(float(line.split()[0]), float(line.split()[1])) for line in lines]
1726
1735
  points = [shapely.Point(coord) for coord in coords]
1727
1736
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: flood-adapt
3
- Version: 1.1.1
3
+ Version: 1.1.2
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: ====================================================
@@ -1,8 +1,8 @@
1
- flood_adapt/__init__.py,sha256=qFXo1YJVbLyqFpONc_TfAdUhZw9fgTacsn1XbFq1LxM,779
1
+ flood_adapt/__init__.py,sha256=3YQ8FGjALB_ckt6bSvYNYb4kp-L5GMSoNxipSQle_ZY,779
2
2
  flood_adapt/flood_adapt.py,sha256=HVFS4OFhcB0TqHtMw3kbEei0IfJxsciauHfG3XZ38-0,40747
3
3
  flood_adapt/adapter/__init__.py,sha256=vnF8NCkEVX-N-gtGS-J_A1H1YYAjihWjJZFyYGwcp8Q,180
4
4
  flood_adapt/adapter/fiat_adapter.py,sha256=seDjPoumkhUOd7qer3ni1_Ut3dwyq0-_yhJNaTEFc2E,60284
5
- flood_adapt/adapter/sfincs_adapter.py,sha256=SSZ5hlnHpXLmDQqbyBMfybdAQIOpYOqIsSzoKk4XLZg,78825
5
+ flood_adapt/adapter/sfincs_adapter.py,sha256=0M2miklSvKIsedFU5JCRclyHvGAombLEyklZPgwByIY,79138
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
@@ -114,8 +114,8 @@ flood_adapt/objects/strategies/strategies.py,sha256=Jw-WJDCamL9p_7VEir3AdmYPMVAi
114
114
  flood_adapt/workflows/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
115
115
  flood_adapt/workflows/benefit_runner.py,sha256=eA21TuHdeZ6QYO8ehXri6BHlkyHsVsZphIdIca5g0KA,21824
116
116
  flood_adapt/workflows/scenario_runner.py,sha256=9_Y6GmMYhYoTRkBUIlju0eBy6DosGf4Zl2tgu1QEubI,4119
117
- flood_adapt-1.1.1.dist-info/LICENSE,sha256=Ui5E03pQ0EVKxvKA54lTPA1xrtgA2HMGLQai95eOzoE,36321
118
- flood_adapt-1.1.1.dist-info/METADATA,sha256=ZCiBsiXoCBBXNEMSsEhJbI5wZiVyW6aVH6EVZBaJY8k,48876
119
- flood_adapt-1.1.1.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
120
- flood_adapt-1.1.1.dist-info/top_level.txt,sha256=JvzMi6cTcQPEThCfpgMEeVny3ghI1urSH0CCgVIqSzw,12
121
- flood_adapt-1.1.1.dist-info/RECORD,,
117
+ flood_adapt-1.1.2.dist-info/LICENSE,sha256=Ui5E03pQ0EVKxvKA54lTPA1xrtgA2HMGLQai95eOzoE,36321
118
+ flood_adapt-1.1.2.dist-info/METADATA,sha256=nnnU7EvxfCCRU_9kCJqoDR3zpjAGUojTDO5dXZ9C12I,48876
119
+ flood_adapt-1.1.2.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
120
+ flood_adapt-1.1.2.dist-info/top_level.txt,sha256=JvzMi6cTcQPEThCfpgMEeVny3ghI1urSH0CCgVIqSzw,12
121
+ flood_adapt-1.1.2.dist-info/RECORD,,