flood-adapt 0.3.6__tar.gz → 0.3.8__tar.gz
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-0.3.6 → flood_adapt-0.3.8}/PKG-INFO +1 -1
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/__init__.py +1 -1
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/adapter/sfincs_adapter.py +29 -38
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/config/fiat.py +1 -1
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/config/site.py +5 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/dbs_classes/database.py +9 -7
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/dbs_classes/dbs_event.py +0 -20
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/dbs_classes/dbs_projection.py +0 -21
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/dbs_classes/dbs_static.py +14 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/dbs_classes/dbs_strategy.py +0 -20
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/dbs_classes/dbs_template.py +7 -5
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/flood_adapt.py +7 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt.egg-info/PKG-INFO +1 -1
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/tests/test_flood_adapt.py +10 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/LICENSE +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/README.md +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/adapter/__init__.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/adapter/fiat_adapter.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/adapter/interface/__init__.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/adapter/interface/hazard_adapter.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/adapter/interface/impact_adapter.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/adapter/interface/model_adapter.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/adapter/interface/offshore.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/adapter/sfincs_offshore.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/config/__init__.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/config/config.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/config/gui.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/config/sfincs.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/__init__.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/database_builder.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/default_units/imperial.toml +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/default_units/metric.toml +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/green_infra_table/green_infra_lookup_table.csv +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/icons/black_down_48x48.png +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/icons/black_left_48x48.png +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/icons/black_right_48x48.png +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/icons/black_up_48x48.png +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/icons/icons8-triangle-arrow-16_white_down.png +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/icons/icons8-triangle-arrow-16_white_left.png +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/icons/icons8-triangle-arrow-16_white_right.png +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/icons/icons8-triangle-arrow-16_white_up.png +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/icons/icons8-triangle-arrow-24_black_down.png +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/icons/icons8-triangle-arrow-24_black_left.png +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/icons/icons8-triangle-arrow-24_black_right.png +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/icons/icons8-triangle-arrow-24_black_up.png +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/icons/icons8-triangle-arrow-24_white_left.png +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/icons/icons8-triangle-arrow-24_white_right.png +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/icons/white_down_48x48.png +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/icons/white_left_48x48.png +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/icons/white_right_48x48.png +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/icons/white_up_48x48.png +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/infographics/OSM/config_charts.toml +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/infographics/OSM/config_people.toml +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/infographics/OSM/config_risk_charts.toml +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/infographics/OSM/config_roads.toml +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/infographics/OSM/styles.css +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/infographics/US_NSI/config_charts.toml +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/infographics/US_NSI/config_people.toml +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/infographics/US_NSI/config_risk_charts.toml +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/infographics/US_NSI/config_roads.toml +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/infographics/US_NSI/styles.css +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/infographics/images/ambulance.png +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/infographics/images/car.png +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/infographics/images/cart.png +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/infographics/images/firetruck.png +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/infographics/images/hospital.png +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/infographics/images/house.png +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/infographics/images/info.png +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/infographics/images/money.png +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/infographics/images/person.png +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/infographics/images/school.png +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/infographics/images/truck.png +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/infographics/images/walking_person.png +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/infometrics/OSM/metrics_additional_risk_configs.toml +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/infometrics/OSM/with_SVI/infographic_metrics_config.toml +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/infometrics/OSM/with_SVI/infographic_metrics_config_risk.toml +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/infometrics/OSM/without_SVI/infographic_metrics_config.toml +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/infometrics/OSM/without_SVI/infographic_metrics_config_risk.toml +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/infometrics/US_NSI/metrics_additional_risk_configs.toml +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/infometrics/US_NSI/with_SVI/infographic_metrics_config.toml +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/infometrics/US_NSI/with_SVI/infographic_metrics_config_risk.toml +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/infometrics/US_NSI/without_SVI/infographic_metrics_config.toml +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/infometrics/US_NSI/without_SVI/infographic_metrics_config_risk.toml +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/infometrics/mandatory_metrics_config.toml +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/infometrics/mandatory_metrics_config_risk.toml +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder/templates/output_layers/bin_colors.toml +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/database_builder.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/dbs_classes/__init__.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/dbs_classes/dbs_benefit.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/dbs_classes/dbs_measure.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/dbs_classes/dbs_scenario.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/dbs_classes/interface/database.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/dbs_classes/interface/element.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/dbs_classes/interface/static.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/misc/__init__.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/misc/database_user.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/misc/log.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/misc/path_builder.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/misc/utils.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/objects/__init__.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/objects/benefits/__init__.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/objects/benefits/benefits.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/objects/events/__init__.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/objects/events/event_factory.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/objects/events/event_set.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/objects/events/events.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/objects/events/historical.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/objects/events/hurricane.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/objects/events/synthetic.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/objects/forcing/__init__.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/objects/forcing/csv.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/objects/forcing/discharge.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/objects/forcing/forcing.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/objects/forcing/forcing_factory.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/objects/forcing/meteo_handler.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/objects/forcing/netcdf.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/objects/forcing/plotting.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/objects/forcing/rainfall.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/objects/forcing/tide_gauge.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/objects/forcing/time_frame.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/objects/forcing/timeseries.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/objects/forcing/unit_system.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/objects/forcing/waterlevels.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/objects/forcing/wind.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/objects/measures/__init__.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/objects/measures/measure_factory.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/objects/measures/measures.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/objects/object_model.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/objects/projections/__init__.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/objects/projections/projections.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/objects/scenarios/__init__.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/objects/scenarios/scenarios.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/objects/strategies/__init__.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/objects/strategies/strategies.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/workflows/__init__.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/workflows/benefit_runner.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/workflows/floodmap.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/workflows/impacts_integrator.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt/workflows/scenario_runner.py +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt.egg-info/SOURCES.txt +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt.egg-info/dependency_links.txt +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt.egg-info/not-zip-safe +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt.egg-info/requires.txt +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/flood_adapt.egg-info/top_level.txt +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/pyproject.toml +0 -0
- {flood_adapt-0.3.6 → flood_adapt-0.3.8}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: flood-adapt
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.8
|
|
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: GNU GENERAL PUBLIC LICENSE
|
|
@@ -12,7 +12,6 @@ import hydromt_sfincs.utils as utils
|
|
|
12
12
|
import numpy as np
|
|
13
13
|
import pandas as pd
|
|
14
14
|
import plotly.express as px
|
|
15
|
-
import plotly.graph_objects as go
|
|
16
15
|
import pyproj
|
|
17
16
|
import shapely
|
|
18
17
|
import xarray as xr
|
|
@@ -677,7 +676,8 @@ class SfincsAdapter(IHazardAdapter):
|
|
|
677
676
|
)
|
|
678
677
|
|
|
679
678
|
event = self.database.events.get(scenario.event)
|
|
680
|
-
self.
|
|
679
|
+
if self.settings.obs_point[ii].name == self.settings.tide_gauge.name:
|
|
680
|
+
self._add_tide_gauge_plot(fig, event, units=gui_units)
|
|
681
681
|
|
|
682
682
|
# write html to results folder
|
|
683
683
|
station_name = gdf.iloc[ii]["Name"]
|
|
@@ -686,26 +686,27 @@ class SfincsAdapter(IHazardAdapter):
|
|
|
686
686
|
|
|
687
687
|
def add_obs_points(self):
|
|
688
688
|
"""Add observation points provided in the site toml to SFINCS model."""
|
|
689
|
-
if self.settings.obs_point is
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
obs_points = self.settings.obs_point
|
|
693
|
-
names = []
|
|
694
|
-
lat = []
|
|
695
|
-
lon = []
|
|
696
|
-
for pt in obs_points:
|
|
697
|
-
names.append(pt.name)
|
|
698
|
-
lat.append(pt.lat)
|
|
699
|
-
lon.append(pt.lon)
|
|
689
|
+
if self.settings.obs_point is None:
|
|
690
|
+
return
|
|
691
|
+
self.logger.info("Adding observation points to the overland flood model")
|
|
700
692
|
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
693
|
+
obs_points = self.settings.obs_point
|
|
694
|
+
names = []
|
|
695
|
+
lat = []
|
|
696
|
+
lon = []
|
|
697
|
+
for pt in obs_points:
|
|
698
|
+
names.append(pt.name)
|
|
699
|
+
lat.append(pt.lat)
|
|
700
|
+
lon.append(pt.lon)
|
|
701
|
+
|
|
702
|
+
# create GeoDataFrame from obs_points in site file
|
|
703
|
+
df = pd.DataFrame({"name": names})
|
|
704
|
+
gdf = gpd.GeoDataFrame(
|
|
705
|
+
df, geometry=gpd.points_from_xy(lon, lat), crs="EPSG:4326"
|
|
706
|
+
)
|
|
706
707
|
|
|
707
|
-
|
|
708
|
-
|
|
708
|
+
# Add locations to SFINCS file
|
|
709
|
+
self._model.setup_observation_points(locations=gdf, merge=False)
|
|
709
710
|
|
|
710
711
|
def get_wl_df_from_offshore_his_results(self) -> pd.DataFrame:
|
|
711
712
|
"""Create a pd.Dataframe with waterlevels from the offshore model at the bnd locations of the overland model.
|
|
@@ -1309,15 +1310,11 @@ class SfincsAdapter(IHazardAdapter):
|
|
|
1309
1310
|
# Make sure no multipolygons are there
|
|
1310
1311
|
gdf_green_infra = gdf_green_infra.explode()
|
|
1311
1312
|
|
|
1312
|
-
# Volume is always already calculated and is converted to m3 for SFINCS
|
|
1313
|
-
height = None
|
|
1314
|
-
volume = green_infrastructure.volume.convert(
|
|
1315
|
-
us.UnitTypesVolume(us.UnitTypesVolume.m3)
|
|
1316
|
-
)
|
|
1317
|
-
|
|
1318
1313
|
# HydroMT function: create storage volume
|
|
1319
1314
|
self._model.setup_storage_volume(
|
|
1320
|
-
storage_locs=gdf_green_infra,
|
|
1315
|
+
storage_locs=gdf_green_infra,
|
|
1316
|
+
volume=green_infrastructure.volume.convert(us.UnitTypesVolume.m3),
|
|
1317
|
+
merge=True,
|
|
1321
1318
|
)
|
|
1322
1319
|
|
|
1323
1320
|
def _add_measure_pump(self, pump: Pump):
|
|
@@ -1681,10 +1678,6 @@ class SfincsAdapter(IHazardAdapter):
|
|
|
1681
1678
|
else:
|
|
1682
1679
|
return spw_file
|
|
1683
1680
|
|
|
1684
|
-
self.logger.info(
|
|
1685
|
-
f"Creating spiderweb file for hurricane event `{name}`. This may take a while."
|
|
1686
|
-
)
|
|
1687
|
-
|
|
1688
1681
|
# Initialize the tropical cyclone
|
|
1689
1682
|
tc = TropicalCyclone()
|
|
1690
1683
|
tc.read_track(filename=str(track_forcing.path), fmt="ddb_cyc")
|
|
@@ -1699,6 +1692,10 @@ class SfincsAdapter(IHazardAdapter):
|
|
|
1699
1692
|
self.logger.info(f"{start} rainfall in the spiderweb file")
|
|
1700
1693
|
tc.include_rainfall = include_rainfall
|
|
1701
1694
|
|
|
1695
|
+
self.logger.info(
|
|
1696
|
+
f"Creating spiderweb file for hurricane event `{name}`. This may take a while."
|
|
1697
|
+
)
|
|
1698
|
+
|
|
1702
1699
|
# Create spiderweb file from the track
|
|
1703
1700
|
tc.to_spiderweb(spw_file)
|
|
1704
1701
|
|
|
@@ -1843,13 +1840,7 @@ class SfincsAdapter(IHazardAdapter):
|
|
|
1843
1840
|
waterlevel = df_gauge.iloc[:, 0] + gauge_reference_height
|
|
1844
1841
|
|
|
1845
1842
|
# If data is available, add to plot
|
|
1846
|
-
fig.add_trace(
|
|
1847
|
-
go.Scatter(
|
|
1848
|
-
x=pd.DatetimeIndex(df_gauge.index),
|
|
1849
|
-
y=waterlevel,
|
|
1850
|
-
line_color="#ea6404",
|
|
1851
|
-
)
|
|
1852
|
-
)
|
|
1843
|
+
fig.add_trace(px.line(waterlevel, color="#ea6404"))
|
|
1853
1844
|
fig["data"][0]["name"] = "model"
|
|
1854
1845
|
fig["data"][1]["name"] = "measurement"
|
|
1855
1846
|
fig.update_layout(showlegend=True)
|
|
@@ -209,7 +209,7 @@ class FiatModel(BaseModel):
|
|
|
209
209
|
config: FiatConfigModel
|
|
210
210
|
|
|
211
211
|
benefits: Optional[BenefitsModel] = None
|
|
212
|
-
risk: Optional[RiskModel] =
|
|
212
|
+
risk: Optional[RiskModel] = RiskModel()
|
|
213
213
|
|
|
214
214
|
@staticmethod
|
|
215
215
|
def read_toml(path: Path) -> "FiatModel":
|
|
@@ -66,6 +66,11 @@ class Site(BaseModel):
|
|
|
66
66
|
"description": self.description,
|
|
67
67
|
"lat": self.lat,
|
|
68
68
|
"lon": self.lon,
|
|
69
|
+
"standard_objects": {
|
|
70
|
+
"events": self.standard_objects.events,
|
|
71
|
+
"projections": self.standard_objects.projections,
|
|
72
|
+
"strategies": self.standard_objects.strategies,
|
|
73
|
+
},
|
|
69
74
|
"components": {},
|
|
70
75
|
}
|
|
71
76
|
|
|
@@ -14,7 +14,6 @@ from geopandas import GeoDataFrame
|
|
|
14
14
|
from plotly.express import line
|
|
15
15
|
from plotly.express.colors import sample_colorscale
|
|
16
16
|
|
|
17
|
-
from flood_adapt.config.config import Settings
|
|
18
17
|
from flood_adapt.config.site import Site
|
|
19
18
|
from flood_adapt.dbs_classes.dbs_benefit import DbsBenefit
|
|
20
19
|
from flood_adapt.dbs_classes.dbs_event import DbsEvent
|
|
@@ -123,11 +122,17 @@ class Database(IDatabase):
|
|
|
123
122
|
|
|
124
123
|
# Initialize the different database objects
|
|
125
124
|
self._static = DbsStatic(self)
|
|
126
|
-
self._events = DbsEvent(
|
|
125
|
+
self._events = DbsEvent(
|
|
126
|
+
self, standard_objects=self.site.standard_objects.events
|
|
127
|
+
)
|
|
127
128
|
self._scenarios = DbsScenario(self)
|
|
128
|
-
self._strategies = DbsStrategy(
|
|
129
|
+
self._strategies = DbsStrategy(
|
|
130
|
+
self, standard_objects=self.site.standard_objects.strategies
|
|
131
|
+
)
|
|
129
132
|
self._measures = DbsMeasure(self)
|
|
130
|
-
self._projections = DbsProjection(
|
|
133
|
+
self._projections = DbsProjection(
|
|
134
|
+
self, standard_objects=self.site.standard_objects.projections
|
|
135
|
+
)
|
|
131
136
|
self._benefits = DbsBenefit(self)
|
|
132
137
|
|
|
133
138
|
# Delete any unfinished/crashed scenario output
|
|
@@ -648,9 +653,6 @@ class Database(IDatabase):
|
|
|
648
653
|
- does not have a corresponding input
|
|
649
654
|
|
|
650
655
|
"""
|
|
651
|
-
if not Settings().delete_crashed_runs:
|
|
652
|
-
return
|
|
653
|
-
|
|
654
656
|
if not self.scenarios.output_path.is_dir():
|
|
655
657
|
return
|
|
656
658
|
|
|
@@ -33,26 +33,6 @@ class DbsEvent(DbsTemplate[Event]):
|
|
|
33
33
|
# Load event
|
|
34
34
|
return EventFactory.load_file(event_path)
|
|
35
35
|
|
|
36
|
-
def _check_standard_objects(self, name: str) -> bool:
|
|
37
|
-
"""Check if an event is a standard event.
|
|
38
|
-
|
|
39
|
-
Parameters
|
|
40
|
-
----------
|
|
41
|
-
name : str
|
|
42
|
-
name of the event to be checked
|
|
43
|
-
|
|
44
|
-
Returns
|
|
45
|
-
-------
|
|
46
|
-
bool
|
|
47
|
-
True if the event is a standard event, False otherwise
|
|
48
|
-
"""
|
|
49
|
-
# Check if event is a standard event
|
|
50
|
-
if self._database.site.standard_objects:
|
|
51
|
-
if self._database.site.standard_objects.events:
|
|
52
|
-
if name in self._database.site.standard_objects.events:
|
|
53
|
-
return True
|
|
54
|
-
return False
|
|
55
|
-
|
|
56
36
|
def check_higher_level_usage(self, name: str) -> list[str]:
|
|
57
37
|
"""Check if an event is used in a scenario.
|
|
58
38
|
|
|
@@ -7,27 +7,6 @@ class DbsProjection(DbsTemplate[Projection]):
|
|
|
7
7
|
display_name = "Projection"
|
|
8
8
|
_object_class = Projection
|
|
9
9
|
|
|
10
|
-
def _check_standard_objects(self, name: str) -> bool:
|
|
11
|
-
"""Check if a projection is a standard projection.
|
|
12
|
-
|
|
13
|
-
Parameters
|
|
14
|
-
----------
|
|
15
|
-
name : str
|
|
16
|
-
name of the projection to be checked
|
|
17
|
-
|
|
18
|
-
Raises
|
|
19
|
-
------
|
|
20
|
-
ValueError
|
|
21
|
-
Raise error if projection is a standard projection.
|
|
22
|
-
"""
|
|
23
|
-
# Check if projection is a standard projection
|
|
24
|
-
if self._database.site.standard_objects:
|
|
25
|
-
if self._database.site.standard_objects.projections:
|
|
26
|
-
if name in self._database.site.standard_objects.projections:
|
|
27
|
-
return True
|
|
28
|
-
|
|
29
|
-
return False
|
|
30
|
-
|
|
31
10
|
def check_higher_level_usage(self, name: str) -> list[str]:
|
|
32
11
|
"""Check if a projection is used in a scenario.
|
|
33
12
|
|
|
@@ -39,6 +39,20 @@ class DbsStatic(IDbsStatic):
|
|
|
39
39
|
"""Initialize any necessary attributes."""
|
|
40
40
|
self._database = database
|
|
41
41
|
|
|
42
|
+
def load_static_data(self):
|
|
43
|
+
"""Read data into the cache.
|
|
44
|
+
|
|
45
|
+
This is used to read data from the database and store it in the cache.
|
|
46
|
+
"""
|
|
47
|
+
self.get_aggregation_areas()
|
|
48
|
+
self.get_model_boundary()
|
|
49
|
+
self.get_model_grid()
|
|
50
|
+
self.get_obs_points()
|
|
51
|
+
if self._database.site.sfincs.slr_scenarios is not None:
|
|
52
|
+
self.get_slr_scn_names()
|
|
53
|
+
self.get_buildings()
|
|
54
|
+
self.get_property_types()
|
|
55
|
+
|
|
42
56
|
@cache_method_wrapper
|
|
43
57
|
def get_aggregation_areas(self) -> dict[str, gpd.GeoDataFrame]:
|
|
44
58
|
"""Get a list of the aggregation areas that are provided in the site configuration.
|
|
@@ -104,26 +104,6 @@ class DbsStrategy(DbsTemplate[Strategy]):
|
|
|
104
104
|
counter += 1
|
|
105
105
|
raise ValueError(msg)
|
|
106
106
|
|
|
107
|
-
def _check_standard_objects(self, name: str) -> bool:
|
|
108
|
-
"""Check if a strategy is a standard strategy.
|
|
109
|
-
|
|
110
|
-
Parameters
|
|
111
|
-
----------
|
|
112
|
-
name : str
|
|
113
|
-
name of the strategy to be checked
|
|
114
|
-
|
|
115
|
-
Raises
|
|
116
|
-
------
|
|
117
|
-
ValueError
|
|
118
|
-
Raise error if strategy is a standard strategy.
|
|
119
|
-
"""
|
|
120
|
-
# Check if strategy is a standard strategy
|
|
121
|
-
if self._database.site.standard_objects:
|
|
122
|
-
if self._database.site.standard_objects.strategies:
|
|
123
|
-
if name in self._database.site.standard_objects.strategies:
|
|
124
|
-
return True
|
|
125
|
-
return False
|
|
126
|
-
|
|
127
107
|
def check_higher_level_usage(self, name: str) -> list[str]:
|
|
128
108
|
"""Check if a strategy is used in a scenario.
|
|
129
109
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import shutil
|
|
2
2
|
from datetime import datetime
|
|
3
3
|
from pathlib import Path
|
|
4
|
-
from typing import Any, TypeVar
|
|
4
|
+
from typing import Any, Optional, TypeVar
|
|
5
5
|
|
|
6
6
|
import tomli
|
|
7
7
|
import tomli_w
|
|
@@ -18,12 +18,14 @@ class DbsTemplate(AbstractDatabaseElement[T_OBJECTMODEL]):
|
|
|
18
18
|
dir_name: str
|
|
19
19
|
_object_class: type[T_OBJECTMODEL]
|
|
20
20
|
|
|
21
|
-
def __init__(
|
|
21
|
+
def __init__(
|
|
22
|
+
self, database: IDatabase, standard_objects: Optional[list[str]] = None
|
|
23
|
+
):
|
|
22
24
|
"""Initialize any necessary attributes."""
|
|
23
25
|
self._database = database
|
|
24
26
|
self.input_path = database.input_path / self.dir_name
|
|
25
27
|
self.output_path = database.output_path / self.dir_name
|
|
26
|
-
self.standard_objects =
|
|
28
|
+
self.standard_objects = standard_objects
|
|
27
29
|
|
|
28
30
|
def get(self, name: str) -> T_OBJECTMODEL:
|
|
29
31
|
"""Return an object of the type of the database with the given name.
|
|
@@ -188,8 +190,8 @@ class DbsTemplate(AbstractDatabaseElement[T_OBJECTMODEL]):
|
|
|
188
190
|
bool
|
|
189
191
|
True if the object is a standard object, False otherwise
|
|
190
192
|
"""
|
|
191
|
-
|
|
192
|
-
|
|
193
|
+
if self.standard_objects:
|
|
194
|
+
return name in self.standard_objects
|
|
193
195
|
return False
|
|
194
196
|
|
|
195
197
|
def check_higher_level_usage(self, name: str) -> list[str]:
|
|
@@ -923,6 +923,13 @@ class FloodAdapt:
|
|
|
923
923
|
)
|
|
924
924
|
|
|
925
925
|
# Static
|
|
926
|
+
def load_static_data(self):
|
|
927
|
+
"""Read the static data into the cache.
|
|
928
|
+
|
|
929
|
+
This is used to speed up the loading of the static data.
|
|
930
|
+
"""
|
|
931
|
+
self.database.static.load_static_data()
|
|
932
|
+
|
|
926
933
|
def get_aggregation_areas(
|
|
927
934
|
self,
|
|
928
935
|
) -> dict[str, gpd.GeoDataFrame]:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: flood-adapt
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.8
|
|
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: GNU GENERAL PUBLIC LICENSE
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import platform
|
|
2
|
+
|
|
1
3
|
import geopandas as gpd
|
|
2
4
|
import numpy as np
|
|
3
5
|
import pandas as pd
|
|
@@ -272,6 +274,10 @@ class TestStrategies:
|
|
|
272
274
|
test_fa.get_strategy(strategy.name)
|
|
273
275
|
|
|
274
276
|
|
|
277
|
+
@pytest.mark.skipif(
|
|
278
|
+
platform.system() == "Linux",
|
|
279
|
+
reason="Skipped on Linux due to broken sfincs binary",
|
|
280
|
+
)
|
|
275
281
|
class TestScenarios:
|
|
276
282
|
@pytest.fixture()
|
|
277
283
|
def setup_nearshore_scenario(self, test_fa: FloodAdapt, setup_nearshore_event):
|
|
@@ -430,6 +436,10 @@ class TestScenarios:
|
|
|
430
436
|
test_fa.database.scenarios.summarize_objects()
|
|
431
437
|
|
|
432
438
|
|
|
439
|
+
@pytest.mark.skipif(
|
|
440
|
+
platform.system() == "Linux",
|
|
441
|
+
reason="Skipped on Linux due to broken sfincs binary",
|
|
442
|
+
)
|
|
433
443
|
class TestOutput:
|
|
434
444
|
@pytest.fixture(scope="class")
|
|
435
445
|
def completed_scenario(self, test_fa_class: FloodAdapt):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|