flood-adapt 0.3.11__py3-none-any.whl → 0.3.13__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. flood_adapt/__init__.py +3 -2
  2. flood_adapt/adapter/fiat_adapter.py +44 -9
  3. flood_adapt/adapter/sfincs_adapter.py +173 -76
  4. flood_adapt/config/gui.py +1 -0
  5. flood_adapt/database_builder/__init__.py +23 -0
  6. flood_adapt/database_builder/database_builder.py +615 -362
  7. flood_adapt/database_builder/templates/infographics/OSM/config_charts.toml +2 -2
  8. flood_adapt/database_builder/templates/infographics/OSM/config_roads.toml +1 -1
  9. flood_adapt/database_builder/templates/infographics/US_NSI/config_roads.toml +1 -1
  10. flood_adapt/dbs_classes/database.py +62 -3
  11. flood_adapt/dbs_classes/dbs_benefit.py +1 -0
  12. flood_adapt/dbs_classes/dbs_event.py +1 -0
  13. flood_adapt/dbs_classes/dbs_measure.py +1 -0
  14. flood_adapt/dbs_classes/dbs_projection.py +1 -0
  15. flood_adapt/dbs_classes/dbs_scenario.py +1 -0
  16. flood_adapt/dbs_classes/dbs_strategy.py +1 -0
  17. flood_adapt/dbs_classes/dbs_template.py +2 -1
  18. flood_adapt/misc/log.py +20 -12
  19. flood_adapt/objects/events/historical.py +3 -3
  20. flood_adapt/objects/events/hurricane.py +1 -1
  21. flood_adapt/objects/forcing/plotting.py +7 -34
  22. {flood_adapt-0.3.11.dist-info → flood_adapt-0.3.13.dist-info}/METADATA +1 -1
  23. {flood_adapt-0.3.11.dist-info → flood_adapt-0.3.13.dist-info}/RECORD +26 -27
  24. flood_adapt/database_builder.py +0 -16
  25. {flood_adapt-0.3.11.dist-info → flood_adapt-0.3.13.dist-info}/LICENSE +0 -0
  26. {flood_adapt-0.3.11.dist-info → flood_adapt-0.3.13.dist-info}/WHEEL +0 -0
  27. {flood_adapt-0.3.11.dist-info → flood_adapt-0.3.13.dist-info}/top_level.txt +0 -0
@@ -84,7 +84,7 @@
84
84
  [Other.Info]
85
85
  text="""Inundation depth thresholds:<br>
86
86
  Minor: 0.25 m<br>
87
- Major: 2.0 m<br>
88
- Destroyed: >2.0 m"""
87
+ Major: 1.5 m<br>
88
+ Destroyed: >1.5 m"""
89
89
  image="https://openclipart.org/image/800px/302413"
90
90
  scale=0.1
@@ -54,7 +54,7 @@
54
54
  [Other.Subtitle]
55
55
  font = 25
56
56
  [Other.Y_axis_title]
57
- text = "Kilometers of interruption"
57
+ text = "Kilometers"
58
58
  [Other.Info]
59
59
  text="""Thresholds:<br>
60
60
  Pedestrians: 0.05 m<br>
@@ -54,7 +54,7 @@
54
54
  [Other.Subtitle]
55
55
  font = 25
56
56
  [Other.Y_axis_title]
57
- text = "Miles of interruption"
57
+ text = "Miles"
58
58
  [Other.Info]
59
59
  text="""Thresholds:<br>
60
60
  Pedestrians: 0.3 feet<br>
@@ -28,6 +28,7 @@ from flood_adapt.misc.path_builder import (
28
28
  db_path,
29
29
  )
30
30
  from flood_adapt.misc.utils import finished_file_exists
31
+ from flood_adapt.objects.events.events import Mode
31
32
  from flood_adapt.objects.forcing import unit_system as us
32
33
  from flood_adapt.workflows.scenario_runner import ScenarioRunner
33
34
 
@@ -129,12 +130,11 @@ class Database(IDatabase):
129
130
  self, standard_objects=self.site.standard_objects.projections
130
131
  )
131
132
  self._benefits = DbsBenefit(self)
133
+ self._init_done = True
132
134
 
133
- # Delete any unfinished/crashed scenario output
135
+ # Delete any unfinished/crashed scenario output after initialization
134
136
  self.cleanup()
135
137
 
136
- self._init_done = True
137
-
138
138
  def shutdown(self):
139
139
  """Explicitly shut down the singleton and clear all references."""
140
140
  import gc
@@ -509,6 +509,9 @@ class Database(IDatabase):
509
509
  (self.scenarios.output_path / dir).resolve()
510
510
  for dir in os.listdir(self.scenarios.output_path)
511
511
  ]
512
+ self.logger.info(
513
+ f"Cleaning up scenario outputs: {len(output_scenarios)} scenarios found."
514
+ )
512
515
 
513
516
  def _call_garbage_collector(func, path, exc_info, retries=5, delay=0.1):
514
517
  """Retry deletion up to 5 times if the file is locked."""
@@ -531,3 +534,59 @@ class Database(IDatabase):
531
534
  path.name for path in input_scenarios
532
535
  ] or not finished_file_exists(dir):
533
536
  shutil.rmtree(dir, onerror=_call_garbage_collector)
537
+ # If the scenario is finished, delete the simulation folders
538
+ elif finished_file_exists(dir):
539
+ self._delete_simulations(dir.name)
540
+
541
+ def _delete_simulations(self, scenario_name: str) -> None:
542
+ """Delete all simulation folders for a given scenario.
543
+
544
+ Parameters
545
+ ----------
546
+ scenario_name : str
547
+ Name of the scenario to delete simulations for.
548
+ """
549
+ scn = self.scenarios.get(scenario_name)
550
+ event = self.events.get(scn.event, load_all=True)
551
+ sub_events = event._events if event.mode == Mode.risk else None
552
+
553
+ if not self.site.sfincs.config.save_simulation:
554
+ # Delete SFINCS overland
555
+ overland = self.static.get_overland_sfincs_model()
556
+ if sub_events:
557
+ for sub_event in sub_events:
558
+ overland._delete_simulation_folder(scn, sub_event=sub_event)
559
+
560
+ else:
561
+ overland._delete_simulation_folder(scn)
562
+
563
+ # Delete SFINCS offshore
564
+ if self.site.sfincs.config.offshore_model:
565
+ offshore = self.static.get_offshore_sfincs_model()
566
+ if sub_events:
567
+ for sub_event in sub_events:
568
+ sim_path = offshore._get_simulation_path_offshore(
569
+ scn, sub_event=sub_event
570
+ )
571
+ if sim_path.exists():
572
+ shutil.rmtree(sim_path, ignore_errors=True)
573
+ self.logger.info(f"Deleted simulation folder: {sim_path}")
574
+ if sim_path.parent.exists() and not any(
575
+ sim_path.parent.iterdir()
576
+ ):
577
+ # Remove the parent directory `simulations` if it is empty
578
+ sim_path.parent.rmdir()
579
+ else:
580
+ sim_path = offshore._get_simulation_path_offshore(scn)
581
+ if sim_path.exists():
582
+ shutil.rmtree(sim_path, ignore_errors=True)
583
+ self.logger.info(f"Deleted simulation folder: {sim_path}")
584
+
585
+ if sim_path.parent.exists() and not any(sim_path.parent.iterdir()):
586
+ # Remove the parent directory `simulations` if it is empty
587
+ sim_path.parent.rmdir()
588
+
589
+ if not self.site.fiat.config.save_simulation:
590
+ # Delete FIAT
591
+ fiat = self.static.get_fiat_model()
592
+ fiat._delete_simulation_folder(scn)
@@ -9,6 +9,7 @@ class DbsBenefit(DbsTemplate[Benefit]):
9
9
  display_name = "Benefit"
10
10
  dir_name = "benefits"
11
11
  _object_class = Benefit
12
+ _higher_lvl_object = ""
12
13
 
13
14
  def save(self, object_model: Benefit, overwrite: bool = False):
14
15
  """Save a benefit object in the database.
@@ -11,6 +11,7 @@ class DbsEvent(DbsTemplate[Event]):
11
11
  dir_name = "events"
12
12
  display_name = "Event"
13
13
  _object_class = Event
14
+ _higher_lvl_object = "Scenario"
14
15
 
15
16
  def get(self, name: str, load_all: bool = False) -> Event | EventSet:
16
17
  """Return an event object.
@@ -14,6 +14,7 @@ class DbsMeasure(DbsTemplate[Measure]):
14
14
  dir_name = "measures"
15
15
  display_name = "Measure"
16
16
  _object_class = Measure
17
+ _higher_lvl_object = "Strategy"
17
18
 
18
19
  def get(self, name: str) -> Measure:
19
20
  """Return a measure object.
@@ -6,6 +6,7 @@ class DbsProjection(DbsTemplate[Projection]):
6
6
  dir_name = "projections"
7
7
  display_name = "Projection"
8
8
  _object_class = Projection
9
+ _higher_lvl_object = "Scenario"
9
10
 
10
11
  def check_higher_level_usage(self, name: str) -> list[str]:
11
12
  """Check if a projection is used in a scenario.
@@ -11,6 +11,7 @@ class DbsScenario(DbsTemplate[Scenario]):
11
11
  dir_name = "scenarios"
12
12
  display_name = "Scenario"
13
13
  _object_class = Scenario
14
+ _higher_lvl_object = "Benefit"
14
15
 
15
16
  def summarize_objects(self) -> dict[str, list[Any]]:
16
17
  """Return a dictionary with info on the events that currently exist in the database.
@@ -10,6 +10,7 @@ class DbsStrategy(DbsTemplate[Strategy]):
10
10
  dir_name = "strategies"
11
11
  display_name = "Strategy"
12
12
  _object_class = Strategy
13
+ _higher_lvl_object = "Scenario"
13
14
 
14
15
  def get(self, name: str) -> Strategy:
15
16
  strategy = super().get(name)
@@ -18,6 +18,7 @@ class DbsTemplate(AbstractDatabaseElement[T_OBJECTMODEL]):
18
18
  display_name: str
19
19
  dir_name: str
20
20
  _object_class: type[T_OBJECTMODEL]
21
+ _higher_lvl_object: str
21
22
 
22
23
  def __init__(
23
24
  self, database: IDatabase, standard_objects: Optional[list[str]] = None
@@ -161,7 +162,7 @@ class DbsTemplate(AbstractDatabaseElement[T_OBJECTMODEL]):
161
162
  # Check if object is used in a higher level object. If it is, raise an error
162
163
  if used_in := self.check_higher_level_usage(name):
163
164
  raise DatabaseError(
164
- f"{self.display_name}: '{name}' cannot be deleted/modified since it is already used in: {', '.join(used_in)}"
165
+ f"{self.display_name}: '{name}' cannot be deleted/modified since it is already used in the {self._higher_lvl_object.capitalize()}(s): {', '.join(used_in)}"
165
166
  )
166
167
 
167
168
  # Once all checks are passed, delete the object
flood_adapt/misc/log.py CHANGED
@@ -15,26 +15,24 @@ class FloodAdaptLogging:
15
15
  def __init__(
16
16
  self,
17
17
  file_path: Optional[Path] = None,
18
- loglevel_console: int = logging.WARNING,
19
- loglevel_root: int = logging.INFO,
20
- loglevel_files: int = logging.DEBUG,
18
+ level: int = logging.INFO,
21
19
  formatter: logging.Formatter = _DEFAULT_FORMATTER,
22
20
  ignore_warnings: Optional[list[type[Warning]]] = None,
23
21
  ) -> None:
24
22
  """Initialize the logging system for the FloodAdapt."""
25
23
  self._formatter = formatter
26
24
 
27
- self._root_logger.setLevel(loglevel_root)
25
+ self._root_logger.setLevel(level)
28
26
  if self._root_logger.hasHandlers():
29
27
  self._root_logger.handlers.clear()
30
28
 
31
29
  # Add file handler if provided
32
30
  if file_path is not None:
33
- self.add_file_handler(file_path, loglevel_files, formatter)
31
+ self.add_file_handler(file_path, level, formatter)
34
32
 
35
33
  # Add console handler
36
34
  console_handler = logging.StreamHandler()
37
- console_handler.setLevel(loglevel_console)
35
+ console_handler.setLevel(level)
38
36
  console_handler.setFormatter(formatter)
39
37
  self._root_logger.addHandler(console_handler)
40
38
 
@@ -46,7 +44,7 @@ class FloodAdaptLogging:
46
44
  def add_file_handler(
47
45
  cls,
48
46
  file_path: Path,
49
- loglevel: int = logging.DEBUG,
47
+ level: int = logging.DEBUG,
50
48
  formatter: Optional[logging.Formatter] = None,
51
49
  ) -> None:
52
50
  """Add a file handler to the logger that directs outputs to a the file."""
@@ -60,7 +58,7 @@ class FloodAdaptLogging:
60
58
  file_path.parent.mkdir(parents=True, exist_ok=True)
61
59
 
62
60
  file_handler = logging.FileHandler(filename=file_path, mode="a")
63
- file_handler.setLevel(loglevel)
61
+ file_handler.setLevel(level)
64
62
 
65
63
  formatter = formatter or cls._DEFAULT_FORMATTER
66
64
  file_handler.setFormatter(formatter)
@@ -79,7 +77,7 @@ class FloodAdaptLogging:
79
77
 
80
78
  @classmethod
81
79
  def getLogger(
82
- cls, name: Optional[str] = None, level: int = logging.INFO
80
+ cls, name: Optional[str] = None, level: Optional[int] = None
83
81
  ) -> logging.Logger:
84
82
  """Get a logger with the specified name. If no name is provided, return the root logger.
85
83
 
@@ -101,9 +99,19 @@ class FloodAdaptLogging:
101
99
  logger = cls._root_logger
102
100
  else:
103
101
  logger = logging.getLogger(f"FloodAdapt.{name}")
104
- logger.setLevel(level)
102
+
103
+ if level:
104
+ logger.setLevel(level)
105
+
105
106
  return logger
106
107
 
108
+ @classmethod
109
+ def set_global_level(cls, level: int) -> None:
110
+ """Set the logging level for FloodAdapt."""
111
+ loggers = [logging.getLogger(name) for name in logging.root.manager.loggerDict]
112
+ for logger in loggers:
113
+ logger.setLevel(level)
114
+
107
115
  @classmethod
108
116
  def shutdown(cls):
109
117
  root_logger = cls.getLogger()
@@ -120,7 +128,7 @@ class FloodAdaptLogging:
120
128
  cls,
121
129
  *,
122
130
  file_path: Path,
123
- loglevel: int = logging.DEBUG,
131
+ level: int = logging.DEBUG,
124
132
  formatter: logging.Formatter = _DEFAULT_FORMATTER,
125
133
  ):
126
134
  """Open a file at filepath to write logs to. Does not affect other loggers.
@@ -131,7 +139,7 @@ class FloodAdaptLogging:
131
139
  raise ValueError(
132
140
  "file_path must be provided as a key value pair: 'file_path=<file_path>'."
133
141
  )
134
- cls.add_file_handler(file_path, loglevel, formatter)
142
+ cls.add_file_handler(file_path, level, formatter)
135
143
  try:
136
144
  yield
137
145
  finally:
@@ -34,17 +34,17 @@ class HistoricalEvent(Event):
34
34
  ALLOWED_FORCINGS: ClassVar[dict[ForcingType, List[ForcingSource]]] = {
35
35
  ForcingType.RAINFALL: [
36
36
  ForcingSource.CSV,
37
- ForcingSource.METEO,
37
+ # ForcingSource.METEO, # Temporarily excluded due to bug in hydromt-sfincs. fixed in v1.3.0
38
38
  ForcingSource.SYNTHETIC,
39
39
  ForcingSource.CONSTANT,
40
40
  ],
41
41
  ForcingType.WIND: [
42
42
  ForcingSource.CSV,
43
- ForcingSource.METEO,
43
+ # ForcingSource.METEO, # Temporarily excluded due to bug in hydromt-sfincs. fixed in v1.3.0
44
44
  ForcingSource.CONSTANT,
45
45
  ],
46
46
  ForcingType.WATERLEVEL: [
47
- ForcingSource.MODEL,
47
+ # ForcingSource.MODEL, # Temporarily excluded due to the METEO bug in hydromt-sfincs. fixed in v1.3.0
48
48
  ForcingSource.CSV,
49
49
  ForcingSource.SYNTHETIC,
50
50
  ForcingSource.GAUGED,
@@ -53,7 +53,7 @@ class HurricaneEvent(Event):
53
53
  ForcingSource.CSV,
54
54
  ForcingSource.SYNTHETIC,
55
55
  ForcingSource.TRACK,
56
- ForcingSource.METEO,
56
+ # ForcingSource.METEO, # Temporarily excluded due to bug in hydromt-sfincs. fixed in v1.3.0
57
57
  ],
58
58
  ForcingType.WIND: [ForcingSource.TRACK],
59
59
  ForcingType.WATERLEVEL: [ForcingSource.MODEL],
@@ -5,7 +5,6 @@ from typing import List, Optional
5
5
  import pandas as pd
6
6
  import plotly.express as px
7
7
  import plotly.graph_objects as go
8
- from plotly.subplots import make_subplots
9
8
 
10
9
  from flood_adapt.config.site import Site
11
10
  from flood_adapt.misc.log import FloodAdaptLogging
@@ -395,36 +394,7 @@ def plot_wind(
395
394
  x_title = "Time"
396
395
 
397
396
  # Plot actual thing
398
- # Create figure with secondary y-axis
399
-
400
- fig = make_subplots(specs=[[{"secondary_y": True}]])
401
-
402
- # Add traces
403
- fig.add_trace(
404
- go.Scatter(
405
- x=data.index,
406
- y=data.iloc[:, 0],
407
- name="Wind speed",
408
- mode="lines",
409
- ),
410
- secondary_y=False,
411
- )
412
- fig.add_trace(
413
- go.Scatter(
414
- x=data.index, y=data.iloc[:, 1], name="Wind direction", mode="markers"
415
- ),
416
- secondary_y=True,
417
- )
418
-
419
- # Set y-axes titles
420
- fig.update_yaxes(
421
- title_text=f"Wind speed [{site.gui.units.default_velocity_units.value}]",
422
- secondary_y=False,
423
- )
424
- fig.update_yaxes(
425
- title_text=f"Wind direction {site.gui.units.default_direction_units.value}",
426
- secondary_y=True,
427
- )
397
+ fig = px.line(x=data.index, y=data.iloc[:, 0])
428
398
 
429
399
  fig.update_layout(
430
400
  autosize=False,
@@ -434,11 +404,14 @@ def plot_wind(
434
404
  font={"size": 10, "color": "black", "family": "Arial"},
435
405
  title_font={"size": 10, "color": "black", "family": "Arial"},
436
406
  legend=None,
437
- yaxis_title_font={"size": 10, "color": "black", "family": "Arial"},
438
- xaxis_title_font={"size": 10, "color": "black", "family": "Arial"},
407
+ showlegend=False,
439
408
  xaxis={"range": [event.time.start_time, event.time.end_time]},
440
409
  xaxis_title={"text": x_title},
441
- showlegend=False,
410
+ xaxis_title_font={"size": 10, "color": "black", "family": "Arial"},
411
+ yaxis_title_font={"size": 10, "color": "black", "family": "Arial"},
412
+ yaxis_title={
413
+ "text": f"Wind speed [{site.gui.units.default_velocity_units.value}]"
414
+ },
442
415
  )
443
416
 
444
417
  # Only save to the the event folder if that has been created already.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: flood-adapt
3
- Version: 0.3.11
3
+ Version: 0.3.13
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,9 +1,8 @@
1
- flood_adapt/__init__.py,sha256=ddZDt6_YqcpNI59YE5LwRFDqQiHxX7abekyhUu8Lvi0,776
2
- flood_adapt/database_builder.py,sha256=E0JPsPuq2PHhCzH0cp7kDEkRYG3XQBjlCaEoK0GGttc,436
1
+ flood_adapt/__init__.py,sha256=_o0HF796SslLRvNHJwcrVMHtIr-z6uzMpcSX9RXInj0,819
3
2
  flood_adapt/flood_adapt.py,sha256=szovzFyApBeT-XPMZ-GNsWH-ap63ejouP7hZZjadMVU,38364
4
3
  flood_adapt/adapter/__init__.py,sha256=UuiuVz5vKDoXnvBUMJ7Yybk0pjZkYLREgTA4G1Pzj8c,258
5
- flood_adapt/adapter/fiat_adapter.py,sha256=hKvQa86w7Gxrg2c_hCjN-mcyASd5gLCE5eugQJ3ExYY,58781
6
- flood_adapt/adapter/sfincs_adapter.py,sha256=8xIWnW-hHUMqtSLTl01GoE9s-MNN3zaSkLo8HBnoQZo,74880
4
+ flood_adapt/adapter/fiat_adapter.py,sha256=Lrj4avXNQrAcAw1Wmc6QJPJtRsl9DYzNnm8_fMDsHb8,60144
5
+ flood_adapt/adapter/sfincs_adapter.py,sha256=4Je6xd_6CWTQpqqvC8kB6QdCOiv0AD4WY5eFbCgJz74,79244
7
6
  flood_adapt/adapter/sfincs_offshore.py,sha256=QWJBD1ReQuVrQn3enyQeKR-YTHTQmGxzrLOjnOJkths,7486
8
7
  flood_adapt/adapter/interface/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
8
  flood_adapt/adapter/interface/hazard_adapter.py,sha256=S2NIUAMSRgxC_E-tZRJ2qIP06U1zEVdn-MnvMTrn86s,2828
@@ -13,11 +12,11 @@ flood_adapt/adapter/interface/offshore.py,sha256=G3ZpCWw6SjpyhOJIh0Acc5jnoUS8SO_
13
12
  flood_adapt/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
13
  flood_adapt/config/config.py,sha256=-aMmeBLE03O0Az-S9ms6Rz5hX8_5Kn2vr7IjjMI9w2o,9374
15
14
  flood_adapt/config/fiat.py,sha256=2w3StKeTg6-PHAz6fG8_br4QhzxWgMgbg-YQ4MVuhCk,6262
16
- flood_adapt/config/gui.py,sha256=1N9EWlM82h2EcMKg7FV_3Ab4ZjD519umT7w30wrjbtA,10488
15
+ flood_adapt/config/gui.py,sha256=vCmmfApHBN7_XAK1Cu7qh0C2WURWsyC3fhL-6Ri2-Lk,10524
17
16
  flood_adapt/config/sfincs.py,sha256=oj-YtjOM58UpcoBlqlMHhEBSHP-C_yyuefxNoewv9OU,16876
18
17
  flood_adapt/config/site.py,sha256=VR90jCHWcxgoQJptNyXy7LseGjXUDRtdOjNGCddFVzI,4328
19
- flood_adapt/database_builder/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
- flood_adapt/database_builder/database_builder.py,sha256=HdLgvnZzzb42IouwmulgC1R9skIWT2z8c6Oh6A_JQ7Y,89766
18
+ flood_adapt/database_builder/__init__.py,sha256=YsI5bGcAKYmsmb5W-spp91hzsKSTRtkXBLNRxLOWml4,474
19
+ flood_adapt/database_builder/database_builder.py,sha256=IbrahJVk8HoVZm9gdr0VdQxvnIWsPZeeJu9suQVfxyc,98880
21
20
  flood_adapt/database_builder/templates/default_units/imperial.toml,sha256=zIjPlxIa2kWLUjSYisd8UolXGo5iKdFoDDz_JkKBXTM,295
22
21
  flood_adapt/database_builder/templates/default_units/metric.toml,sha256=tc0XMKs7xGL9noB9lAb0gyQfjYxzokgHa3NqpccxWl0,302
23
22
  flood_adapt/database_builder/templates/green_infra_table/green_infra_lookup_table.csv,sha256=ooQzNGQwAMSAphy5W2ZyR5boQlcwvPv9ToJx1MlZhVE,466
@@ -39,15 +38,15 @@ flood_adapt/database_builder/templates/icons/white_down_48x48.png,sha256=ZxXz4WK
39
38
  flood_adapt/database_builder/templates/icons/white_left_48x48.png,sha256=mLjrGhsMo79EyaeEK9Ykmym-knv2LHk92JTMWaAfaw0,738
40
39
  flood_adapt/database_builder/templates/icons/white_right_48x48.png,sha256=dxYJT-zTp8KXLcjRkd4toZjkPrFCjDwBbSmqPspw9Qk,753
41
40
  flood_adapt/database_builder/templates/icons/white_up_48x48.png,sha256=eahYlRiknCFlIfA26BJQl__o74cqwuKTRRZ35SgCXcY,733
42
- flood_adapt/database_builder/templates/infographics/OSM/config_charts.toml,sha256=m6O7MXGSmA-F82nSzD2O4EMGSrmAf8Y8S0IDOIVFmiM,2608
41
+ flood_adapt/database_builder/templates/infographics/OSM/config_charts.toml,sha256=bHvgceR1Gb05jIv7Rk2NFNWowtFn4ztVTgF4z_OOYOk,2608
43
42
  flood_adapt/database_builder/templates/infographics/OSM/config_people.toml,sha256=k-0q5reU-0LA0QMlT5Mat8mldH9t37fMSt2pUZ0P0do,1754
44
43
  flood_adapt/database_builder/templates/infographics/OSM/config_risk_charts.toml,sha256=kwBVwsSY-D3ADuJdLxFQlSLuhxguxdNXk-dn-Pt_ud8,3804
45
- flood_adapt/database_builder/templates/infographics/OSM/config_roads.toml,sha256=pcdHavl1gGFY5AEU_907tmyUDtZaHDu_Uf3cEvCpnKA,1890
44
+ flood_adapt/database_builder/templates/infographics/OSM/config_roads.toml,sha256=VFlCpP2KzGlfBPoblNdL6YlJEmccUvIlUgLaOtwxwrc,1874
46
45
  flood_adapt/database_builder/templates/infographics/OSM/styles.css,sha256=yV8U2Z1DwuyfaAL13iQHjEJcPiDHXCUzGt2REXlSKeg,762
47
46
  flood_adapt/database_builder/templates/infographics/US_NSI/config_charts.toml,sha256=7mRXeh7-pvfsHp-gFdubQXR33nqaSyzKuJVc1WILdJU,3762
48
47
  flood_adapt/database_builder/templates/infographics/US_NSI/config_people.toml,sha256=9VJ0rzIj4YZIYWATQZYmbO6KLBB-C9i7skBOvE0M3oA,1892
49
48
  flood_adapt/database_builder/templates/infographics/US_NSI/config_risk_charts.toml,sha256=kwBVwsSY-D3ADuJdLxFQlSLuhxguxdNXk-dn-Pt_ud8,3804
50
- flood_adapt/database_builder/templates/infographics/US_NSI/config_roads.toml,sha256=8xabCxMA9-NksDJOAQOyFLK1Y5Wwg-h0mGuF6oDBvK8,1889
49
+ flood_adapt/database_builder/templates/infographics/US_NSI/config_roads.toml,sha256=T1QqW95D0MTeWMLDV85WdodXrIf0T7uIRZA9FU0l_is,1873
51
50
  flood_adapt/database_builder/templates/infographics/US_NSI/styles.css,sha256=yV8U2Z1DwuyfaAL13iQHjEJcPiDHXCUzGt2REXlSKeg,762
52
51
  flood_adapt/database_builder/templates/infographics/images/ambulance.png,sha256=dw5vcU_kRePrBA3Zl4_aQFz1Rc93x26y8PelY2MJ_Lo,7757
53
52
  flood_adapt/database_builder/templates/infographics/images/car.png,sha256=PFED6xR31G2P15ZGM14CyJeca7zfUlwQe2348bpPCxM,6600
@@ -75,22 +74,22 @@ flood_adapt/database_builder/templates/infometrics/US_NSI/without_SVI/infographi
75
74
  flood_adapt/database_builder/templates/infometrics/US_NSI/without_SVI/infographic_metrics_config_risk.toml,sha256=VLO7NRWTPzYRj3jYDb_mImPTppSm8Lh1ajCdNPuyc4U,2045
76
75
  flood_adapt/database_builder/templates/output_layers/bin_colors.toml,sha256=yN3_h2IimOyjtfhZ-ZoWyNa-2cAeFRNlbvaNTLhEMfA,417
77
76
  flood_adapt/dbs_classes/__init__.py,sha256=J-a6BEkjDhuUzzRKuAn_AtTg_D9wNIsmY3BnVTiC2JA,731
78
- flood_adapt/dbs_classes/database.py,sha256=iNf9nDm09gH9wdTO__CXmFKNr_IcHXbIscZLcDv7xQU,18390
79
- flood_adapt/dbs_classes/dbs_benefit.py,sha256=DDiVeXei8GGRs95gCd3B9NxcHwcWrcsrebnpqxMjvYU,2642
80
- flood_adapt/dbs_classes/dbs_event.py,sha256=LbkFbT5aHdfcSkvuHlaA1C0stEFhCjy6JiNIsbrowds,1848
81
- flood_adapt/dbs_classes/dbs_measure.py,sha256=tbhLkcly_gtofOpenidOPc993BZWxZHgM09cfEb09a4,4050
82
- flood_adapt/dbs_classes/dbs_projection.py,sha256=GAmyRmkSeRDwjFbAHAvKjNitESVpupIYjsFid1zjx0A,1041
83
- flood_adapt/dbs_classes/dbs_scenario.py,sha256=vjZJW8wHO7ixPsuwjTo63VEBrvPHWNsXCye6ZoAEzh0,4797
77
+ flood_adapt/dbs_classes/database.py,sha256=MJDpZN-9MGGWiD0CgKLxHTz6zkaPKQrRdbVd1LYjEFw,21210
78
+ flood_adapt/dbs_classes/dbs_benefit.py,sha256=BbEdx3_sNzqPu4T3AUwiDdf9OnbEtIb-sQui-dYpgLU,2671
79
+ flood_adapt/dbs_classes/dbs_event.py,sha256=7fxlJFih5qrKuqpBlcQ1mYOHCfWyLJytEuu5JkBDNrc,1885
80
+ flood_adapt/dbs_classes/dbs_measure.py,sha256=nEmq1kinc4l5d4LIxguzuXvCVYrWvFxX8maak8wIggw,4087
81
+ flood_adapt/dbs_classes/dbs_projection.py,sha256=lyiU_ctP2ixK28RKnBN6mVJbOuaDsWCj1y6-MHlyi_k,1078
82
+ flood_adapt/dbs_classes/dbs_scenario.py,sha256=hUvfGHw2LKmTFz2QeRijmTaalFrYap0gPK5QkNzuZfQ,4833
84
83
  flood_adapt/dbs_classes/dbs_static.py,sha256=FM_pMVFZK_7DV9D9LR7HY0ghOOcAIDV0GlepEYjtjKs,9842
85
- flood_adapt/dbs_classes/dbs_strategy.py,sha256=-vKIY42yXHvix6NC6I6N8hmDIZX5FvgcQOY3rrGswag,4891
86
- flood_adapt/dbs_classes/dbs_template.py,sha256=KAfn94pq8jQ4tEJJqBvEZiXL6Q1YAzz3Xd743a1i3XQ,10309
84
+ flood_adapt/dbs_classes/dbs_strategy.py,sha256=Pin0SXukdIdNwDBuM0XtqNsWUpM-gMoYy-ZfYNIs9Hw,4928
85
+ flood_adapt/dbs_classes/dbs_template.py,sha256=CTjDijAWjbs3u9wwFKigAfVlDZnduTtYDTFD_b78m4w,10384
87
86
  flood_adapt/dbs_classes/interface/database.py,sha256=kPHsmreB-vHaFD_FRXbP06tVs7pGxt4Rucim6aEqiKg,2550
88
87
  flood_adapt/dbs_classes/interface/element.py,sha256=XN3SjfEiAa4oZ61XJNnHkfKQu5Da42EH8PEkfosIJ9w,3528
89
88
  flood_adapt/dbs_classes/interface/static.py,sha256=jaFe9p80mkdafIw8qzOXm33M8hxm6OgNCCG0Rs0OEcc,1272
90
89
  flood_adapt/misc/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
91
90
  flood_adapt/misc/database_user.py,sha256=4PnXMNA0poQWWGc9FbmYAfJh5PhTMI3xzlCaIuP5wn4,546
92
91
  flood_adapt/misc/exceptions.py,sha256=xLT1QnbjClftzYaxX5XdvVAkoI0q1CAsWJX901GB9JM,513
93
- flood_adapt/misc/log.py,sha256=BPbJlU08PQ_fTEgIMr4cKJkASjs_-TIlDL9D12yG8WE,6731
92
+ flood_adapt/misc/log.py,sha256=aK5uJch8p3a4Js4f79tO5AM9yZvNlGPjHYPsY5EuWbc,6898
94
93
  flood_adapt/misc/path_builder.py,sha256=sLhvk3tq-QzI3fFjdzckpBYYZeuGyHBbuI0R98Tqud8,1396
95
94
  flood_adapt/misc/utils.py,sha256=-wOWgbDqswwGVYJARKfq-3L7DIs4OIHfrze5g3-qapU,5588
96
95
  flood_adapt/objects/__init__.py,sha256=gYGHCD9nqQnLCP-iZv_Ed_-sAbGNltOV7A-RdmRY39s,2088
@@ -101,8 +100,8 @@ flood_adapt/objects/events/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJ
101
100
  flood_adapt/objects/events/event_factory.py,sha256=CYq8itWurILPGNSDtWKWV5FF4UxjrRFiza6w2OQJEdU,4276
102
101
  flood_adapt/objects/events/event_set.py,sha256=fpmNbrd3qXWPgyqphv_Rf2iNsZCLvwz6YEbjMV7WIXA,2810
103
102
  flood_adapt/objects/events/events.py,sha256=xuZsmew4oG2TTh7M3lRLr0z2k-T-XU2ahbi-l_uPNGY,8341
104
- flood_adapt/objects/events/historical.py,sha256=rnutGsi_S3WaSKUD7nB7GzSmGUOoToPL4V_M4kCMxiE,1858
105
- flood_adapt/objects/events/hurricane.py,sha256=UFbw8_DvxuY0_nEqpFfW3op6NWOApbTlN6BgwCAP_yI,2330
103
+ flood_adapt/objects/events/historical.py,sha256=uIQ7icy9F3pOW0R-fBqjEjU857SGlJO81S104mzvtLY,2081
104
+ flood_adapt/objects/events/hurricane.py,sha256=dOPMa5c4mz1umLne9ydkBqnLTig9D95LmPHSFE5wit8,2401
106
105
  flood_adapt/objects/events/synthetic.py,sha256=Q8OHbBumeEwbrzA1imBrxiGiB92RWyigVcGVUbisSh4,1366
107
106
  flood_adapt/objects/forcing/__init__.py,sha256=wzPrflMLiEolocs3UcLeg05u5ydMDhF00jEf9zsC76c,2141
108
107
  flood_adapt/objects/forcing/csv.py,sha256=AMHlE5K_QiMOqD2pRRbG4ojnZ9VPiQjtk2wMFSouKjk,2027
@@ -111,7 +110,7 @@ flood_adapt/objects/forcing/forcing.py,sha256=VH-ajgCe6-A8nu_33k9QKg9QAYsNXjZT8s
111
110
  flood_adapt/objects/forcing/forcing_factory.py,sha256=lpugKlMt0MN8BxyykottMOuQd_fp1MHrkuuqbHWWdRY,5965
112
111
  flood_adapt/objects/forcing/meteo_handler.py,sha256=6IKegetPUH_GTzIHKVZBNpZFLs0yx4UGGuyO1vIjR34,3380
113
112
  flood_adapt/objects/forcing/netcdf.py,sha256=ZBzFtN5joVs36lVjvYErVaHEylUQ6eKIhR0uk_MD-zM,1388
114
- flood_adapt/objects/forcing/plotting.py,sha256=K3_Sf-qe7jq1AmDbsvFzwkhinlQsk09I2rFeW1kuzvI,15488
113
+ flood_adapt/objects/forcing/plotting.py,sha256=z612jv_9aRyK6cUm181vXFhihWz5XX_c6UDQg8rU02o,14804
115
114
  flood_adapt/objects/forcing/rainfall.py,sha256=e6P3IMzItvnsmXbcMXl1oV-d9LDuh3jTIc_vt6Kz5zo,3282
116
115
  flood_adapt/objects/forcing/tide_gauge.py,sha256=AcZ1e3C5w1I2YXcwMToNJkdXIRa-EmBS7DlsaEBMvSY,7207
117
116
  flood_adapt/objects/forcing/time_frame.py,sha256=1X3G0Ax18BHRvAomf-CW_ISRk_3qgAakwgZCIBxIkL4,2855
@@ -133,8 +132,8 @@ flood_adapt/workflows/benefit_runner.py,sha256=VtYt0sHFymNyErpzOtuN55cKJGVm5hT2a
133
132
  flood_adapt/workflows/floodmap.py,sha256=8PMd9PBep4nkrOtavW_UXeLU15J7AZMk1QEonQxVNk0,3017
134
133
  flood_adapt/workflows/impacts_integrator.py,sha256=zPJrb3Fm6gXPCmlA3vMh-2nmIwH_DWGrJGS1BUDqHLU,2495
135
134
  flood_adapt/workflows/scenario_runner.py,sha256=o6x_p7oF0apmo6Zq-_4uBXVeL6saRJZlIX6lTCPN2Rc,2984
136
- flood_adapt-0.3.11.dist-info/LICENSE,sha256=IwGE9guuL-ryRPEKi6wFPI_zOhg7zDZbTYuHbSt_SAk,35823
137
- flood_adapt-0.3.11.dist-info/METADATA,sha256=TNhqi_1Yfw4a0axhR5x4WY4sNDNoB5Vxv9vOUPhuOvg,52578
138
- flood_adapt-0.3.11.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
139
- flood_adapt-0.3.11.dist-info/top_level.txt,sha256=JvzMi6cTcQPEThCfpgMEeVny3ghI1urSH0CCgVIqSzw,12
140
- flood_adapt-0.3.11.dist-info/RECORD,,
135
+ flood_adapt-0.3.13.dist-info/LICENSE,sha256=IwGE9guuL-ryRPEKi6wFPI_zOhg7zDZbTYuHbSt_SAk,35823
136
+ flood_adapt-0.3.13.dist-info/METADATA,sha256=1xQzURHQA-NHJ_1-1PHgvWzqTH7w3Fbx2oauHHG43e0,52578
137
+ flood_adapt-0.3.13.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
138
+ flood_adapt-0.3.13.dist-info/top_level.txt,sha256=JvzMi6cTcQPEThCfpgMEeVny3ghI1urSH0CCgVIqSzw,12
139
+ flood_adapt-0.3.13.dist-info/RECORD,,
@@ -1,16 +0,0 @@
1
- from pathlib import Path
2
-
3
- from flood_adapt.database_builder.database_builder import ConfigModel, DatabaseBuilder
4
-
5
-
6
- def create_database(config_path: Path) -> None:
7
- """Create a new database from a configuration file or dictionary.
8
-
9
- Parameters
10
- ----------
11
- config : Path
12
- The path to the configuration file
13
- """
14
- config = ConfigModel.read(config_path)
15
-
16
- DatabaseBuilder(config=config).build()