flood-adapt 0.3.8__tar.gz → 0.3.9__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.
Files changed (146) hide show
  1. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/PKG-INFO +10 -5
  2. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/README.md +7 -4
  3. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/__init__.py +1 -1
  4. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/adapter/fiat_adapter.py +51 -46
  5. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/adapter/sfincs_adapter.py +4 -2
  6. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/config/config.py +28 -70
  7. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/database_builder.py +2 -2
  8. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/dbs_classes/database.py +1 -5
  9. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/dbs_classes/dbs_scenario.py +1 -1
  10. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/dbs_classes/dbs_static.py +1 -1
  11. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/objects/projections/projections.py +22 -8
  12. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/workflows/benefit_runner.py +14 -4
  13. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/workflows/impacts_integrator.py +6 -3
  14. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt.egg-info/PKG-INFO +10 -5
  15. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt.egg-info/requires.txt +2 -0
  16. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/pyproject.toml +2 -12
  17. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/LICENSE +0 -0
  18. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/adapter/__init__.py +0 -0
  19. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/adapter/interface/__init__.py +0 -0
  20. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/adapter/interface/hazard_adapter.py +0 -0
  21. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/adapter/interface/impact_adapter.py +0 -0
  22. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/adapter/interface/model_adapter.py +0 -0
  23. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/adapter/interface/offshore.py +0 -0
  24. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/adapter/sfincs_offshore.py +0 -0
  25. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/config/__init__.py +0 -0
  26. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/config/fiat.py +0 -0
  27. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/config/gui.py +0 -0
  28. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/config/sfincs.py +0 -0
  29. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/config/site.py +0 -0
  30. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/__init__.py +0 -0
  31. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/default_units/imperial.toml +0 -0
  32. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/default_units/metric.toml +0 -0
  33. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/green_infra_table/green_infra_lookup_table.csv +0 -0
  34. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/icons/black_down_48x48.png +0 -0
  35. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/icons/black_left_48x48.png +0 -0
  36. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/icons/black_right_48x48.png +0 -0
  37. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/icons/black_up_48x48.png +0 -0
  38. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/icons/icons8-triangle-arrow-16_white_down.png +0 -0
  39. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/icons/icons8-triangle-arrow-16_white_left.png +0 -0
  40. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/icons/icons8-triangle-arrow-16_white_right.png +0 -0
  41. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/icons/icons8-triangle-arrow-16_white_up.png +0 -0
  42. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/icons/icons8-triangle-arrow-24_black_down.png +0 -0
  43. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/icons/icons8-triangle-arrow-24_black_left.png +0 -0
  44. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/icons/icons8-triangle-arrow-24_black_right.png +0 -0
  45. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/icons/icons8-triangle-arrow-24_black_up.png +0 -0
  46. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/icons/icons8-triangle-arrow-24_white_left.png +0 -0
  47. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/icons/icons8-triangle-arrow-24_white_right.png +0 -0
  48. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/icons/white_down_48x48.png +0 -0
  49. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/icons/white_left_48x48.png +0 -0
  50. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/icons/white_right_48x48.png +0 -0
  51. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/icons/white_up_48x48.png +0 -0
  52. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/infographics/OSM/config_charts.toml +0 -0
  53. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/infographics/OSM/config_people.toml +0 -0
  54. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/infographics/OSM/config_risk_charts.toml +0 -0
  55. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/infographics/OSM/config_roads.toml +0 -0
  56. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/infographics/OSM/styles.css +0 -0
  57. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/infographics/US_NSI/config_charts.toml +0 -0
  58. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/infographics/US_NSI/config_people.toml +0 -0
  59. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/infographics/US_NSI/config_risk_charts.toml +0 -0
  60. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/infographics/US_NSI/config_roads.toml +0 -0
  61. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/infographics/US_NSI/styles.css +0 -0
  62. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/infographics/images/ambulance.png +0 -0
  63. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/infographics/images/car.png +0 -0
  64. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/infographics/images/cart.png +0 -0
  65. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/infographics/images/firetruck.png +0 -0
  66. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/infographics/images/hospital.png +0 -0
  67. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/infographics/images/house.png +0 -0
  68. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/infographics/images/info.png +0 -0
  69. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/infographics/images/money.png +0 -0
  70. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/infographics/images/person.png +0 -0
  71. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/infographics/images/school.png +0 -0
  72. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/infographics/images/truck.png +0 -0
  73. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/infographics/images/walking_person.png +0 -0
  74. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/infometrics/OSM/metrics_additional_risk_configs.toml +0 -0
  75. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/infometrics/OSM/with_SVI/infographic_metrics_config.toml +0 -0
  76. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/infometrics/OSM/with_SVI/infographic_metrics_config_risk.toml +0 -0
  77. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/infometrics/OSM/without_SVI/infographic_metrics_config.toml +0 -0
  78. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/infometrics/OSM/without_SVI/infographic_metrics_config_risk.toml +0 -0
  79. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/infometrics/US_NSI/metrics_additional_risk_configs.toml +0 -0
  80. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/infometrics/US_NSI/with_SVI/infographic_metrics_config.toml +0 -0
  81. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/infometrics/US_NSI/with_SVI/infographic_metrics_config_risk.toml +0 -0
  82. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/infometrics/US_NSI/without_SVI/infographic_metrics_config.toml +0 -0
  83. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/infometrics/US_NSI/without_SVI/infographic_metrics_config_risk.toml +0 -0
  84. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/infometrics/mandatory_metrics_config.toml +0 -0
  85. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/infometrics/mandatory_metrics_config_risk.toml +0 -0
  86. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder/templates/output_layers/bin_colors.toml +0 -0
  87. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/database_builder.py +0 -0
  88. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/dbs_classes/__init__.py +0 -0
  89. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/dbs_classes/dbs_benefit.py +0 -0
  90. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/dbs_classes/dbs_event.py +0 -0
  91. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/dbs_classes/dbs_measure.py +0 -0
  92. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/dbs_classes/dbs_projection.py +0 -0
  93. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/dbs_classes/dbs_strategy.py +0 -0
  94. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/dbs_classes/dbs_template.py +0 -0
  95. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/dbs_classes/interface/database.py +0 -0
  96. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/dbs_classes/interface/element.py +0 -0
  97. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/dbs_classes/interface/static.py +0 -0
  98. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/flood_adapt.py +0 -0
  99. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/misc/__init__.py +0 -0
  100. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/misc/database_user.py +0 -0
  101. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/misc/log.py +0 -0
  102. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/misc/path_builder.py +0 -0
  103. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/misc/utils.py +0 -0
  104. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/objects/__init__.py +0 -0
  105. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/objects/benefits/__init__.py +0 -0
  106. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/objects/benefits/benefits.py +0 -0
  107. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/objects/events/__init__.py +0 -0
  108. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/objects/events/event_factory.py +0 -0
  109. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/objects/events/event_set.py +0 -0
  110. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/objects/events/events.py +0 -0
  111. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/objects/events/historical.py +0 -0
  112. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/objects/events/hurricane.py +0 -0
  113. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/objects/events/synthetic.py +0 -0
  114. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/objects/forcing/__init__.py +0 -0
  115. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/objects/forcing/csv.py +0 -0
  116. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/objects/forcing/discharge.py +0 -0
  117. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/objects/forcing/forcing.py +0 -0
  118. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/objects/forcing/forcing_factory.py +0 -0
  119. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/objects/forcing/meteo_handler.py +0 -0
  120. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/objects/forcing/netcdf.py +0 -0
  121. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/objects/forcing/plotting.py +0 -0
  122. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/objects/forcing/rainfall.py +0 -0
  123. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/objects/forcing/tide_gauge.py +0 -0
  124. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/objects/forcing/time_frame.py +0 -0
  125. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/objects/forcing/timeseries.py +0 -0
  126. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/objects/forcing/unit_system.py +0 -0
  127. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/objects/forcing/waterlevels.py +0 -0
  128. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/objects/forcing/wind.py +0 -0
  129. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/objects/measures/__init__.py +0 -0
  130. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/objects/measures/measure_factory.py +0 -0
  131. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/objects/measures/measures.py +0 -0
  132. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/objects/object_model.py +0 -0
  133. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/objects/projections/__init__.py +0 -0
  134. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/objects/scenarios/__init__.py +0 -0
  135. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/objects/scenarios/scenarios.py +0 -0
  136. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/objects/strategies/__init__.py +0 -0
  137. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/objects/strategies/strategies.py +0 -0
  138. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/workflows/__init__.py +0 -0
  139. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/workflows/floodmap.py +0 -0
  140. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt/workflows/scenario_runner.py +0 -0
  141. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt.egg-info/SOURCES.txt +0 -0
  142. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt.egg-info/dependency_links.txt +0 -0
  143. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt.egg-info/not-zip-safe +0 -0
  144. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/flood_adapt.egg-info/top_level.txt +0 -0
  145. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/setup.cfg +0 -0
  146. {flood_adapt-0.3.8 → flood_adapt-0.3.9}/tests/test_flood_adapt.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: flood-adapt
3
- Version: 0.3.8
3
+ Version: 0.3.9
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
@@ -728,6 +728,8 @@ Requires-Dist: sphinx-rtd-theme<4.0,>=3.0; extra == "docs"
728
728
  Requires-Dist: regex<2025.0,>=2024.11; extra == "docs"
729
729
  Requires-Dist: minio<8,>=7.2.15; extra == "docs"
730
730
  Requires-Dist: python-dotenv<2.0,>=1.0; extra == "docs"
731
+ Requires-Dist: folium<1.0,>=0.19.0; extra == "docs"
732
+ Requires-Dist: mapclassify<3.0,>=2.8.0; extra == "docs"
731
733
  Provides-Extra: all
732
734
  Requires-Dist: flood-adapt[build,dev,docs]; extra == "all"
733
735
 
@@ -773,7 +775,7 @@ FloodAdapt uses a database to store, handle and organize input files, output fil
773
775
  To initialize FloodAdapt and configure the database, add the following lines to the top of your script / initialize function to validate and set the environment variables:
774
776
  ```python
775
777
  from pathlib import Path
776
- from flood_adapt.misc.config import Settings
778
+ from flood_adapt import Settings
777
779
 
778
780
  # Usually ends in `Database` and can contain multiple sites
779
781
  root = Path("path/to/your/database/root")
@@ -781,14 +783,17 @@ root = Path("path/to/your/database/root")
781
783
  # Specifies which site to use
782
784
  name = "database_name"
783
785
 
784
- # Contains the model kernels to run that perform the calculations
785
- system_folder = Path("path/to/your/system/folder")
786
+ # Define the paths to the model kernel binaries
787
+ sfincs_bin = Path("path/to/your/sfincs/bin.exe")
788
+ fiat_bin = Path("path/to/your/fiat/bin.exe")
786
789
 
787
790
  # Validate and set environment variables
788
791
  Settings(
789
792
  DATABASE_ROOT=root,
790
793
  DATABASE_NAME=name,
791
- SYSTEM_FOLDER=system_folder,
794
+ SFINCS_BIN_PATH=sfincs_bin,
795
+ FIAT_BIN_PATH=fiat_path,
796
+ VALIDATE_BINARIES=True,
792
797
  )
793
798
  ```
794
799
 
@@ -40,7 +40,7 @@ FloodAdapt uses a database to store, handle and organize input files, output fil
40
40
  To initialize FloodAdapt and configure the database, add the following lines to the top of your script / initialize function to validate and set the environment variables:
41
41
  ```python
42
42
  from pathlib import Path
43
- from flood_adapt.misc.config import Settings
43
+ from flood_adapt import Settings
44
44
 
45
45
  # Usually ends in `Database` and can contain multiple sites
46
46
  root = Path("path/to/your/database/root")
@@ -48,14 +48,17 @@ root = Path("path/to/your/database/root")
48
48
  # Specifies which site to use
49
49
  name = "database_name"
50
50
 
51
- # Contains the model kernels to run that perform the calculations
52
- system_folder = Path("path/to/your/system/folder")
51
+ # Define the paths to the model kernel binaries
52
+ sfincs_bin = Path("path/to/your/sfincs/bin.exe")
53
+ fiat_bin = Path("path/to/your/fiat/bin.exe")
53
54
 
54
55
  # Validate and set environment variables
55
56
  Settings(
56
57
  DATABASE_ROOT=root,
57
58
  DATABASE_NAME=name,
58
- SYSTEM_FOLDER=system_folder,
59
+ SFINCS_BIN_PATH=sfincs_bin,
60
+ FIAT_BIN_PATH=fiat_path,
61
+ VALIDATE_BINARIES=True,
59
62
  )
60
63
  ```
61
64
 
@@ -1,5 +1,5 @@
1
1
  # has to be here at the start to avoid circular imports
2
- __version__ = "0.3.8"
2
+ __version__ = "0.3.9"
3
3
 
4
4
  from flood_adapt import adapter, dbs_classes, objects
5
5
  from flood_adapt.config.config import Settings
@@ -85,7 +85,7 @@ class FiatAdapter(IImpactAdapter):
85
85
  # TODO deal with all the relative paths for the files used
86
86
  # TODO IImpactAdapter and general Adapter class should NOT use the database
87
87
 
88
- _model: FiatModel # hydroMT-FIAT model
88
+ _model: Optional[FiatModel] = None
89
89
  config: Optional[FiatConfigModel] = None
90
90
  exe_path: Optional[os.PathLike] = None
91
91
  fiat_columns: FiatColumns
@@ -106,20 +106,27 @@ class FiatAdapter(IImpactAdapter):
106
106
  self.config_base_path = config_base_path
107
107
  self.exe_path = exe_path
108
108
  self.delete_crashed_runs = delete_crashed_runs
109
- self._model = FiatModel(root=str(model_root.resolve()), mode="r")
110
- self._model.read()
109
+ self._model_root = str(model_root.resolve())
111
110
  self.fiat_columns = _FIAT_COLUMNS
112
111
  self.impact_columns = _IMPACT_COLUMNS # columns of FA impact output
113
112
 
113
+ @property
114
+ def model(self) -> FiatModel:
115
+ """Lazily load and cache the FiatModel."""
116
+ if self._model is None:
117
+ self._model = FiatModel(root=self._model_root, mode="r")
118
+ self._model.read()
119
+ return self._model
120
+
114
121
  @property
115
122
  def model_root(self):
116
- return Path(self._model.root)
123
+ return Path(self.model.root)
117
124
 
118
125
  @property
119
126
  def damage_types(self):
120
127
  """Get the damage types that are present in the exposure."""
121
128
  types = []
122
- for col in self._model.exposure.exposure_db.columns:
129
+ for col in self.model.exposure.exposure_db.columns:
123
130
  if matches_pattern(col, self.fiat_columns.damage_function):
124
131
  name = extract_variables(col, self.fiat_columns.damage_function)["name"]
125
132
  types.append(name)
@@ -127,9 +134,9 @@ class FiatAdapter(IImpactAdapter):
127
134
 
128
135
  def read(self, path: Path) -> None:
129
136
  """Read the fiat model from the current model root."""
130
- if Path(self._model.root).resolve() != Path(path).resolve():
131
- self._model.set_root(root=str(path), mode="r")
132
- self._model.read()
137
+ if Path(self.model.root).resolve() != Path(path).resolve():
138
+ self.model.set_root(root=str(path), mode="r")
139
+ self.model.read()
133
140
 
134
141
  def write(self, path_out: Union[str, os.PathLike], overwrite: bool = True) -> None:
135
142
  """Write the fiat model configuration to a directory."""
@@ -141,8 +148,8 @@ class FiatAdapter(IImpactAdapter):
141
148
 
142
149
  write_mode = "w+" if overwrite else "w"
143
150
  with cd(path_out):
144
- self._model.set_root(root=str(path_out), mode=write_mode)
145
- self._model.write()
151
+ self.model.set_root(root=str(path_out), mode=write_mode)
152
+ self.model.write()
146
153
 
147
154
  def close_files(self):
148
155
  """Close all open files and clean up file handles."""
@@ -206,7 +213,7 @@ class FiatAdapter(IImpactAdapter):
206
213
  True if fiat has run, False if something went wrong
207
214
  """
208
215
  log_file = self.model_root.joinpath(
209
- self._model.config["output"]["path"], "fiat.log"
216
+ self.model.config["output"]["path"], "fiat.log"
210
217
  )
211
218
  if not log_file.exists():
212
219
  return False
@@ -365,13 +372,13 @@ class FiatAdapter(IImpactAdapter):
365
372
  The contents of the output CSV file.
366
373
  """
367
374
  # Get output path
368
- outputs_path = self.model_root.joinpath(self._model.config["output"]["path"])
375
+ outputs_path = self.model_root.joinpath(self.model.config["output"]["path"])
369
376
 
370
377
  # Get all csvs and concatenate them in a single table
371
378
  csv_outputs_df = []
372
- for output_csv in self._model.config["output"]["csv"]:
379
+ for output_csv in self.model.config["output"]["csv"]:
373
380
  csv_path = outputs_path.joinpath(
374
- self._model.config["output"]["csv"][output_csv]
381
+ self.model.config["output"]["csv"][output_csv]
375
382
  )
376
383
  output_csv_df = pd.read_csv(csv_path)
377
384
  csv_outputs_df.append(output_csv_df)
@@ -700,9 +707,9 @@ class FiatAdapter(IImpactAdapter):
700
707
  self.logger.info(f"Setting hazard to the {map_type} map {map_fn}")
701
708
  # Add the floodmap data to a data catalog with the unit conversion
702
709
  wl_current_units = us.UnitfulLength(value=1.0, units=units)
703
- conversion_factor = wl_current_units.convert(self._model.exposure.unit)
710
+ conversion_factor = wl_current_units.convert(self.model.exposure.unit)
704
711
 
705
- self._model.setup_hazard(
712
+ self.model.setup_hazard(
706
713
  map_fn=map_fn,
707
714
  map_type=map_type,
708
715
  rp=None,
@@ -737,29 +744,29 @@ class FiatAdapter(IImpactAdapter):
737
744
  # Get columns that include max damage
738
745
  damage_cols = [
739
746
  c
740
- for c in self._model.exposure.exposure_db.columns
747
+ for c in self.model.exposure.exposure_db.columns
741
748
  if matches_pattern(c, self.fiat_columns.max_potential_damage)
742
749
  ]
743
750
 
744
751
  # Get objects that are buildings (using site info)
745
- buildings_rows = ~self._model.exposure.exposure_db[
752
+ buildings_rows = ~self.model.exposure.exposure_db[
746
753
  self.fiat_columns.primary_object_type
747
754
  ].isin(self.config.non_building_names)
748
755
 
749
756
  # If ids are given use that as an additional filter
750
757
  if ids:
751
- buildings_rows = buildings_rows & self._model.exposure.exposure_db[
758
+ buildings_rows = buildings_rows & self.model.exposure.exposure_db[
752
759
  self.fiat_columns.object_id
753
760
  ].isin(ids)
754
761
 
755
762
  # Update columns using economic growth value
756
- updated_max_pot_damage = self._model.exposure.exposure_db.copy()
763
+ updated_max_pot_damage = self.model.exposure.exposure_db.copy()
757
764
  updated_max_pot_damage.loc[buildings_rows, damage_cols] *= (
758
765
  1.0 + economic_growth / 100.0
759
766
  )
760
767
 
761
768
  # update fiat model
762
- self._model.exposure.update_max_potential_damage(
769
+ self.model.exposure.update_max_potential_damage(
763
770
  updated_max_potential_damages=updated_max_pot_damage
764
771
  )
765
772
 
@@ -784,29 +791,29 @@ class FiatAdapter(IImpactAdapter):
784
791
  # Get columns that include max damage
785
792
  damage_cols = [
786
793
  c
787
- for c in self._model.exposure.exposure_db.columns
794
+ for c in self.model.exposure.exposure_db.columns
788
795
  if matches_pattern(c, self.fiat_columns.max_potential_damage)
789
796
  ]
790
797
 
791
798
  # Get objects that are buildings (using site info)
792
- buildings_rows = ~self._model.exposure.exposure_db[
799
+ buildings_rows = ~self.model.exposure.exposure_db[
793
800
  self.fiat_columns.primary_object_type
794
801
  ].isin(self.config.non_building_names)
795
802
 
796
803
  # If ids are given use that as an additional filter
797
804
  if ids:
798
- buildings_rows = buildings_rows & self._model.exposure.exposure_db[
805
+ buildings_rows = buildings_rows & self.model.exposure.exposure_db[
799
806
  self.fiat_columns.object_id
800
807
  ].isin(ids)
801
808
 
802
809
  # Update columns using economic growth value
803
- updated_max_pot_damage = self._model.exposure.exposure_db.copy()
810
+ updated_max_pot_damage = self.model.exposure.exposure_db.copy()
804
811
  updated_max_pot_damage.loc[buildings_rows, damage_cols] *= (
805
812
  1.0 + population_growth / 100.0
806
813
  )
807
814
 
808
815
  # update fiat model
809
- self._model.exposure.update_max_potential_damage(
816
+ self.model.exposure.update_max_potential_damage(
810
817
  updated_max_potential_damages=updated_max_pot_damage
811
818
  )
812
819
 
@@ -841,7 +848,7 @@ class FiatAdapter(IImpactAdapter):
841
848
  If `elevation_type` is not 'floodmap' or 'datum'.
842
849
  """
843
850
  self.logger.info(
844
- f"Applying population growth of {population_growth} %, by creating a new development area using the geometries from {area_path} and a ground floor height of {ground_floor_height} {self._model.exposure.unit} above '{elevation_type}'."
851
+ f"Applying population growth of {population_growth} %, by creating a new development area using the geometries from {area_path} and a ground floor height of {ground_floor_height} {self.model.exposure.unit} above '{elevation_type}'."
845
852
  )
846
853
  # Get reference type to align with hydromt
847
854
  if elevation_type == "floodmap":
@@ -870,12 +877,12 @@ class FiatAdapter(IImpactAdapter):
870
877
  ]
871
878
  new_dev_geom_name = Path(self.config.new_development_file_name).stem
872
879
  # Use hydromt function
873
- self._model.exposure.setup_new_composite_areas(
880
+ self.model.exposure.setup_new_composite_areas(
874
881
  percent_growth=population_growth,
875
882
  geom_file=Path(area_path),
876
883
  ground_floor_height=ground_floor_height,
877
884
  damage_types=self.damage_types,
878
- vulnerability=self._model.vulnerability,
885
+ vulnerability=self.model.vulnerability,
879
886
  ground_elevation=ground_elevation,
880
887
  aggregation_area_fn=aggregation_areas,
881
888
  attribute_names=attribute_names,
@@ -944,7 +951,7 @@ class FiatAdapter(IImpactAdapter):
944
951
  path_ref = self.config_base_path.joinpath(self.config.bfe.geom)
945
952
  height_reference = "geom"
946
953
  # Use hydromt function
947
- self._model.exposure.raise_ground_floor_height(
954
+ self.model.exposure.raise_ground_floor_height(
948
955
  raise_by=elevate.elevation.value,
949
956
  objectids=objectids,
950
957
  height_reference=height_reference,
@@ -954,7 +961,7 @@ class FiatAdapter(IImpactAdapter):
954
961
 
955
962
  elif elevate.elevation.type == "datum":
956
963
  # Use hydromt function
957
- self._model.exposure.raise_ground_floor_height(
964
+ self.model.exposure.raise_ground_floor_height(
958
965
  raise_by=elevate.elevation.value,
959
966
  objectids=objectids,
960
967
  height_reference="datum",
@@ -979,30 +986,28 @@ class FiatAdapter(IImpactAdapter):
979
986
  # Get columns that include max damage
980
987
  damage_cols = [
981
988
  c
982
- for c in self._model.exposure.exposure_db.columns
989
+ for c in self.model.exposure.exposure_db.columns
983
990
  if matches_pattern(c, self.fiat_columns.max_potential_damage)
984
991
  ]
985
992
 
986
993
  # Get objects that are buildings (using site info)
987
- buildings_rows = ~self._model.exposure.exposure_db[
994
+ buildings_rows = ~self.model.exposure.exposure_db[
988
995
  self.fiat_columns.primary_object_type
989
996
  ].isin(self.config.non_building_names)
990
997
 
991
998
  # Get rows that are affected
992
999
  objectids = self.get_object_ids(buyout)
993
1000
  rows = (
994
- self._model.exposure.exposure_db[self.fiat_columns.object_id].isin(
995
- objectids
996
- )
1001
+ self.model.exposure.exposure_db[self.fiat_columns.object_id].isin(objectids)
997
1002
  & buildings_rows
998
1003
  )
999
1004
 
1000
1005
  # Update columns
1001
- updated_max_pot_damage = self._model.exposure.exposure_db.copy()
1006
+ updated_max_pot_damage = self.model.exposure.exposure_db.copy()
1002
1007
  updated_max_pot_damage.loc[rows, damage_cols] *= 0
1003
1008
 
1004
1009
  # update fiat model
1005
- self._model.exposure.update_max_potential_damage(
1010
+ self.model.exposure.update_max_potential_damage(
1006
1011
  updated_max_potential_damages=updated_max_pot_damage
1007
1012
  )
1008
1013
 
@@ -1023,11 +1028,11 @@ class FiatAdapter(IImpactAdapter):
1023
1028
  objectids = self.get_object_ids(floodproof)
1024
1029
 
1025
1030
  # Use hydromt function
1026
- self._model.exposure.truncate_damage_function(
1031
+ self.model.exposure.truncate_damage_function(
1027
1032
  objectids=objectids,
1028
1033
  floodproof_to=floodproof.elevation.value,
1029
1034
  damage_function_types=self.damage_types,
1030
- vulnerability=self._model.vulnerability,
1035
+ vulnerability=self.model.vulnerability,
1031
1036
  )
1032
1037
 
1033
1038
  # STATIC METHODS
@@ -1046,11 +1051,11 @@ class FiatAdapter(IImpactAdapter):
1046
1051
  ValueError
1047
1052
  If the FIAT model does not have an exposure database initialized.
1048
1053
  """
1049
- if self._model.exposure is None:
1054
+ if self.model.exposure is None:
1050
1055
  raise ValueError(
1051
1056
  "FIAT model does not have exposure, make sure your model has been initialized."
1052
1057
  )
1053
- gdf_0 = self._model.exposure.select_objects(
1058
+ gdf_0 = self.model.exposure.select_objects(
1054
1059
  primary_object_type="ALL",
1055
1060
  non_building_names=self.config.non_building_names,
1056
1061
  return_gdf=True,
@@ -1081,7 +1086,7 @@ class FiatAdapter(IImpactAdapter):
1081
1086
  ValueError
1082
1087
  If no property types are found in the FIAT model.
1083
1088
  """
1084
- types = self._model.exposure.get_primary_object_type()
1089
+ types = self.model.exposure.get_primary_object_type()
1085
1090
  if types is None:
1086
1091
  raise ValueError("No property types found in the FIAT model.")
1087
1092
  types.append("all") # Add "all" type for using as identifier
@@ -1104,7 +1109,7 @@ class FiatAdapter(IImpactAdapter):
1104
1109
  A list of IDs for all buildings in the FIAT model.
1105
1110
  """
1106
1111
  # Get ids of existing buildings
1107
- ids = self._model.exposure.get_object_ids(
1112
+ ids = self.model.exposure.get_object_ids(
1108
1113
  "all", non_building_names=self.config.non_building_names
1109
1114
  )
1110
1115
  return ids
@@ -1145,7 +1150,7 @@ class FiatAdapter(IImpactAdapter):
1145
1150
  polygon_file = None
1146
1151
 
1147
1152
  # use the hydromt-fiat method to the ids
1148
- ids = self._model.exposure.get_object_ids(
1153
+ ids = self.model.exposure.get_object_ids(
1149
1154
  selection_type=measure.selection_type,
1150
1155
  property_type=measure.property_type,
1151
1156
  non_building_names=self.config.non_building_names,
@@ -1407,7 +1412,7 @@ class FiatAdapter(IImpactAdapter):
1407
1412
  self.logger.info("Calculating impacts at a building footprint scale")
1408
1413
 
1409
1414
  # Read the existing building points
1410
- buildings = self._model.exposure.select_objects(
1415
+ buildings = self.model.exposure.select_objects(
1411
1416
  primary_object_type="ALL",
1412
1417
  non_building_names=self.config.non_building_names,
1413
1418
  return_gdf=True,
@@ -200,7 +200,7 @@ class SfincsAdapter(IHazardAdapter):
200
200
  with cd(path):
201
201
  self.logger.info(f"Running SFINCS in {path}")
202
202
  process = subprocess.run(
203
- str(Settings().sfincs_path),
203
+ str(Settings().sfincs_bin_path),
204
204
  stdout=subprocess.PIPE,
205
205
  stderr=subprocess.PIPE,
206
206
  text=True,
@@ -1840,7 +1840,9 @@ class SfincsAdapter(IHazardAdapter):
1840
1840
  waterlevel = df_gauge.iloc[:, 0] + gauge_reference_height
1841
1841
 
1842
1842
  # If data is available, add to plot
1843
- fig.add_trace(px.line(waterlevel, color="#ea6404"))
1843
+ fig.add_trace(
1844
+ px.line(waterlevel, color_discrete_sequence=["#ea6404"]).data[0]
1845
+ )
1844
1846
  fig["data"][0]["name"] = "model"
1845
1847
  fig["data"][1]["name"] = "measurement"
1846
1848
  fig.update_layout(showlegend=True)
@@ -1,6 +1,6 @@
1
1
  from os import environ, listdir
2
2
  from pathlib import Path
3
- from platform import system
3
+ from typing import Optional
4
4
 
5
5
  import tomli
6
6
  import tomli_w
@@ -12,48 +12,6 @@ from pydantic import (
12
12
  )
13
13
  from pydantic_settings import BaseSettings, SettingsConfigDict
14
14
 
15
- DEFAULT_SYSTEM_FOLDER = Path(__file__).parents[1] / "system"
16
- DEFAULT_EXE_PATHS: dict[str, dict[str, Path]] = {
17
- "windows": {
18
- "sfincs": DEFAULT_SYSTEM_FOLDER / "win-64" / "sfincs" / "sfincs.exe",
19
- "fiat": DEFAULT_SYSTEM_FOLDER / "win-64" / "fiat" / "fiat.exe",
20
- },
21
- "linux": {
22
- "sfincs": DEFAULT_SYSTEM_FOLDER / "linux-64" / "sfincs" / "bin" / "sfincs",
23
- "fiat": DEFAULT_SYSTEM_FOLDER / "linux-64" / "fiat" / "fiat",
24
- },
25
- }
26
-
27
-
28
- def _default_exe_path(exe_name: str) -> Path:
29
- """
30
- Get the default path for the given executable name based on the system type.
31
-
32
- Parameters
33
- ----------
34
- exe_name : str
35
- The name of the executable (e.g., "sfincs", "fiat").
36
-
37
- Returns
38
- -------
39
- Path
40
- The default path to the executable.
41
-
42
- Raises
43
- ------
44
- ValueError
45
- If the system type is not recognized.
46
- """
47
- if system().lower() not in DEFAULT_EXE_PATHS:
48
- raise ValueError(
49
- f"System type '{system()}' is not recognized. Supported types are: {', '.join(DEFAULT_EXE_PATHS.keys())}."
50
- )
51
- if exe_name not in DEFAULT_EXE_PATHS[system().lower()]:
52
- raise ValueError(
53
- f"Executable name '{exe_name}' is not recognized. Supported names are: {', '.join(DEFAULT_EXE_PATHS[system().lower()].keys())}."
54
- )
55
- return DEFAULT_EXE_PATHS[system().lower()][exe_name]
56
-
57
15
 
58
16
  class Settings(BaseSettings):
59
17
  """
@@ -82,19 +40,19 @@ class Settings(BaseSettings):
82
40
  Attributes
83
41
  ----------
84
42
  database_name : str
85
- The name of the database.
43
+ The name of the database. Alias: `DATABASE_NAME` (environment variable).
86
44
  database_root : Path
87
- The root directory of the database.
45
+ The root directory of the database. Alias: `DATABASE_ROOT` (environment variable).
88
46
  delete_crashed_runs : bool
89
- Whether to delete crashed/corrupted runs immediately after they are detected.
90
- sfincs_path : Path
91
- The path to the SFINCS binary.
92
- fiat_path : Path
93
- The path to the FIAT binary.
47
+ Whether to delete crashed/corrupted runs immediately after they are detected. Alias: `DELETE_CRASHED_RUNS` (environment variable).
94
48
  validate_allowed_forcings : bool
95
- Whether to validate the forcing types and sources against the allowed forcings in the event model.
96
- validate_bin_paths : bool
97
- Whether to validate the existence of the paths to the SFINCS and FIAT binaries.
49
+ Whether to validate the forcing types and sources against the allowed forcings in the event model. Alias: `VALIDATE_ALLOWED_FORCINGS` (environment variable).
50
+ validate_binaries : bool
51
+ Whether to validate the existence of the paths to the SFINCS and FIAT binaries. Alias: `VALIDATE_BINARIES` (environment variable).
52
+ sfincs_bin_path : Path
53
+ The path to the SFINCS binary. Alias: `SFINCS_BIN_PATH` (environment variable).
54
+ fiat_bin_path : Path
55
+ The path to the FIAT binary. Alias: `FIAT_BIN_PATH` (environment variable).
98
56
 
99
57
  Properties
100
58
  ----------
@@ -133,22 +91,22 @@ class Settings(BaseSettings):
133
91
  description="Whether to validate the forcing types and sources against the allowed forcings in the event model.",
134
92
  exclude=True,
135
93
  )
136
- validate_bin_paths: bool = Field(
94
+ validate_binaries: bool = Field(
137
95
  alias="VALIDATE_BINARIES", # environment variable: VALIDATE_BINARIES
138
96
  default=False,
139
97
  description="Whether to validate the existence of the paths to the SFINCS and FIAT binaries.",
140
98
  exclude=True,
141
99
  )
142
100
 
143
- sfincs_path: Path = Field(
144
- default=_default_exe_path("sfincs"),
101
+ sfincs_bin_path: Optional[Path] = Field(
102
+ default=None,
145
103
  alias="SFINCS_BIN_PATH", # environment variable: SFINCS_BIN_PATH
146
104
  description="The path of the sfincs binary.",
147
105
  exclude=True,
148
106
  )
149
107
 
150
- fiat_path: Path = Field(
151
- default=_default_exe_path("fiat"),
108
+ fiat_bin_path: Optional[Path] = Field(
109
+ default=None,
152
110
  alias="FIAT_BIN_PATH", # environment variable: FIAT_BIN_PATH
153
111
  description="The path of the fiat binary.",
154
112
  exclude=True,
@@ -162,7 +120,7 @@ class Settings(BaseSettings):
162
120
  @model_validator(mode="after")
163
121
  def validate_settings(self):
164
122
  self._validate_database_path()
165
- if self.validate_bin_paths:
123
+ if self.validate_binaries:
166
124
  self._validate_fiat_path()
167
125
  self._validate_sfincs_path()
168
126
  self._update_environment_variables()
@@ -171,21 +129,21 @@ class Settings(BaseSettings):
171
129
  def _update_environment_variables(self):
172
130
  environ["DATABASE_ROOT"] = str(self.database_root)
173
131
  environ["DATABASE_NAME"] = self.database_name
174
- environ["SFINCS_BIN_PATH"] = str(self.sfincs_path)
175
- environ["FIAT_BIN_PATH"] = str(self.fiat_path)
176
- environ["SFINCS_PATH"] = str(self.sfincs_path)
177
- environ["FIAT_PATH"] = str(self.fiat_path)
178
132
 
179
133
  if self.delete_crashed_runs:
180
134
  environ["DELETE_CRASHED_RUNS"] = str(self.delete_crashed_runs)
181
135
  else:
182
136
  environ.pop("DELETE_CRASHED_RUNS", None)
137
+
183
138
  if self.validate_allowed_forcings:
184
139
  environ["VALIDATE_ALLOWED_FORCINGS"] = str(self.validate_allowed_forcings)
185
140
  else:
186
141
  environ.pop("VALIDATE_ALLOWED_FORCINGS", None)
187
- if self.validate_bin_paths:
188
- environ["VALIDATE_BINARIES"] = str(self.validate_bin_paths)
142
+
143
+ if self.validate_binaries:
144
+ environ["VALIDATE_BINARIES"] = str(self.validate_binaries)
145
+ environ["SFINCS_BIN_PATH"] = str(self.sfincs_bin_path)
146
+ environ["FIAT_BIN_PATH"] = str(self.fiat_bin_path)
189
147
  else:
190
148
  environ.pop("VALIDATE_BINARIES", None)
191
149
 
@@ -224,13 +182,13 @@ class Settings(BaseSettings):
224
182
  return self
225
183
 
226
184
  def _validate_sfincs_path(self):
227
- if not self.sfincs_path.exists():
228
- raise ValueError(f"SFINCS binary {self.sfincs_path} does not exist.")
185
+ if not self.sfincs_bin_path.exists():
186
+ raise ValueError(f"SFINCS binary {self.sfincs_bin_path} does not exist.")
229
187
  return self
230
188
 
231
189
  def _validate_fiat_path(self):
232
- if not self.fiat_path.exists():
233
- raise ValueError(f"FIAT binary {self.fiat_path} does not exist.")
190
+ if not self.fiat_bin_path.exists():
191
+ raise ValueError(f"FIAT binary {self.fiat_bin_path} does not exist.")
234
192
  return self
235
193
 
236
194
  @field_serializer("database_root", "database_path")
@@ -284,7 +242,7 @@ class Settings(BaseSettings):
284
242
  tomli_w.dump(
285
243
  self.model_dump(
286
244
  by_alias=True,
287
- exclude={"sfincs_path", "fiat_path", "database_path"},
245
+ exclude={"sfincs_bin_path", "fiat_bin_path", "database_path"},
288
246
  ),
289
247
  f,
290
248
  )
@@ -1280,9 +1280,9 @@ class DatabaseBuilder:
1280
1280
  relative_to_year=self.config.slr_scenarios.relative_to_year,
1281
1281
  )
1282
1282
 
1283
- def create_observation_points(self) -> list[ObsPointModel]:
1283
+ def create_observation_points(self) -> Union[list[ObsPointModel], None]:
1284
1284
  if self.config.obs_point is None:
1285
- return []
1285
+ return None
1286
1286
 
1287
1287
  self.logger.info("Observation points were provided in the config file.")
1288
1288
  return self.config.obs_point
@@ -335,7 +335,7 @@ class Database(IDatabase):
335
335
  benefit : Benefit
336
336
  """
337
337
  runner = BenefitRunner(self, benefit=benefit)
338
- return runner.check_scenarios()
338
+ return runner.scenarios
339
339
 
340
340
  def create_benefit_scenarios(self, benefit: Benefit) -> None:
341
341
  """Create any scenarios that are needed for the (cost-)benefit assessment and are not there already.
@@ -345,7 +345,6 @@ class Database(IDatabase):
345
345
  benefit : Benefit
346
346
  """
347
347
  runner = BenefitRunner(self, benefit=benefit)
348
- runner.check_scenarios()
349
348
 
350
349
  # Iterate through the scenarios needed and create them if not existing
351
350
  for index, row in runner.scenarios.iterrows():
@@ -368,9 +367,6 @@ class Database(IDatabase):
368
367
  raise e
369
368
  # otherwise, if it already exists and we dont need to save it, we can just continue
370
369
 
371
- # Update the scenarios check
372
- runner.check_scenarios()
373
-
374
370
  def run_benefit(self, benefit_name: Union[str, list[str]]) -> None:
375
371
  """Run a (cost-)benefit analysis.
376
372
 
@@ -78,7 +78,7 @@ class DbsScenario(DbsTemplate[Scenario]):
78
78
  used_in_benefit = []
79
79
  for benefit in benefits:
80
80
  runner = BenefitRunner(database=self._database, benefit=benefit)
81
- scenarios = runner.check_scenarios()["scenario created"].to_list()
81
+ scenarios = runner.scenarios["scenario created"].to_list()
82
82
  for scenario in scenarios:
83
83
  if name == scenario:
84
84
  used_in_benefit.append(benefit.name)
@@ -253,7 +253,7 @@ class DbsStatic(IDbsStatic):
253
253
  with FiatAdapter(
254
254
  model_root=template_path,
255
255
  config=self._database.site.fiat.config,
256
- exe_path=Settings().fiat_path,
256
+ exe_path=Settings().fiat_bin_path,
257
257
  delete_crashed_runs=Settings().delete_crashed_runs,
258
258
  config_base_path=self._database.static_path,
259
259
  ) as fm: