flood-adapt 1.1.0__tar.gz → 1.1.1__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 (129) hide show
  1. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/PKG-INFO +10 -123
  2. flood_adapt-1.1.1/README.md +19 -0
  3. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/__init__.py +1 -1
  4. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/adapter/fiat_adapter.py +7 -7
  5. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/adapter/sfincs_adapter.py +13 -7
  6. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/config/hazard.py +1 -1
  7. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/dbs_classes/database.py +3 -3
  8. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/dbs_classes/dbs_static.py +2 -2
  9. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/flood_adapt.py +3 -3
  10. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/misc/utils.py +29 -10
  11. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/objects/forcing/plotting.py +4 -4
  12. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/objects/measures/measures.py +3 -1
  13. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/workflows/benefit_runner.py +3 -2
  14. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt.egg-info/PKG-INFO +10 -123
  15. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt.egg-info/requires.txt +6 -9
  16. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/pyproject.toml +22 -34
  17. flood_adapt-1.1.0/README.md +0 -130
  18. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/LICENSE +0 -0
  19. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/adapter/__init__.py +0 -0
  20. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/adapter/interface/__init__.py +0 -0
  21. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/adapter/interface/hazard_adapter.py +0 -0
  22. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/adapter/interface/impact_adapter.py +0 -0
  23. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/adapter/interface/model_adapter.py +0 -0
  24. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/adapter/interface/offshore.py +0 -0
  25. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/adapter/sfincs_offshore.py +0 -0
  26. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/config/__init__.py +0 -0
  27. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/config/config.py +0 -0
  28. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/config/fiat.py +0 -0
  29. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/config/gui.py +0 -0
  30. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/config/impacts.py +0 -0
  31. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/config/sfincs.py +0 -0
  32. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/config/site.py +0 -0
  33. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/database_builder/__init__.py +0 -0
  34. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/database_builder/database_builder.py +0 -0
  35. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/database_builder/metrics_utils.py +0 -0
  36. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/database_builder/templates/default_units/imperial.toml +0 -0
  37. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/database_builder/templates/default_units/metric.toml +0 -0
  38. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/database_builder/templates/green_infra_table/green_infra_lookup_table.csv +0 -0
  39. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/database_builder/templates/icons/black_down_48x48.png +0 -0
  40. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/database_builder/templates/icons/black_left_48x48.png +0 -0
  41. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/database_builder/templates/icons/black_right_48x48.png +0 -0
  42. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/database_builder/templates/icons/black_up_48x48.png +0 -0
  43. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/database_builder/templates/icons/icons8-triangle-arrow-16_white_down.png +0 -0
  44. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/database_builder/templates/icons/icons8-triangle-arrow-16_white_left.png +0 -0
  45. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/database_builder/templates/icons/icons8-triangle-arrow-16_white_right.png +0 -0
  46. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/database_builder/templates/icons/icons8-triangle-arrow-16_white_up.png +0 -0
  47. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/database_builder/templates/icons/icons8-triangle-arrow-24_black_down.png +0 -0
  48. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/database_builder/templates/icons/icons8-triangle-arrow-24_black_left.png +0 -0
  49. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/database_builder/templates/icons/icons8-triangle-arrow-24_black_right.png +0 -0
  50. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/database_builder/templates/icons/icons8-triangle-arrow-24_black_up.png +0 -0
  51. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/database_builder/templates/icons/icons8-triangle-arrow-24_white_left.png +0 -0
  52. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/database_builder/templates/icons/icons8-triangle-arrow-24_white_right.png +0 -0
  53. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/database_builder/templates/icons/white_down_48x48.png +0 -0
  54. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/database_builder/templates/icons/white_left_48x48.png +0 -0
  55. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/database_builder/templates/icons/white_right_48x48.png +0 -0
  56. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/database_builder/templates/icons/white_up_48x48.png +0 -0
  57. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/database_builder/templates/infographics/images/ambulance.png +0 -0
  58. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/database_builder/templates/infographics/images/car.png +0 -0
  59. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/database_builder/templates/infographics/images/cart.png +0 -0
  60. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/database_builder/templates/infographics/images/firetruck.png +0 -0
  61. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/database_builder/templates/infographics/images/hospital.png +0 -0
  62. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/database_builder/templates/infographics/images/house.png +0 -0
  63. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/database_builder/templates/infographics/images/info.png +0 -0
  64. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/database_builder/templates/infographics/images/money.png +0 -0
  65. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/database_builder/templates/infographics/images/person.png +0 -0
  66. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/database_builder/templates/infographics/images/school.png +0 -0
  67. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/database_builder/templates/infographics/images/truck.png +0 -0
  68. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/database_builder/templates/infographics/images/walking_person.png +0 -0
  69. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/database_builder/templates/infographics/styles.css +0 -0
  70. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/database_builder/templates/output_layers/bin_colors.toml +0 -0
  71. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/dbs_classes/__init__.py +0 -0
  72. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/dbs_classes/dbs_benefit.py +0 -0
  73. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/dbs_classes/dbs_event.py +0 -0
  74. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/dbs_classes/dbs_measure.py +0 -0
  75. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/dbs_classes/dbs_projection.py +0 -0
  76. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/dbs_classes/dbs_scenario.py +0 -0
  77. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/dbs_classes/dbs_strategy.py +0 -0
  78. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/dbs_classes/dbs_template.py +0 -0
  79. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/dbs_classes/interface/database.py +0 -0
  80. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/dbs_classes/interface/element.py +0 -0
  81. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/dbs_classes/interface/static.py +0 -0
  82. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/misc/__init__.py +0 -0
  83. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/misc/database_user.py +0 -0
  84. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/misc/debug_timer.py +0 -0
  85. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/misc/exceptions.py +0 -0
  86. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/misc/log.py +0 -0
  87. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/misc/path_builder.py +0 -0
  88. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/objects/__init__.py +0 -0
  89. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/objects/benefits/__init__.py +0 -0
  90. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/objects/benefits/benefits.py +0 -0
  91. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/objects/events/__init__.py +0 -0
  92. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/objects/events/event_factory.py +0 -0
  93. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/objects/events/event_set.py +0 -0
  94. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/objects/events/events.py +0 -0
  95. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/objects/events/historical.py +0 -0
  96. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/objects/events/hurricane.py +0 -0
  97. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/objects/events/synthetic.py +0 -0
  98. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/objects/forcing/__init__.py +0 -0
  99. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/objects/forcing/csv.py +0 -0
  100. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/objects/forcing/discharge.py +0 -0
  101. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/objects/forcing/forcing.py +0 -0
  102. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/objects/forcing/forcing_factory.py +0 -0
  103. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/objects/forcing/meteo_handler.py +0 -0
  104. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/objects/forcing/netcdf.py +0 -0
  105. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/objects/forcing/rainfall.py +0 -0
  106. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/objects/forcing/tide_gauge.py +0 -0
  107. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/objects/forcing/time_frame.py +0 -0
  108. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/objects/forcing/timeseries.py +0 -0
  109. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/objects/forcing/unit_system.py +0 -0
  110. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/objects/forcing/waterlevels.py +0 -0
  111. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/objects/forcing/wind.py +0 -0
  112. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/objects/measures/__init__.py +0 -0
  113. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/objects/measures/measure_factory.py +0 -0
  114. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/objects/object_model.py +0 -0
  115. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/objects/output/floodmap.py +0 -0
  116. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/objects/projections/__init__.py +0 -0
  117. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/objects/projections/projections.py +0 -0
  118. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/objects/scenarios/__init__.py +0 -0
  119. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/objects/scenarios/scenarios.py +0 -0
  120. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/objects/strategies/__init__.py +0 -0
  121. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/objects/strategies/strategies.py +0 -0
  122. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/workflows/__init__.py +0 -0
  123. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt/workflows/scenario_runner.py +0 -0
  124. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt.egg-info/SOURCES.txt +0 -0
  125. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt.egg-info/dependency_links.txt +0 -0
  126. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt.egg-info/not-zip-safe +0 -0
  127. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/flood_adapt.egg-info/top_level.txt +0 -0
  128. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/setup.cfg +0 -0
  129. {flood_adapt-1.1.0 → flood_adapt-1.1.1}/tests/test_flood_adapt.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: flood-adapt
3
- Version: 1.1.0
3
+ Version: 1.1.1
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: ====================================================
@@ -705,21 +705,21 @@ Project-URL: Source, https://github.com/Deltares-research/FloodAdapt
705
705
  Classifier: Intended Audience :: Science/Research
706
706
  Classifier: License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
707
707
  Classifier: Topic :: Scientific/Engineering :: Hydrology
708
- Requires-Python: <3.13,>=3.8
708
+ Requires-Python: <3.13,>=3.10
709
709
  Description-Content-Type: text/markdown
710
710
  License-File: LICENSE
711
- Requires-Dist: cht-cyclones==1.0.3
712
- Requires-Dist: cht-meteo==0.3.1
713
- Requires-Dist: cht-observations==0.2.1
714
- Requires-Dist: cht-tide==0.1.1
711
+ Requires-Dist: cht-cyclones<2.0,>=1.0.3
712
+ Requires-Dist: cht-meteo<1.0,>=0.3.1
713
+ Requires-Dist: cht-observations<1.0,>=0.2.1
714
+ Requires-Dist: cht-tide<1.0,>=0.1.1
715
715
  Requires-Dist: dask==2024.11.2
716
716
  Requires-Dist: numba_celltree==0.2.2
717
717
  Requires-Dist: fiat-toolbox<0.2.0,>=0.1.22
718
718
  Requires-Dist: fiona<2.0,>=1.0
719
719
  Requires-Dist: geojson<4.0,>=3.0
720
720
  Requires-Dist: geopandas<2.0,>=1.0
721
- Requires-Dist: hydromt-fiat==0.5.5
722
- Requires-Dist: hydromt-sfincs==1.2.0
721
+ Requires-Dist: hydromt-fiat<1.0,>=0.5.9
722
+ Requires-Dist: hydromt-sfincs<2.0,>=1.2.0
723
723
  Requires-Dist: numpy<2.0,>=1.0
724
724
  Requires-Dist: numpy-financial<2.0,>=1.0
725
725
  Requires-Dist: pandas<3.0,>=2.0
@@ -755,8 +755,6 @@ Requires-Dist: python-dotenv<2.0,>=1.0; extra == "docs"
755
755
  Requires-Dist: folium<1.0,>=0.19.0; extra == "docs"
756
756
  Requires-Dist: mapclassify<3.0,>=2.8.0; extra == "docs"
757
757
  Requires-Dist: contextily; extra == "docs"
758
- Provides-Extra: all
759
- Requires-Dist: flood-adapt[build,dev,docs]; extra == "all"
760
758
 
761
759
  # FloodAdapt
762
760
  FloodAdapt is a decision-support tool that seeks to advance and accelerate flooding-related adaptation planning. It brings rapid, physics-based compound flood and detailed impact modelling into an easy-to-use system, allowing non-expert end-users to evaluate a wide variety of compound events, future conditions, and adaptation options in minutes. FloodAdapt serves as a connector between scientific advances and practitioner needs, improving and increasing the uptake and impact of adaptation research and development.
@@ -774,117 +772,6 @@ Recent developments of the decision-support system include (1) simplifying and p
774
772
 
775
773
  FloodAdapt is currently in an intensive development stage. Independent usage of the repository will be challenging prior to end-of-year 2024. FloodAdapt documentation will be expanded on throughout 2024.
776
774
 
777
- # Installation
775
+ # Getting Started
778
776
 
779
- ## Setting up Pixi
780
- To build the environment, manage dependencies and run tasks, FloodAdapt uses [Pixi](https://pixi.sh/latest/), please download and install it by following the instructions on the pixi website.
781
-
782
- Before continuing the installation process, make sure you have access to all required private repositories by ensuring you are in the Teams `FloodAdaptUsers` in the [Deltares](https://github.com/orgs/Deltares/teams/floodadaptusers) and [Deltares-research](https://github.com/orgs/Deltares-research/teams/floodadaptusers) organizations.
783
-
784
- ## Windows
785
- Then run these commands to install FloodAdapt:
786
- ```bash
787
- git clone https://github.com/Deltares-research/FloodAdapt.git
788
- cd FloodAdapt
789
- pixi install
790
- ```
791
- ## Linux
792
- Linux is not supported at the moment, but will be supported in the near future.
793
-
794
- ## Configure database
795
-
796
- #### TODO add section for the DatabaseBuilder.
797
-
798
- FloodAdapt uses a database to store, handle and organize input files, output files and static data. This database needs to be configured the first time you want to use FloodAdapt. Which is done via `flood_adapt/misc/config.py` which contains the `Settings` class to set and validate environment variables, specific to your system.
799
-
800
- 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:
801
- ```python
802
- from pathlib import Path
803
- from flood_adapt import Settings
804
-
805
- # Usually ends in `Database` and can contain multiple sites
806
- root = Path("path/to/your/database/root")
807
-
808
- # Specifies which site to use
809
- name = "database_name"
810
-
811
- # Define the paths to the model kernel binaries
812
- sfincs_bin = Path("path/to/your/sfincs/bin.exe")
813
- fiat_bin = Path("path/to/your/fiat/bin.exe")
814
-
815
- # Validate and set environment variables
816
- Settings(
817
- DATABASE_ROOT=root,
818
- DATABASE_NAME=name,
819
- SFINCS_BIN_PATH=sfincs_bin,
820
- FIAT_BIN_PATH=fiat_path,
821
- VALIDATE_BINARIES=True,
822
- )
823
- ```
824
-
825
- ## Developing FloodAdapt
826
-
827
- To contribute to FloodAdapt, you will need to install additional dependencies. To do so, clone the repository and install the development environment:
828
-
829
- ```bash
830
- # Install dev environment
831
- git clone https://github.com/Deltares/FloodAdapt
832
- cd FloodAdapt
833
-
834
- # This will install the required environment and run the tests to verify
835
- pixi run tests
836
- ```
837
-
838
- Alternatively, you can open an interactive shell and have pixi take care of activating and updating your environment.
839
- ```bash
840
- # `activate` the dev environment
841
- pixi shell -e dev
842
-
843
- # Develop
844
- pytest tests/test_x/test_y/test_z.py
845
- python scripts/my_script.py
846
- ...
847
- ```
848
-
849
- ### Adding editable installations to your environment
850
-
851
- To make developing easier and not have to reinstall packages after every change, editable installs exist.
852
- Pixi supports editable installs, but not in the most intuitive way, as they need to be defined as editable in the project specification.
853
-
854
- Example command to add the package `example_package` as an editable install to the default environment:
855
- - go to the non-pixi sections in `pyproject.toml` and comment out the `example_package`. (`[dependencies]` or `[optional-dependencies]`)
856
- - in the pixi section `[tool.pixi.pypi-dependencies]`: add the following line `example_package = {path = "./path/to/example_package", editable = true }`. Note that this path is relative to the root of this project.
857
- - run `pixi update`
858
-
859
- ## Useful pixi commands
860
- ```bash
861
- # Display all pixi commands and options
862
- pixi -h
863
-
864
- # Install a non default pixi environment defined in pyproject.toml
865
- pixi install -e [ENV_NAME]
866
-
867
- # Update environment(s) to the latest allowed by dependency specifications in pyproject.toml
868
- pixi update
869
-
870
- # List all available tasks
871
- pixi task list
872
-
873
- # Run a task in the default environment for that task
874
- pixi run [TASK]
875
-
876
- # Start a shell in the pixi environment
877
- pixi shell -e [ENV_NAME]
878
-
879
- # Add a package to the dependencies
880
- pixi add [PACKAGE]
881
-
882
- # Run a task in a specific environment
883
- pixi run -e [ENV_NAME] [TASK]
884
- ```
885
-
886
- ### Generating the documentation
887
-
888
- We use `quartodoc` to generate our API documentation automatically. If you have the `docs` optional dependency group installed.
889
- you can do this by running `quartodoc build` from the `docs` directory, and it will create the documentation for you.
890
- After this is done, if you wish, you can build and view the documentation locally by running `quarto preview` from the `docs` directory
777
+ Please review our [`developer guide`](DEVELOPER_GUIDE.md) for information on how to install and use FloodAdapt locally.
@@ -0,0 +1,19 @@
1
+ # FloodAdapt
2
+ FloodAdapt is a decision-support tool that seeks to advance and accelerate flooding-related adaptation planning. It brings rapid, physics-based compound flood and detailed impact modelling into an easy-to-use system, allowing non-expert end-users to evaluate a wide variety of compound events, future conditions, and adaptation options in minutes. FloodAdapt serves as a connector between scientific advances and practitioner needs, improving and increasing the uptake and impact of adaptation research and development.
3
+
4
+ To make decisions on flood adaptation, communities need to understand how climate and socio-economic changes will affect flood risk and the risk-reduction potential of various adaptation options. This type of information is usually costly to acquire, and models are often too slow and labor-intensive to evaluate all the scenarios required to understand the impacts and effectiveness of potential adaptation decisions. FloodAdapt addresses this by making rapid, physics-based compound flood modeling and detailed impact modeling accessible to non-expert end-users, allowing them to evaluate a wide variety of compound events, future conditions, and adaptation options in minutes.
5
+
6
+ FloodAdapt was developed as a rapid planning tool with a straightforward graphical user interface for scenario generation, simulation, and visualization of spatial flooding and flooding impacts. Decision-making needs at the community level were central to the design of FloodAdapt. Users can answer planning questions like: “How will potential adaptation options reduce flood impacts?”, “How will those options perform for different types of events, like hurricanes, king tides, or heavy rainfall?”, “Which neighborhoods will benefit most?”, “How will those options hold up in the future?”
7
+
8
+ Users specify what-if scenarios composed of historic or synthetic weather events, climate or socio-economic future projections, and adaptation measures.
9
+ The backend of FloodAdapt leverages the open-source, state-of-the-art process-based compound flood model SFINCS (https://github.com/Deltares/SFINCS) that can accurately predict compound flooding due to surge, rainfall, and river discharge, at a fraction of the computation time typically required by physics-based models. The damage model included in FloodAdapt is the Deltares-developed flood impact assessment tool Delft-FIAT (https://github.com/Deltares/Delft-FIAT). It calculates the flood damages to individual buildings and roads, and – when social vulnerability data is available – aggregates these damages over vulnerability classes.
10
+
11
+ FloodAdapt can greatly support adaptation planning by allowing users to explore many scenarios. It can be used to evaluate flooding and impacts due to compound weather events, like hurricanes, king tides, and rainfall events. Users can evaluate flooding, impacts, and risk considering user-specified projections of sea level rise, precipitation increase, storm frequency increase, population growth, and economic growth. Users can also test out adaptation options, like sea walls, levees, pumps, home elevations, buyouts and floodproofing.
12
+
13
+ Recent developments of the decision-support system include (1) simplifying and partially automating the setup of the SFINCS and Delft-FIAT models, (2) improving the user experience, (3) better supporting adaptation planning with improvements like metrics tables, infographics, better visualizations in the user interface, adding in additional adaptation options to evaluate, and calculating benefits of adaptation options, and (4) incorporating social vulnerability and equity into the evaluation of adaptation options to support equitable adaptation planning.
14
+
15
+ FloodAdapt is currently in an intensive development stage. Independent usage of the repository will be challenging prior to end-of-year 2024. FloodAdapt documentation will be expanded on throughout 2024.
16
+
17
+ # Getting Started
18
+
19
+ Please review our [`developer guide`](DEVELOPER_GUIDE.md) for information on how to install and use FloodAdapt locally.
@@ -1,5 +1,5 @@
1
1
  # has to be here at the start to avoid circular imports
2
- __version__ = "1.1.0"
2
+ __version__ = "1.1.1"
3
3
 
4
4
  from flood_adapt import adapter, database_builder, dbs_classes, objects
5
5
  from flood_adapt.config.config import Settings
@@ -106,7 +106,7 @@ 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_root = str(model_root.resolve())
109
+ self._model_root = model_root.resolve().as_posix()
110
110
  self.fiat_columns = _FIAT_COLUMNS
111
111
  self.impact_columns = _IMPACT_COLUMNS # columns of FA impact output
112
112
 
@@ -135,7 +135,7 @@ class FiatAdapter(IImpactAdapter):
135
135
  def read(self, path: Path) -> None:
136
136
  """Read the fiat model from the current model root."""
137
137
  if Path(self.model.root).resolve() != Path(path).resolve():
138
- self.model.set_root(root=str(path), mode="r")
138
+ self.model.set_root(root=path.as_posix(), mode="r")
139
139
  self.model.read()
140
140
 
141
141
  def write(self, path_out: Union[str, os.PathLike], overwrite: bool = True) -> None:
@@ -148,7 +148,7 @@ class FiatAdapter(IImpactAdapter):
148
148
 
149
149
  write_mode = "w+" if overwrite else "w"
150
150
  with cd(path_out):
151
- self.model.set_root(root=str(path_out), mode=write_mode)
151
+ self.model.set_root(root=path_out.as_posix(), mode=write_mode)
152
152
  self.model.write()
153
153
 
154
154
  def close_files(self):
@@ -717,8 +717,8 @@ class FiatAdapter(IImpactAdapter):
717
717
  conversion_factor = wl_current_units.convert(self.model.exposure.unit)
718
718
 
719
719
  self.model.setup_hazard(
720
- map_fn=map_fn,
721
- map_type=map_type,
720
+ map_fn=[Path(p).as_posix() for p in map_fn],
721
+ map_type=map_type.value,
722
722
  rp=None,
723
723
  crs=None, # change this in new version (maybe to str(floodmap.crs.split(':')[1]))
724
724
  nodata=-999, # change this in new version
@@ -1160,7 +1160,7 @@ class FiatAdapter(IImpactAdapter):
1160
1160
  object_dir=ObjectDir.measure,
1161
1161
  obj_name=measure.name,
1162
1162
  path=measure.polygon_file,
1163
- )
1163
+ ).as_posix()
1164
1164
  else:
1165
1165
  polygon_file = None
1166
1166
 
@@ -1171,7 +1171,7 @@ class FiatAdapter(IImpactAdapter):
1171
1171
  non_building_names=self.config.non_building_names,
1172
1172
  aggregation=measure.aggregation_area_type,
1173
1173
  aggregation_area_name=measure.aggregation_area_name,
1174
- polygon_file=str(polygon_file),
1174
+ polygon_file=polygon_file,
1175
1175
  )
1176
1176
 
1177
1177
  return ids
@@ -121,7 +121,7 @@ class SfincsAdapter(IHazardAdapter):
121
121
  self.settings = self.database.site.sfincs
122
122
  self.units = self.database.site.gui.units
123
123
  self._model = HydromtSfincsModel(
124
- root=str(model_root.resolve()),
124
+ root=model_root.resolve().as_posix(),
125
125
  mode="r",
126
126
  logger=self._setup_sfincs_logger(model_root),
127
127
  )
@@ -130,7 +130,7 @@ class SfincsAdapter(IHazardAdapter):
130
130
  def read(self, path: Path):
131
131
  """Read the sfincs model from the current model root."""
132
132
  if Path(self._model.root).resolve() != Path(path).resolve():
133
- self._model.set_root(root=str(path), mode="r")
133
+ self._model.set_root(root=path.as_posix(), mode="r")
134
134
  self._model.read()
135
135
 
136
136
  def write(self, path_out: Union[str, os.PathLike], overwrite: bool = True):
@@ -147,7 +147,7 @@ class SfincsAdapter(IHazardAdapter):
147
147
 
148
148
  write_mode = "w+" if overwrite else "w"
149
149
  with cd(path_out):
150
- self._model.set_root(root=str(path_out), mode=write_mode)
150
+ self._model.set_root(root=path_out.as_posix(), mode=write_mode)
151
151
  self._model.write()
152
152
 
153
153
  def close_files(self):
@@ -190,10 +190,16 @@ class SfincsAdapter(IHazardAdapter):
190
190
  True if the model ran successfully, False otherwise.
191
191
 
192
192
  """
193
+ sfincs_bin = Settings().sfincs_bin_path
194
+ if not sfincs_bin or not sfincs_bin.exists():
195
+ raise FileNotFoundError(
196
+ f"SFINCS binary not found at {sfincs_bin}. Please check your settings."
197
+ )
198
+
193
199
  with cd(path):
194
200
  logger.info(f"Running SFINCS in {path}")
195
201
  process = subprocess.run(
196
- str(Settings().sfincs_bin_path),
202
+ sfincs_bin.as_posix(),
197
203
  stdout=subprocess.PIPE,
198
204
  stderr=subprocess.PIPE,
199
205
  text=True,
@@ -563,7 +569,7 @@ class SfincsAdapter(IHazardAdapter):
563
569
  zsmax=floodmap_conversion * zsmax,
564
570
  dep=dem_conversion * dem,
565
571
  hmin=0.01,
566
- floodmap_fn=str(floodmap_fn),
572
+ floodmap_fn=floodmap_fn.as_posix(),
567
573
  )
568
574
 
569
575
  def write_water_level_map(
@@ -803,7 +809,7 @@ class SfincsAdapter(IHazardAdapter):
803
809
  zsmax=floodmap_conversion * zsmax,
804
810
  dep=dem_conversion * dem,
805
811
  hmin=0.01,
806
- floodmap_fn=str(floodmap_fn),
812
+ floodmap_fn=floodmap_fn.as_posix(),
807
813
  )
808
814
 
809
815
  ######################################
@@ -1626,7 +1632,7 @@ class SfincsAdapter(IHazardAdapter):
1626
1632
 
1627
1633
  # Initialize the tropical cyclone
1628
1634
  tc = TropicalCyclone()
1629
- tc.read_track(filename=str(track_forcing.path), fmt="ddb_cyc")
1635
+ tc.read_track(filename=track_forcing.path.as_posix(), fmt="ddb_cyc")
1630
1636
 
1631
1637
  # Alter the track of the tc if necessary
1632
1638
  tc = self._translate_tc_track(
@@ -341,7 +341,7 @@ class SlrScenariosModel(BaseModel):
341
341
  # write html to results folder
342
342
  output_loc.parent.mkdir(parents=True, exist_ok=True)
343
343
  fig.write_html(output_loc)
344
- return str(output_loc)
344
+ return output_loc.as_posix()
345
345
 
346
346
 
347
347
  class FloodModel(BaseModel):
@@ -192,7 +192,7 @@ class Database(IDatabase):
192
192
  if self.site.sfincs.slr_scenarios is None:
193
193
  raise ConfigError("No SLR scenarios defined in the site configuration.")
194
194
  slr = self.site.sfincs.slr_scenarios
195
- slr.file = str(self.static_path / slr.file)
195
+ slr.file = (self.static_path / slr.file).as_posix()
196
196
  return slr
197
197
 
198
198
  def get_outputs(self) -> dict[str, Any]:
@@ -285,7 +285,7 @@ class Database(IDatabase):
285
285
  path to topobathy tiles
286
286
  """
287
287
  path = self.input_path.parent.joinpath("static", "dem", "tiles", "topobathy")
288
- return str(path)
288
+ return path.as_posix()
289
289
 
290
290
  def get_index_path(self) -> str:
291
291
  """Return the path of the index tiles which are used to connect each water level cell with the topobathy tiles.
@@ -296,7 +296,7 @@ class Database(IDatabase):
296
296
  path to index tiles
297
297
  """
298
298
  path = self.input_path.parent.joinpath("static", "dem", "tiles", "indices")
299
- return str(path)
299
+ return path.as_posix()
300
300
 
301
301
  def get_depth_conversion(self) -> float:
302
302
  """Return the flood depth conversion that is need in the gui to plot the flood map.
@@ -290,9 +290,9 @@ class DbsStatic(IDbsStatic):
290
290
  raise ConfigError(
291
291
  "No cyclone track database defined in the site configuration."
292
292
  )
293
- database_file = str(
293
+ database_file = (
294
294
  self._database.static_path
295
295
  / "cyclone_track_database"
296
296
  / self._database.site.sfincs.cyclone_track_database.file
297
- )
297
+ ).as_posix()
298
298
  return CycloneTrackDatabase("ibtracs", file_name=database_file)
@@ -891,7 +891,7 @@ class FloodAdapt:
891
891
 
892
892
  output_path = self.database.get_flooding_path(scenario.name)
893
893
  obs_points["html"] = [
894
- str(output_path.joinpath(f"{station}_timeseries.html"))
894
+ (output_path / f"{station}_timeseries.html").as_posix()
895
895
  for station in obs_points.name
896
896
  ]
897
897
 
@@ -967,10 +967,10 @@ class FloodAdapt:
967
967
  # Check if the file exists
968
968
  if not metrics_path.exists():
969
969
  raise FileNotFoundError(
970
- f"The metrics file for scenario {name}({str(metrics_path)}) does not exist."
970
+ f"The metrics file for scenario {name}({metrics_path.as_posix()}) does not exist."
971
971
  )
972
972
  # Read the metrics file
973
- df = MetricsFileReader(str(metrics_path)).read_metrics_from_file(
973
+ df = MetricsFileReader(metrics_path.as_posix()).read_metrics_from_file(
974
974
  include_long_names=True,
975
975
  include_description=True,
976
976
  include_metrics_table_selection=True,
@@ -4,13 +4,17 @@ from contextlib import contextmanager
4
4
  from pathlib import Path
5
5
  from typing import Union
6
6
 
7
+ import geopandas as gpd
7
8
  from pydantic import BeforeValidator
8
9
 
10
+ from flood_adapt.misc.log import FloodAdaptLogging
9
11
  from flood_adapt.misc.path_builder import (
10
12
  ObjectDir,
11
13
  db_path,
12
14
  )
13
15
 
16
+ logger = FloodAdaptLogging.getLogger(__name__)
17
+
14
18
 
15
19
  @contextmanager
16
20
  def modified_environ(*remove, **update):
@@ -136,22 +140,37 @@ def save_file_to_database(
136
140
  if src_file == dst_file:
137
141
  return dst_file
138
142
  elif dst_file.exists():
139
- if dst_file.suffix == ".shp":
140
- for file in list(dst_file.parent.glob(f"{dst_file.stem}.*")):
141
- os.remove(file)
142
- else:
143
- os.remove(dst_file)
143
+ match dst_file.suffix:
144
+ case ".shp":
145
+ for file in list(dst_file.parent.glob(f"{dst_file.stem}.*")):
146
+ os.remove(file)
147
+ case _:
148
+ os.remove(dst_file)
144
149
 
145
150
  dst_file.parent.mkdir(parents=True, exist_ok=True)
146
- if src_file.suffix == ".shp":
147
- for file in list(src_file.parent.glob(f"{src_file.stem}.*")):
148
- shutil.copy2(file, dst_file.parent.joinpath(file.name))
149
- else:
150
- shutil.copy2(src_file, dst_file)
151
+ match src_file.suffix:
152
+ case ".shp" | ".geojson" | ".gpkg":
153
+ write_gdf_with_global_crs(src_file, dst_file)
154
+ case _:
155
+ shutil.copy2(src_file, dst_file)
151
156
 
152
157
  return dst_file
153
158
 
154
159
 
160
+ def write_gdf_with_global_crs(src: gpd.GeoDataFrame | Path, dst_path: Path) -> None:
161
+ if isinstance(src, gpd.GeoDataFrame):
162
+ gdf = src
163
+ else:
164
+ gdf = gpd.read_file(src)
165
+
166
+ if gdf.crs is None:
167
+ logger.warning(f"CRS is not defined for {src}. Assuming EPSG:4326.")
168
+ gdf = gdf.set_crs(epsg=4326)
169
+ else:
170
+ gdf = gdf.to_crs(epsg=4326)
171
+ gdf.to_file(dst_path)
172
+
173
+
155
174
  def copy_file_to_output_dir(file_path: Path, output_dir: Path) -> Path:
156
175
  output_dir = output_dir.resolve()
157
176
  if file_path == output_dir / file_path.name:
@@ -161,7 +161,7 @@ def plot_discharge(
161
161
  if output_loc.exists():
162
162
  output_loc.unlink()
163
163
  fig.write_html(output_loc)
164
- return str(output_loc), None
164
+ return output_loc.as_posix(), None
165
165
 
166
166
 
167
167
  def plot_waterlevel(
@@ -278,7 +278,7 @@ def plot_waterlevel(
278
278
  if output_loc.exists():
279
279
  output_loc.unlink()
280
280
  fig.write_html(output_loc)
281
- return str(output_loc), None
281
+ return output_loc.as_posix(), None
282
282
 
283
283
 
284
284
  def plot_rainfall(
@@ -351,7 +351,7 @@ def plot_rainfall(
351
351
  if output_loc.exists():
352
352
  output_loc.unlink()
353
353
  fig.write_html(output_loc)
354
- return str(output_loc), None
354
+ return output_loc.as_posix(), None
355
355
 
356
356
 
357
357
  def plot_wind(
@@ -423,4 +423,4 @@ def plot_wind(
423
423
  if output_loc.exists():
424
424
  output_loc.unlink()
425
425
  fig.write_html(output_loc)
426
- return str(output_loc), None
426
+ return output_loc.as_posix(), None
@@ -198,7 +198,9 @@ class Measure(Object):
198
198
  measure = cls.model_validate(toml)
199
199
 
200
200
  if measure.polygon_file:
201
- measure.polygon_file = str(Path(file_path).parent / measure.polygon_file)
201
+ measure.polygon_file = (
202
+ Path(file_path).parent / measure.polygon_file
203
+ ).as_posix()
202
204
 
203
205
  return measure
204
206
 
@@ -1,4 +1,5 @@
1
1
  import shutil
2
+ from pathlib import Path
2
3
  from typing import Any
3
4
 
4
5
  import geopandas as gpd
@@ -32,7 +33,7 @@ class BenefitRunner:
32
33
  self.benefit = benefit
33
34
 
34
35
  # Get output path based on database path
35
- self.results_path = self.database.benefits.output_path.joinpath(
36
+ self.results_path: Path = self.database.benefits.output_path.joinpath(
36
37
  self.benefit.name
37
38
  )
38
39
  self.site_info = self.database.site
@@ -71,7 +72,7 @@ class BenefitRunner:
71
72
  results_html = self.results_path.joinpath("benefits.html")
72
73
  with open(results_toml, mode="rb") as fp:
73
74
  results = tomli.load(fp)
74
- results["html"] = str(results_html)
75
+ results["html"] = results_html.as_posix()
75
76
  self._results = results
76
77
  return results
77
78