NREL-erad 0.0.0a0__py3-none-any.whl → 0.1.1__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.
- erad/__init__.py +1 -0
- erad/constants.py +80 -11
- erad/default_fragility_curves/__init__.py +15 -0
- erad/default_fragility_curves/default_fire_boundary_dist.py +94 -0
- erad/default_fragility_curves/default_flood_depth.py +108 -0
- erad/default_fragility_curves/default_flood_velocity.py +101 -0
- erad/default_fragility_curves/default_fragility_curves.py +23 -0
- erad/default_fragility_curves/default_peak_ground_acceleration.py +163 -0
- erad/default_fragility_curves/default_peak_ground_velocity.py +94 -0
- erad/default_fragility_curves/default_wind_speed.py +94 -0
- erad/enums.py +40 -0
- erad/gdm_mapping.py +83 -0
- erad/models/__init__.py +1 -0
- erad/models/asset.py +300 -0
- erad/models/asset_mapping.py +20 -0
- erad/models/edit_store.py +22 -0
- erad/models/fragility_curve.py +116 -0
- erad/models/hazard/__init__.py +5 -0
- erad/models/hazard/base_models.py +12 -0
- erad/models/hazard/common.py +26 -0
- erad/models/hazard/earthquake.py +93 -0
- erad/models/hazard/flood.py +83 -0
- erad/models/hazard/wild_fire.py +121 -0
- erad/models/hazard/wind.py +143 -0
- erad/models/probability.py +76 -0
- erad/probability_builder.py +38 -0
- erad/quantities.py +31 -0
- erad/runner.py +125 -0
- erad/systems/__init__.py +2 -0
- erad/systems/asset_system.py +462 -0
- erad/systems/hazard_system.py +122 -0
- nrel_erad-0.1.1.dist-info/METADATA +61 -0
- nrel_erad-0.1.1.dist-info/RECORD +36 -0
- {NREL_erad-0.0.0a0.dist-info → nrel_erad-0.1.1.dist-info}/WHEEL +1 -1
- NREL_erad-0.0.0a0.dist-info/METADATA +0 -61
- NREL_erad-0.0.0a0.dist-info/RECORD +0 -42
- erad/cypher_queries/load_data_v1.cypher +0 -212
- erad/data/World_Earthquakes_1960_2016.csv +0 -23410
- erad/db/__init__.py +0 -0
- erad/db/assets/__init__.py +0 -0
- erad/db/assets/critical_infras.py +0 -171
- erad/db/assets/distribution_lines.py +0 -101
- erad/db/credential_model.py +0 -20
- erad/db/disaster_input_model.py +0 -23
- erad/db/inject_earthquake.py +0 -52
- erad/db/inject_flooding.py +0 -53
- erad/db/neo4j_.py +0 -162
- erad/db/utils.py +0 -14
- erad/exceptions.py +0 -68
- erad/metrics/__init__.py +0 -0
- erad/metrics/check_microgrid.py +0 -208
- erad/metrics/metric.py +0 -178
- erad/programs/__init__.py +0 -0
- erad/programs/backup.py +0 -62
- erad/programs/microgrid.py +0 -45
- erad/scenarios/__init__.py +0 -0
- erad/scenarios/abstract_scenario.py +0 -103
- erad/scenarios/common.py +0 -93
- erad/scenarios/earthquake_scenario.py +0 -161
- erad/scenarios/fire_scenario.py +0 -160
- erad/scenarios/flood_scenario.py +0 -494
- erad/scenarios/utilities.py +0 -76
- erad/scenarios/wind_scenario.py +0 -89
- erad/utils/__init__.py +0 -0
- erad/utils/ditto_utils.py +0 -252
- erad/utils/hifld_utils.py +0 -147
- erad/utils/opendss_utils.py +0 -357
- erad/utils/overpass.py +0 -76
- erad/utils/util.py +0 -178
- erad/visualization/__init__.py +0 -0
- erad/visualization/plot_graph.py +0 -218
- {NREL_erad-0.0.0a0.dist-info → nrel_erad-0.1.1.dist-info/licenses}/LICENSE.txt +0 -0
- {NREL_erad-0.0.0a0.dist-info → nrel_erad-0.1.1.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,122 @@
|
|
1
|
+
from infrasys import System
|
2
|
+
|
3
|
+
from gdm.distribution.enums import PlotingStyle, MapType
|
4
|
+
import plotly.graph_objects as go
|
5
|
+
|
6
|
+
from erad.default_fragility_curves import DEFAULT_FRAGILTY_CURVES
|
7
|
+
from erad.constants import HAZARD_MODELS
|
8
|
+
import erad.models.fragility_curve as fc
|
9
|
+
import erad.models.hazard as hz
|
10
|
+
|
11
|
+
|
12
|
+
class HazardSystem(System):
|
13
|
+
def __init__(self, *args, **kwargs):
|
14
|
+
super().__init__(*args, **kwargs)
|
15
|
+
|
16
|
+
def add_component(self, component, **kwargs):
|
17
|
+
assert isinstance(
|
18
|
+
component, HAZARD_MODELS
|
19
|
+
), f"Unsupported model type {component.__class__.__name__}"
|
20
|
+
return super().add_component(component, **kwargs)
|
21
|
+
|
22
|
+
def add_components(self, *components, **kwargs):
|
23
|
+
assert all(isinstance(component, HAZARD_MODELS) for component in components), (
|
24
|
+
"Unsupported model types in passed component. Valid types are: \n"
|
25
|
+
+ "\n".join([s.__name__ for s in HAZARD_MODELS])
|
26
|
+
+ "\nPassed components: \n"
|
27
|
+
+ "\n".join(set([component.__class__.__name__ for component in components]))
|
28
|
+
)
|
29
|
+
return super().add_components(*components, **kwargs)
|
30
|
+
|
31
|
+
def to_json(self, filename, overwrite=False, indent=None, data=None):
|
32
|
+
if not list(self.get_components(fc.HazardFragilityCurves)):
|
33
|
+
self.add_components(*DEFAULT_FRAGILTY_CURVES)
|
34
|
+
return super().to_json(filename, overwrite, indent, data)
|
35
|
+
|
36
|
+
@classmethod
|
37
|
+
def fire_example(cls) -> "HazardSystem":
|
38
|
+
hazard = hz.FireModel.example()
|
39
|
+
system = HazardSystem(auto_add_composed_components=True)
|
40
|
+
system.add_component(hazard)
|
41
|
+
return system
|
42
|
+
|
43
|
+
@classmethod
|
44
|
+
def wind_example(cls) -> "HazardSystem":
|
45
|
+
hazard = hz.WindModel.example()
|
46
|
+
system = HazardSystem(auto_add_composed_components=True)
|
47
|
+
system.add_component(hazard)
|
48
|
+
return system
|
49
|
+
|
50
|
+
@classmethod
|
51
|
+
def earthquake_example(cls) -> "HazardSystem":
|
52
|
+
hazard = hz.EarthQuakeModel.example()
|
53
|
+
system = HazardSystem(auto_add_composed_components=True)
|
54
|
+
system.add_component(hazard)
|
55
|
+
return system
|
56
|
+
|
57
|
+
@classmethod
|
58
|
+
def flood_example(cls) -> "HazardSystem":
|
59
|
+
hazard = hz.FloodModel.example()
|
60
|
+
system = HazardSystem(auto_add_composed_components=True)
|
61
|
+
system.add_component(hazard)
|
62
|
+
return system
|
63
|
+
|
64
|
+
@classmethod
|
65
|
+
def multihazard_example(cls) -> "HazardSystem":
|
66
|
+
wind_hazard = hz.WindModel.example()
|
67
|
+
flood_hazard = hz.FloodModel.example()
|
68
|
+
system = HazardSystem(auto_add_composed_components=True)
|
69
|
+
system.add_component(wind_hazard)
|
70
|
+
system.add_component(flood_hazard)
|
71
|
+
return system
|
72
|
+
|
73
|
+
def plot(
|
74
|
+
self,
|
75
|
+
show: bool = True,
|
76
|
+
show_legend: bool = True,
|
77
|
+
map_type: MapType = MapType.SCATTER_MAP,
|
78
|
+
style: PlotingStyle = PlotingStyle.CARTO_POSITRON,
|
79
|
+
zoom_level: int = 11,
|
80
|
+
figure=go.Figure(),
|
81
|
+
):
|
82
|
+
timestamps = sorted(
|
83
|
+
[model.timestamp for model in self.get_components(hz.BaseDisasterModel)]
|
84
|
+
)
|
85
|
+
|
86
|
+
steps = []
|
87
|
+
for i, ts in enumerate(timestamps):
|
88
|
+
hazards = self.get_components(
|
89
|
+
hz.BaseDisasterModel, filter_func=lambda x: x.timestamp == ts
|
90
|
+
)
|
91
|
+
map_obj = getattr(go, map_type.value)
|
92
|
+
num_traces = 0
|
93
|
+
for hazard in hazards:
|
94
|
+
num_traces += hazard.plot(i, figure, map_obj)
|
95
|
+
vis = [j == i for j in range(len(timestamps))]
|
96
|
+
result = [x for x in vis for _ in range(num_traces)]
|
97
|
+
steps.append(dict(method="update", label=str(ts), args=[{"visible": result}]))
|
98
|
+
|
99
|
+
sliders = [dict(active=0, pad={"t": 50}, steps=steps)]
|
100
|
+
|
101
|
+
if map_type == MapType.SCATTER_MAP:
|
102
|
+
figure.update_layout(
|
103
|
+
map={
|
104
|
+
"style": style.value,
|
105
|
+
"zoom": zoom_level,
|
106
|
+
},
|
107
|
+
sliders=sliders,
|
108
|
+
showlegend=True if show_legend else False,
|
109
|
+
)
|
110
|
+
else:
|
111
|
+
figure.update_layout(
|
112
|
+
geo=dict(
|
113
|
+
projection_scale=zoom_level,
|
114
|
+
),
|
115
|
+
sliders=sliders,
|
116
|
+
showlegend=True if show_legend else False,
|
117
|
+
)
|
118
|
+
|
119
|
+
if show:
|
120
|
+
figure.show()
|
121
|
+
|
122
|
+
return figure
|
@@ -0,0 +1,61 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: NREL-erad
|
3
|
+
Version: 0.1.1
|
4
|
+
Summary: Graph based scalable tool for computing energy resilience metrics for distribution systems.
|
5
|
+
Author-email: Kapil Duwadi <kapil.duwadi@nrel.gov>, Aadil Latif <aadil.altif@nrel.gov>, Kwami Sedzro <sherinann.abraham@nrel.gov>, Sherin Ann Abraham <kwami.sedzro@nrel.gov>, Bryan Palmintier <bryan.palmintier@nrel.gov>
|
6
|
+
Maintainer-email: Aadil Latif <Aadil.Latif@nrel.gov>
|
7
|
+
Project-URL: Homepage, https://github.com/nrel/erad
|
8
|
+
Keywords: Distribution,Earthquake,Energy,Fire,Flooding,Power,Python,Resilience,Systems
|
9
|
+
Classifier: License :: OSI Approved :: BSD License
|
10
|
+
Classifier: Operating System :: OS Independent
|
11
|
+
Classifier: Programming Language :: Python :: 3.8
|
12
|
+
Requires-Python: >=3.11
|
13
|
+
Description-Content-Type: text/markdown
|
14
|
+
License-File: LICENSE.txt
|
15
|
+
Requires-Dist: grid-data-models~=2.1.3
|
16
|
+
Requires-Dist: gdmloader
|
17
|
+
Requires-Dist: geopandas
|
18
|
+
Requires-Dist: requests
|
19
|
+
Requires-Dist: shapely
|
20
|
+
Requires-Dist: pandas
|
21
|
+
Requires-Dist: pyhigh
|
22
|
+
Requires-Dist: geopy
|
23
|
+
Requires-Dist: scipy
|
24
|
+
Provides-Extra: dev
|
25
|
+
Requires-Dist: black; extra == "dev"
|
26
|
+
Requires-Dist: mkdocs; extra == "dev"
|
27
|
+
Requires-Dist: mkdocs-jupyter; extra == "dev"
|
28
|
+
Requires-Dist: mkdocs-material; extra == "dev"
|
29
|
+
Requires-Dist: mkdocstrings[python]; extra == "dev"
|
30
|
+
Requires-Dist: pylint; extra == "dev"
|
31
|
+
Requires-Dist: pytest; extra == "dev"
|
32
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
33
|
+
Requires-Dist: ruff; extra == "dev"
|
34
|
+
Provides-Extra: doc
|
35
|
+
Requires-Dist: sphinx; extra == "doc"
|
36
|
+
Requires-Dist: pydata-sphinx-theme; extra == "doc"
|
37
|
+
Requires-Dist: myst-parser; extra == "doc"
|
38
|
+
Requires-Dist: autodoc_pydantic; extra == "doc"
|
39
|
+
Requires-Dist: sphinxcontrib-mermaid; extra == "doc"
|
40
|
+
Dynamic: license-file
|
41
|
+
|
42
|
+
# ERAD (<u>E</u>nergy <u>R</u>esilience <u>A</u>nalysis for electric <u>D</u>istribution systems)
|
43
|
+
<p align="center">
|
44
|
+
<img src="docs/images/logo.svg" width="250" style="display:flex;justify-content:center;">
|
45
|
+
<p align="center">Graph based python tool for computing energy resilience. </p>
|
46
|
+
</p>
|
47
|
+
|
48
|
+

|
49
|
+

|
50
|
+
[](https://www.codefactor.io/repository/github/nrel/erad)
|
51
|
+
[](https://github.com/NREL/erad/blob/main/LICENSE.txt)
|
52
|
+
[](https://github.com/NREL/erad/issues)
|
53
|
+

|
54
|
+
|
55
|
+
[Visit full documentation here.](https://nrel.github.io/erad/)
|
56
|
+
|
57
|
+
Understanding the impact of disaster events on people's ability to access critical service is key to designing appropriate programs to minimize the overall impact. Flooded roads, downed power lines, flooded power substation etc. could impact access to critical services like electricity, food, health and more. The field of disaster modeling is still evolving and so is our understanding of how these events would impact our critical infrastructures such power grid, hospitals, groceries, banks etc.
|
58
|
+
|
59
|
+
ERAD is a free, open-source Python toolkit for computing energy resilience measures in the face of hazards like earthquakes and flooding. It uses graph database to store data and perform computation at the household level for a variety of critical services that are connected by power distribution network. It uses asset fragility curves, which are functions that relate hazard severity to survival probability for power system assets including cables, transformers, substations, roof-mounted solar panels, etc. recommended in top literature. Programs like undergrounding, microgrid, and electricity backup units for critical infrastructures may all be evaluated using metrics and compared across different neighborhoods to assess their effects on energy resilience.
|
60
|
+
|
61
|
+
ERAD is designed to be used by researchers, students, community stakeholders, distribution utilities to understand and possibly evaluate effectiveness of different post disaster programs to improve energy resilience. It was funded by National Renewable Energy Laboratory (NREL) and made publicly available with open license.
|
@@ -0,0 +1,36 @@
|
|
1
|
+
erad/__init__.py,sha256=sXLh7g3KC4QCFxcZGBTpG2scR7hmmBsMjq6LqRptkRg,22
|
2
|
+
erad/constants.py,sha256=YEbmM-fV4C_4hdUtt-y2tvq0Rr4tev3nqDr3K3-Nvvo,2395
|
3
|
+
erad/enums.py,sha256=w4sPPIwOyjFsw9NCZy13NmH4nQWkWaDlqnP_BdNrrxI,916
|
4
|
+
erad/gdm_mapping.py,sha256=Ur6-vJpxrRhLszJuSv7AjMotyqZ9MRlz_5MArmBE6LQ,2937
|
5
|
+
erad/probability_builder.py,sha256=4eePibGlUFiSKtsfASdDq9eHtJO5s3CN4UosO2tLqNg,1457
|
6
|
+
erad/quantities.py,sha256=znguUBYvGT-9_hWCnUuZ9Oib6ky3TMIpbSLJ_ZAtwcU,583
|
7
|
+
erad/runner.py,sha256=O8xQDWIE5PZsd1AjOm-4xGVbKzfiktjOdKeSgnlvRII,4781
|
8
|
+
erad/default_fragility_curves/__init__.py,sha256=TEoZ01NIb1uIAs6AF0V1NJaPBA7FcYtQ5379Frwty5M,778
|
9
|
+
erad/default_fragility_curves/default_fire_boundary_dist.py,sha256=KX_pmJ9yyOqSavzRWk1cgkHbqyxAGmu8GCke9wh48YI,3623
|
10
|
+
erad/default_fragility_curves/default_flood_depth.py,sha256=uy4aAKqDNfsXQq1LKYViQhPIeq0EiO8Y_i3Ow3K5p6E,4208
|
11
|
+
erad/default_fragility_curves/default_flood_velocity.py,sha256=L0w9WH1cjounh8wHXii9DzgvvdDpe4jRs7m3AUrgPTM,4075
|
12
|
+
erad/default_fragility_curves/default_fragility_curves.py,sha256=uGQb0WhtgCyu_rNhh9UibJLdEELD1E28iUMQsLgSUpk,996
|
13
|
+
erad/default_fragility_curves/default_peak_ground_acceleration.py,sha256=cvjgm0jK7nEf0T8Tx0KyOyVPqnqj6GUTrKhqIIFZEK4,5695
|
14
|
+
erad/default_fragility_curves/default_peak_ground_velocity.py,sha256=-M6EWv5sq_M2FxQfad_kwORMk0RRfQVjNzNQo2NnKJA,3887
|
15
|
+
erad/default_fragility_curves/default_wind_speed.py,sha256=gtsNFJYcY2qA906lmFYTZDpxvfknk-kxuLgOId5-nLY,3915
|
16
|
+
erad/models/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
17
|
+
erad/models/asset.py,sha256=kidUQOiEc9fVsWX_PrA9lxD_9RAJM4Ha_tRUbCFmm4g,11828
|
18
|
+
erad/models/asset_mapping.py,sha256=vdqiraFo_Ssd4Se9YEne34TjW1MSCVErmLHFqJa96Nw,518
|
19
|
+
erad/models/edit_store.py,sha256=6UF1T4qhMzytIZCQBXNFac9hNQCX-E1l_2yBg768_E4,544
|
20
|
+
erad/models/fragility_curve.py,sha256=9K5q_VZVEqNKSPIcmrD2uhF9ClZ7p57oKY4jtxyu9tc,3725
|
21
|
+
erad/models/probability.py,sha256=7QfeU_tWEssg1j6b04r4LXzG9PUFem6ogLlMBwQZAWE,1985
|
22
|
+
erad/models/hazard/__init__.py,sha256=3PacFmU_iIxZRLiIvcRCXJLUDdgHputUEnuvQvJ8VNM,295
|
23
|
+
erad/models/hazard/base_models.py,sha256=nZndeKYIJrn_FDyDIfpfnGQiHdoXBz_mAtBn61iW4bY,423
|
24
|
+
erad/models/hazard/common.py,sha256=FIGPD8w3hsFyK_J99Wyp2p2KsC1McmtXD4zIrtqLjYM,815
|
25
|
+
erad/models/hazard/earthquake.py,sha256=OOKpl2g1PVOYdRIj1Gmi3F8sGc9Lhsquzs7-etrTjuI,3194
|
26
|
+
erad/models/hazard/flood.py,sha256=ScmqKu_ChbsfHWZy5SrkVixevLOrcQPY2eGlzOaWAio,2717
|
27
|
+
erad/models/hazard/wild_fire.py,sha256=hjlp_AI4I1P00F_p0N4pYVdTAmrBr4F4kXKvpmMGWoM,4110
|
28
|
+
erad/models/hazard/wind.py,sha256=YNmXnxMpNWb45UwPheQqC5PCaVN8wdnLLp8jQZjMHuw,5187
|
29
|
+
erad/systems/__init__.py,sha256=TYQ44-fJ0REaEg0I4RClxPK0BZTuvVlSEqmrh_xqTAs,102
|
30
|
+
erad/systems/asset_system.py,sha256=K1ZdzpWWClbQj7T-OFVC6kbGKPpptvi_dQyZDREpgrc,19449
|
31
|
+
erad/systems/hazard_system.py,sha256=DczPyuoz_YGBiMWHJjQVaI9q4aXofmNQPKuxSnhDR2Y,4322
|
32
|
+
nrel_erad-0.1.1.dist-info/licenses/LICENSE.txt,sha256=YhE40B_XkokpkrkfYYs75IWapyRMl_Jdo__vzVWO7eY,1571
|
33
|
+
nrel_erad-0.1.1.dist-info/METADATA,sha256=bSddrNZwgBVoy52DkJ_COmRJO31mhDajQCadC-FwTjk,4357
|
34
|
+
nrel_erad-0.1.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
35
|
+
nrel_erad-0.1.1.dist-info/top_level.txt,sha256=TR5AAzfVy08tAhcPCsDnwvQuVJ2oXZ334IFTb3iHj-k,5
|
36
|
+
nrel_erad-0.1.1.dist-info/RECORD,,
|
@@ -1,61 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.1
|
2
|
-
Name: NREL-erad
|
3
|
-
Version: 0.0.0a0
|
4
|
-
Summary: Graph based scalable tool for computing equitable resilience metrics for distribution systems.
|
5
|
-
Home-page: https://github.com/nrel/erad
|
6
|
-
Author: Kapil Duwadi, Aadil Latif, Kwami Sedzro, Sherin Ann Abraham, Bryan Palmintier
|
7
|
-
Author-email: kapil.duwadi@nrel.gov, aadil.altif@nrel.gov, sherinann.abraham@nrel.gov, kwami.sedzro@nrel.gov, bryan.palmintier@nrel.gov
|
8
|
-
Keywords: Resilience,Equity,Python,Power Distribution Systems,Earthquake,Flooding,Fire
|
9
|
-
Classifier: License :: OSI Approved :: BSD License
|
10
|
-
Classifier: Programming Language :: Python :: 3.8
|
11
|
-
Classifier: Operating System :: OS Independent
|
12
|
-
Requires-Python: >=3.8
|
13
|
-
Description-Content-Type: text/markdown
|
14
|
-
License-File: LICENSE.txt
|
15
|
-
Requires-Dist: pytest
|
16
|
-
Requires-Dist: networkx
|
17
|
-
Requires-Dist: pyyaml
|
18
|
-
Requires-Dist: geojson
|
19
|
-
Requires-Dist: neo4j-driver
|
20
|
-
Requires-Dist: python-dotenv
|
21
|
-
Requires-Dist: ditto.py
|
22
|
-
Requires-Dist: boto3
|
23
|
-
Requires-Dist: botocore
|
24
|
-
Requires-Dist: OpenDSSDirect.py
|
25
|
-
Requires-Dist: pandas
|
26
|
-
Requires-Dist: matplotlib
|
27
|
-
Requires-Dist: plotly
|
28
|
-
Requires-Dist: shapely
|
29
|
-
Requires-Dist: jupyter
|
30
|
-
Requires-Dist: geopandas
|
31
|
-
Requires-Dist: stateplane
|
32
|
-
Requires-Dist: graphdatascience
|
33
|
-
Requires-Dist: scipy
|
34
|
-
Requires-Dist: geopy
|
35
|
-
Requires-Dist: rasterio
|
36
|
-
Requires-Dist: xmltodict
|
37
|
-
Requires-Dist: pydantic
|
38
|
-
Requires-Dist: requests
|
39
|
-
Provides-Extra: dev
|
40
|
-
Requires-Dist: mkdocs ; extra == 'dev'
|
41
|
-
Requires-Dist: mkdocstrings[python] ; extra == 'dev'
|
42
|
-
Requires-Dist: mkdocs-material ; extra == 'dev'
|
43
|
-
Requires-Dist: mkdocs-jupyter ; extra == 'dev'
|
44
|
-
Requires-Dist: pylint ; extra == 'dev'
|
45
|
-
Requires-Dist: black ; extra == 'dev'
|
46
|
-
|
47
|
-
# ERAD (Equitable Resilience Analysis For Power Distribution System)
|
48
|
-
<p align="center">
|
49
|
-
<img src="logo.svg" width="250" style="display:flex;justify-content:center;">
|
50
|
-
<p align="center">Graph based python tool for computing equitable resilience. </p>
|
51
|
-
</p>
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
[Visit full documentation here.](https://nrel.github.io/erad/)
|
56
|
-
|
57
|
-
Understanding the impact of disaster events on people's ability to access critical service is key to designing appropriate programs to minimize the overall impact. Flooded roads, downed power lines, flooded power substation etc. could impact access to critical servies like electricity, food, health and more. The field of disaster modeling is still evolving and so is our understanding of how these events would impact our critical infrastrctures such power grid, hospitals, groceries, banks etc.
|
58
|
-
|
59
|
-
ERAD is a free, open-source Python toolkit for computing equity and resilience measures in the face of hazards like earthquakes and flooding. It uses graph database to store data and perform computation at the household level for a variety of critical services that are connected by power distribution network. It uses asset fragility curves, which are functions that relate hazard severity to survival probability for power system assets including cables, transformers, substations, roof-mounted solar panels, etc. recommended in top literature. Programs like undergrounding, microgrid, and electricity backup units for critical infrastructures may all be evaluated using metrics and compared across different neighborhoods to assess their effects on equity and resilience.
|
60
|
-
|
61
|
-
ERAD is designed to be used by researchers, students, community stakeholders, distribution utilities to understand and possibly evaluate effectiveness of different post disaster programs to improve resilience and equity. It was funded by National Renewable Energy Laboratory (NREL) and made publicy available with open license.
|
@@ -1,42 +0,0 @@
|
|
1
|
-
erad/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
-
erad/constants.py,sha256=ez019GSfgtzBoewDqMdMQ-5Sv_QCZ4w5rSUHyo50YXw,719
|
3
|
-
erad/exceptions.py,sha256=D58HiKlePKLgNgF4bTfA9Wpup4_oazH5y6R_0XGV_Po,2209
|
4
|
-
erad/cypher_queries/load_data_v1.cypher,sha256=pLwyaiil2bgJ3GSy0CLod1OcKR8SOroyNPS7iOM5jhE,8131
|
5
|
-
erad/data/World_Earthquakes_1960_2016.csv,sha256=FTzg7XibKB6TbCWnLdbpJxK2cCTqpfo80mBYHNL9VVc,2386121
|
6
|
-
erad/db/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
7
|
-
erad/db/credential_model.py,sha256=yFb4aii9C5U46_BNL0hXWSCsKFpxTrUvq-hTbSJopHg,591
|
8
|
-
erad/db/disaster_input_model.py,sha256=BVH_eqZ9Z6eUbuktK_AYUi06o6fsRQOUrWU95ULsXsI,637
|
9
|
-
erad/db/inject_earthquake.py,sha256=k4bcnFkzBYgveHnCjDDEwwkCpEBG2N0GjZuUKnqNkCU,1700
|
10
|
-
erad/db/inject_flooding.py,sha256=2c-BVAasG2Z4nULlXIuwHiMENi6PAH_AALlwQekfWM8,1769
|
11
|
-
erad/db/neo4j_.py,sha256=hBzXVxvVatiPZdLVsSgzQhHnbHDxEEZJoJ_P40YVYB8,5223
|
12
|
-
erad/db/utils.py,sha256=zbMVKShNK2uTrvQPIdDRlwZGIRdOAwbtGfkaG424piU,455
|
13
|
-
erad/db/assets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
14
|
-
erad/db/assets/critical_infras.py,sha256=6Gg39N-Z0L20OfC_1myFSGlohB6KALj7B2A7BPY4850,6072
|
15
|
-
erad/db/assets/distribution_lines.py,sha256=QuSJKdQZyNr6hdjVZYu50A8FCQJ4KMDWuj0rN6N26uY,3547
|
16
|
-
erad/metrics/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
17
|
-
erad/metrics/check_microgrid.py,sha256=5XHGsOB-p1z7PCVW1G8OB5Ev0BS1NXexmj-UOy3Szac,7688
|
18
|
-
erad/metrics/metric.py,sha256=Iyjj71FLWSvkOldK_HKvBLKDOzKNQh9qXi-K7urs4BQ,6147
|
19
|
-
erad/programs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
20
|
-
erad/programs/backup.py,sha256=-AXOMTsEi0G564A83HCVwnbu4oZjvY4ScaUcHB9nhdw,1971
|
21
|
-
erad/programs/microgrid.py,sha256=iLmwrOy0u75BH_Y7eQ6drasULW9DyFJuXfBNDIRbkqI,1670
|
22
|
-
erad/scenarios/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
23
|
-
erad/scenarios/abstract_scenario.py,sha256=_Bu6rDYXw7iQdkI6zg83kko_88V8u9HEytZDS0V_4EA,4267
|
24
|
-
erad/scenarios/common.py,sha256=SyqhD777TV9SiGxOVBC_YQvSHSpJEYRyEgAcLMW6Z4E,3022
|
25
|
-
erad/scenarios/earthquake_scenario.py,sha256=S95ezPnOFHSRAlyU66QlbQeP2fp7DrfPwVdGN-XxmPs,8717
|
26
|
-
erad/scenarios/fire_scenario.py,sha256=7L9HdSmZracW8cKS_6kyZmczk6JGehz6vnEHnj7AaPs,7244
|
27
|
-
erad/scenarios/flood_scenario.py,sha256=ElHd2rfJjrfjiC9gmr7i8ApdcujoypEQb4s0Ie6jWg4,20336
|
28
|
-
erad/scenarios/utilities.py,sha256=MJISX_TDItnvZOK1bJlcHSi455Ho4MgBk29tKn9zRRg,2753
|
29
|
-
erad/scenarios/wind_scenario.py,sha256=_2NsBsOqiZ5FskcprbK8OTwp5k4uYVx0o_LRpgaz34s,3946
|
30
|
-
erad/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
31
|
-
erad/utils/ditto_utils.py,sha256=Qm2_QLj0O2N_nFp9OQ1zWWWccM6jJ6j_C9yhXxMWhg8,8138
|
32
|
-
erad/utils/hifld_utils.py,sha256=IMqhxDZai-2_NrnMRXvzLPH9RF5kbAFDlXKTh2hh0PQ,4983
|
33
|
-
erad/utils/opendss_utils.py,sha256=MQOJjSRcfvCFcjsp9IFf8IocsfqtM0ZkFiDSyCTGqbg,10912
|
34
|
-
erad/utils/overpass.py,sha256=BiyEN7rDmrJmZ0u1ASiOHJGYf2aEo-Y0_UsWeHV8ERY,2106
|
35
|
-
erad/utils/util.py,sha256=OepMubsVYBj_aTmc_qoArsLZLnb9qFkUXMqODp7TE_U,5153
|
36
|
-
erad/visualization/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
37
|
-
erad/visualization/plot_graph.py,sha256=fIuicGN_P-ObQSvIwmzQUg9316ByEaOZqEQbinuUeHg,6777
|
38
|
-
NREL_erad-0.0.0a0.dist-info/LICENSE.txt,sha256=YhE40B_XkokpkrkfYYs75IWapyRMl_Jdo__vzVWO7eY,1571
|
39
|
-
NREL_erad-0.0.0a0.dist-info/METADATA,sha256=ZCpl782OD3xucSUpAyXJWxSYWOJOCT2-l77dUDIUXuY,3612
|
40
|
-
NREL_erad-0.0.0a0.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
41
|
-
NREL_erad-0.0.0a0.dist-info/top_level.txt,sha256=TR5AAzfVy08tAhcPCsDnwvQuVJ2oXZ334IFTb3iHj-k,5
|
42
|
-
NREL_erad-0.0.0a0.dist-info/RECORD,,
|
@@ -1,212 +0,0 @@
|
|
1
|
-
LOAD CSV WITH HEADERS FROM 'file:///buses.csv' AS bus_row
|
2
|
-
WITH bus_row WHERE bus_row.name IS NOT NULL
|
3
|
-
MERGE (bus:Bus {name: bus_row.name, longitude: toFloat(bus_row.longitude),
|
4
|
-
latitude: toFloat(bus_row.latitude)});
|
5
|
-
|
6
|
-
LOAD CSV WITH HEADERS FROM 'file:///loads.csv' AS load_row
|
7
|
-
WITH load_row WHERE load_row.name IS NOT NULL
|
8
|
-
MERGE (load:Load {name: load_row.name, kw: toFloat(load_row.kw),
|
9
|
-
kvar: toFloat(load_row.kvar), source: load_row.source,
|
10
|
-
critical_load_factor: toFloat(load_row.critical_load_factor)})
|
11
|
-
MERGE (load_bus:Bus {name: load_row.source})
|
12
|
-
MERGE (load)-[:CONSUMES_POWER_FROM]->(load_bus);
|
13
|
-
|
14
|
-
LOAD CSV WITH HEADERS FROM 'file:///line_sections.csv' AS line_row
|
15
|
-
WITH line_row WHERE line_row.name IS NOT NULL
|
16
|
-
MERGE (from_bus:Bus {name: line_row.source})
|
17
|
-
MERGE (to_bus:Bus {name: line_row.target})
|
18
|
-
MERGE (from_bus)-[:CONNECTS_TO {name: line_row.name, source: line_row.source,
|
19
|
-
target: line_row.target,ampacity: toFloat(line_row.ampacity),
|
20
|
-
height_m: toFloat(line_row.height_m), geom_type: line_row.geom_type}]->(to_bus);
|
21
|
-
|
22
|
-
LOAD CSV WITH HEADERS FROM 'file:///transformers.csv' AS xfmr_row
|
23
|
-
WITH xfmr_row WHERE xfmr_row.name IS NOT NULL
|
24
|
-
MERGE (from_bus:Bus {name: xfmr_row.source})
|
25
|
-
MERGE (to_bus:Bus {name: xfmr_row.target})
|
26
|
-
MERGE (from_bus)-[:CONNECTS_TO {name: xfmr_row.name, source: xfmr_row.source,
|
27
|
-
target: xfmr_row.target, kva: xfmr_row.kva,
|
28
|
-
height_m: toFloat(xfmr_row.height_m)}]->(to_bus);
|
29
|
-
|
30
|
-
|
31
|
-
LOAD CSV WITH HEADERS FROM 'file:///pv_systems.csv' AS pv_row
|
32
|
-
WITH pv_row WHERE pv_row.name IS NOT NULL
|
33
|
-
MERGE (sa:Solar {capacity: toFloat(pv_row.capacity),
|
34
|
-
name: pv_row.name, owner: pv_row.owner})
|
35
|
-
MERGE (ba:Bus {name: pv_row.bus})
|
36
|
-
MERGE (lo:Load {name: pv_row.owner})
|
37
|
-
MERGE (sa)-[:INJECTS_ACTIVE_POWER_TO]->(ba)
|
38
|
-
MERGE (lo)-[:OWNS]->(sa);
|
39
|
-
|
40
|
-
LOAD CSV WITH HEADERS FROM 'file:///energy_storage.csv' AS es_row
|
41
|
-
WITH es_row WHERE es_row.name IS NOT NULL
|
42
|
-
MERGE (ea:EnergyStorage {kw: toFloat(es_row.kw), name: es_row.name,
|
43
|
-
owner:es_row.owner})
|
44
|
-
MERGE (ba:Bus {name: es_row.bus})
|
45
|
-
MERGE (lo:Load {name: es_row.owner})
|
46
|
-
MERGE (ea)-[:INJECTS_POWER]->(ba)
|
47
|
-
MERGE (ba)-[:CONSUMES_POWER]->(ea)
|
48
|
-
MERGE (lo)-[:OWNS]->(ea);
|
49
|
-
|
50
|
-
LOAD CSV WITH HEADERS FROM 'file:///substation.csv' AS sub_row
|
51
|
-
WITH sub_row WHERE sub_row.name IS NOT NULL
|
52
|
-
MERGE (b:Bus {name: sub_row.name})
|
53
|
-
SET b:Substation;
|
54
|
-
|
55
|
-
MATCH (b:Bus)-[CONSUMES_POWER]-(c:Load)
|
56
|
-
SET c.longitude = b.longitude
|
57
|
-
SET c.latitude = b.latitude;
|
58
|
-
|
59
|
-
MATCH (c:Load)
|
60
|
-
WHERE c.latitude IS NULL
|
61
|
-
DETACH DELETE c;
|
62
|
-
|
63
|
-
LOAD CSV WITH HEADERS FROM 'file:///pharmacies.csv' AS p_row
|
64
|
-
WITH p_row WHERE p_row.name IS NOT NULL
|
65
|
-
MERGE (p:Pharmacy {name: (p_row.name + p_row.gid), source:p_row.source,
|
66
|
-
kw:toFloat(p_row.kw), kvar:toFloat(p_row.kvar),
|
67
|
-
backup_capacity_kw:toFloat(p_row.backup_capacity_kw),
|
68
|
-
backup: toInteger(p_row.backup),
|
69
|
-
longitude: toFloat(p_row.longitude), latitude: toFloat(p_row.latitude)})
|
70
|
-
WITH p
|
71
|
-
MATCH (lo:Load)
|
72
|
-
MERGE (lo)-[:VISITS_FOR_MEDICINE {distance: point.distance(
|
73
|
-
point({longitude: p.longitude, latitude:p.latitude}),
|
74
|
-
point({longitude: lo.longitude, latitude:lo.latitude})
|
75
|
-
)}]->(p);
|
76
|
-
|
77
|
-
MATCH (p:Pharmacy)
|
78
|
-
WITH p
|
79
|
-
MATCH (b:Bus {name: p.source})
|
80
|
-
MERGE (b)<-[:GETS_POWER_FROM]-(p);
|
81
|
-
|
82
|
-
LOAD CSV WITH HEADERS FROM 'file:///groceries.csv' AS g_row
|
83
|
-
WITH g_row WHERE g_row.name IS NOT NULL
|
84
|
-
MERGE (g:Grocery {name: (g_row.name + g_row.gid), source:g_row.source,
|
85
|
-
kw:toFloat(g_row.kw), kvar:toFloat(g_row.kvar),
|
86
|
-
backup_capacity_kw:toFloat(g_row.backup_capacity_kw),
|
87
|
-
backup: toInteger(g_row.backup),
|
88
|
-
longitude: toFloat(g_row.longitude), latitude: toFloat(g_row.latitude)})
|
89
|
-
WITH g
|
90
|
-
MATCH (lo:Load)
|
91
|
-
MERGE (lo)-[:VISITS_FOR_GROCERIES {distance: point.distance(
|
92
|
-
point({longitude: g.longitude, latitude:g.latitude}),
|
93
|
-
point({longitude: lo.longitude, latitude:lo.latitude})
|
94
|
-
)}]->(g);
|
95
|
-
|
96
|
-
MATCH (g:Grocery)
|
97
|
-
WITH g
|
98
|
-
MATCH (b:Bus {name: g.source})
|
99
|
-
MERGE (b)<-[:GETS_POWER_FROM]-(g);
|
100
|
-
|
101
|
-
LOAD CSV WITH HEADERS FROM 'file:///medical_centers.csv' AS m_row
|
102
|
-
WITH m_row WHERE m_row.name IS NOT NULL
|
103
|
-
MERGE (m:Hospital {name: (m_row.name + m_row.gid),
|
104
|
-
source:m_row.source, kw:toFloat(m_row.kw), kvar:toFloat(m_row.kvar),
|
105
|
-
backup_capacity_kw:toFloat(m_row.backup_capacity_kw),
|
106
|
-
longitude: toFloat(m_row.longitude),
|
107
|
-
latitude: toFloat(m_row.latitude), backup: toInteger(m_row.backup)})
|
108
|
-
WITH m
|
109
|
-
MATCH (lo:Load)
|
110
|
-
MERGE (lo)-[:VISITS_DURING_HEALTH_EMERGENCY {distance: point.distance(
|
111
|
-
point({longitude: m.longitude, latitude:m.latitude}),
|
112
|
-
point({longitude: lo.longitude, latitude:lo.latitude})
|
113
|
-
)}]->(m);
|
114
|
-
|
115
|
-
MATCH (h:Hospital)
|
116
|
-
WITH h
|
117
|
-
MATCH (b:Bus {name: h.source})
|
118
|
-
MERGE (b)<-[:GETS_POWER_FROM]-(h);
|
119
|
-
|
120
|
-
LOAD CSV WITH HEADERS FROM 'file:///banking.csv' AS b_row
|
121
|
-
WITH b_row WHERE b_row.name IS NOT NULL
|
122
|
-
MERGE (b:Banking {name: (b_row.name + b_row.gid),
|
123
|
-
source: b_row.source,kw:toFloat(b_row.kw), kvar:toFloat(b_row.kvar),
|
124
|
-
backup_capacity_kw:toFloat(b_row.backup_capacity_kw),
|
125
|
-
backup: toInteger(b_row.backup),
|
126
|
-
longitude: toFloat(b_row.longitude), latitude: toFloat(b_row.latitude)})
|
127
|
-
WITH b
|
128
|
-
MATCH (lo:Load)
|
129
|
-
MERGE (lo)-[:VISITS_TO_WITHDRAW_OR_DEPOSIT_CURRENCY {distance: point.distance(
|
130
|
-
point({longitude: b.longitude, latitude:b.latitude}),
|
131
|
-
point({longitude: lo.longitude, latitude:lo.latitude})
|
132
|
-
)}]->(b);
|
133
|
-
|
134
|
-
MATCH (b1:Banking)
|
135
|
-
WITH b1
|
136
|
-
MATCH (b:Bus {name: b1.source})
|
137
|
-
MERGE (b)<-[:GETS_POWER_FROM]-(b1);
|
138
|
-
|
139
|
-
LOAD CSV WITH HEADERS FROM 'file:///convenience.csv' AS c_row
|
140
|
-
WITH c_row WHERE c_row.name IS NOT NULL
|
141
|
-
MERGE (c:Convenience {name: (c_row.name + c_row.gid),
|
142
|
-
source:c_row.source, kw:toFloat(c_row.kw), kvar:toFloat(c_row.kvar),
|
143
|
-
backup_capacity_kw:toFloat(c_row.backup_capacity_kw),
|
144
|
-
backup: toInteger(c_row.backup),
|
145
|
-
longitude: toFloat(c_row.longitude), latitude: toFloat(c_row.latitude)})
|
146
|
-
WITH c
|
147
|
-
MATCH (lo:Load)
|
148
|
-
MERGE (lo)-[:VISITS_FOR_SERVICE {distance: point.distance(
|
149
|
-
point({longitude: c.longitude, latitude:c.latitude}),
|
150
|
-
point({longitude: lo.longitude, latitude:lo.latitude})
|
151
|
-
)}]->(c);
|
152
|
-
|
153
|
-
MATCH (c:Convenience)
|
154
|
-
WITH c
|
155
|
-
MATCH (b:Bus {name: c.source})
|
156
|
-
MERGE (b)<-[:GETS_POWER_FROM]-(c);
|
157
|
-
|
158
|
-
LOAD CSV WITH HEADERS FROM 'file:///shelters.csv' AS s_row
|
159
|
-
WITH s_row WHERE s_row.use_type IS NOT NULL
|
160
|
-
MERGE (s:Shelter {name: (s_row.use_type + s_row.gid),
|
161
|
-
backup: toInteger(s_row.backup), source: s_row.source, kw:toFloat(s_row.kw),
|
162
|
-
kvar:toFloat(s_row.kvar),
|
163
|
-
backup_capacity_kw:toFloat(s_row.backup_capacity_kw),
|
164
|
-
longitude: toFloat(s_row.longitude), latitude: toFloat(s_row.latitude)})
|
165
|
-
WITH s
|
166
|
-
MATCH (lo:Load)
|
167
|
-
MERGE (lo)-[:VISITS_FOR_SERVICE {distance: point.distance(
|
168
|
-
point({longitude: s.longitude, latitude:s.latitude}),
|
169
|
-
point({longitude: lo.longitude, latitude:lo.latitude})
|
170
|
-
)}]->(s);
|
171
|
-
|
172
|
-
MATCH (s:Shelter)
|
173
|
-
WITH s
|
174
|
-
MATCH (b:Bus {name: s.source})
|
175
|
-
MERGE (b)<-[:GETS_POWER_FROM]-(s);
|
176
|
-
|
177
|
-
MATCH (b1:Bus)-[r:CONNECTS_TO]-(b2:Bus)
|
178
|
-
SET r.longitude = (b1.longitude + b2.longitude)/2
|
179
|
-
SET r.latitude = (b1.latitude + b2.latitude)/2;
|
180
|
-
|
181
|
-
MATCH p=(sourceNode:Bus)-[r:CONNECTS_TO]-(targetNode:Bus)
|
182
|
-
WHERE r.ampacity IS NOT NULL
|
183
|
-
WITH r,sourceNode, CASE r.num_phase
|
184
|
-
WHEN 3 THEN 1.732
|
185
|
-
ELSE 1
|
186
|
-
END AS multiplier
|
187
|
-
SET r.kva = multiplier*r.ampacity*sourceNode.kv;
|
188
|
-
|
189
|
-
MATCH p=(sourceNode:Bus)-[r:CONSUMES_POWER_FROM]-(targetNode:Load)
|
190
|
-
SET targetNode.kw = toFloat(targetNode.kw)
|
191
|
-
SET targetNode.kvar = toFloat(targetNode.kvar)
|
192
|
-
SET r.kva = sqrt(targetNode.kw*targetNode.kw+targetNode.kvar*targetNode.kvar);
|
193
|
-
|
194
|
-
MATCH p=(sourceNode:Bus)-[r:INJECTS_ACTIVE_POWER_TO]-(targetNode:Solar)
|
195
|
-
SET targetNode.capacity = toFloat(targetNode.capacity)
|
196
|
-
SET r.kva = targetNode.capacity;
|
197
|
-
|
198
|
-
|
199
|
-
MATCH p=(sourceNode:Bus)-[r:INJECTS_POWER]-(targetNode:EnergyStorage)
|
200
|
-
SET targetNode.kw = toFloat(targetNode.kw)
|
201
|
-
SET r.kva = targetNode.kw;
|
202
|
-
|
203
|
-
MATCH (sourceNode:Bus)-[r:CONNECTS_TO]-(targetNode:Bus)
|
204
|
-
SET r.kva = toFloat(r.kva);
|
205
|
-
|
206
|
-
MATCH p=()-[r:GETS_POWER_FROM]->()
|
207
|
-
WHERE r.kva is null
|
208
|
-
SET r.kva = 300;
|
209
|
-
|
210
|
-
MATCH p=()-[r:CONNECTS_TO]->()
|
211
|
-
WHERE r.kva IS null
|
212
|
-
SET r.kva = 300;
|