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.
- flood_adapt/__init__.py +3 -2
- flood_adapt/adapter/fiat_adapter.py +44 -9
- flood_adapt/adapter/sfincs_adapter.py +173 -76
- flood_adapt/config/gui.py +1 -0
- flood_adapt/database_builder/__init__.py +23 -0
- flood_adapt/database_builder/database_builder.py +615 -362
- flood_adapt/database_builder/templates/infographics/OSM/config_charts.toml +2 -2
- flood_adapt/database_builder/templates/infographics/OSM/config_roads.toml +1 -1
- flood_adapt/database_builder/templates/infographics/US_NSI/config_roads.toml +1 -1
- flood_adapt/dbs_classes/database.py +62 -3
- flood_adapt/dbs_classes/dbs_benefit.py +1 -0
- flood_adapt/dbs_classes/dbs_event.py +1 -0
- flood_adapt/dbs_classes/dbs_measure.py +1 -0
- flood_adapt/dbs_classes/dbs_projection.py +1 -0
- flood_adapt/dbs_classes/dbs_scenario.py +1 -0
- flood_adapt/dbs_classes/dbs_strategy.py +1 -0
- flood_adapt/dbs_classes/dbs_template.py +2 -1
- flood_adapt/misc/log.py +20 -12
- flood_adapt/objects/events/historical.py +3 -3
- flood_adapt/objects/events/hurricane.py +1 -1
- flood_adapt/objects/forcing/plotting.py +7 -34
- {flood_adapt-0.3.11.dist-info → flood_adapt-0.3.13.dist-info}/METADATA +1 -1
- {flood_adapt-0.3.11.dist-info → flood_adapt-0.3.13.dist-info}/RECORD +26 -27
- flood_adapt/database_builder.py +0 -16
- {flood_adapt-0.3.11.dist-info → flood_adapt-0.3.13.dist-info}/LICENSE +0 -0
- {flood_adapt-0.3.11.dist-info → flood_adapt-0.3.13.dist-info}/WHEEL +0 -0
- {flood_adapt-0.3.11.dist-info → flood_adapt-0.3.13.dist-info}/top_level.txt +0 -0
|
@@ -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)
|
|
@@ -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.
|
|
@@ -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
|
-
|
|
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(
|
|
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,
|
|
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(
|
|
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
|
-
|
|
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(
|
|
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 =
|
|
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
|
-
|
|
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
|
-
|
|
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,
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
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=
|
|
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=
|
|
6
|
-
flood_adapt/adapter/sfincs_adapter.py,sha256=
|
|
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=
|
|
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=
|
|
20
|
-
flood_adapt/database_builder/database_builder.py,sha256=
|
|
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=
|
|
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=
|
|
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=
|
|
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=
|
|
79
|
-
flood_adapt/dbs_classes/dbs_benefit.py,sha256=
|
|
80
|
-
flood_adapt/dbs_classes/dbs_event.py,sha256=
|
|
81
|
-
flood_adapt/dbs_classes/dbs_measure.py,sha256=
|
|
82
|
-
flood_adapt/dbs_classes/dbs_projection.py,sha256=
|
|
83
|
-
flood_adapt/dbs_classes/dbs_scenario.py,sha256=
|
|
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
|
|
86
|
-
flood_adapt/dbs_classes/dbs_template.py,sha256=
|
|
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=
|
|
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=
|
|
105
|
-
flood_adapt/objects/events/hurricane.py,sha256=
|
|
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=
|
|
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.
|
|
137
|
-
flood_adapt-0.3.
|
|
138
|
-
flood_adapt-0.3.
|
|
139
|
-
flood_adapt-0.3.
|
|
140
|
-
flood_adapt-0.3.
|
|
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,,
|
flood_adapt/database_builder.py
DELETED
|
@@ -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()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|