NREL-erad 0.1.0__tar.gz → 1.0.0__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 (89) hide show
  1. nrel_erad-1.0.0/.gitignore +136 -0
  2. {nrel_erad-0.1.0 → nrel_erad-1.0.0}/LICENSE.txt +28 -28
  3. {nrel_erad-0.1.0/src/NREL_erad.egg-info → nrel_erad-1.0.0}/PKG-INFO +39 -29
  4. {nrel_erad-0.1.0 → nrel_erad-1.0.0}/README.md +20 -20
  5. nrel_erad-1.0.0/erad/__init__.py +1 -0
  6. nrel_erad-1.0.0/erad/constants.py +20 -0
  7. nrel_erad-1.0.0/erad/cypher_queries/load_data_v1.cypher +212 -0
  8. nrel_erad-1.0.0/erad/data/World_Earthquakes_1960_2016.csv +23410 -0
  9. nrel_erad-1.0.0/erad/db/__init__.py +0 -0
  10. nrel_erad-1.0.0/erad/db/assets/__init__.py +0 -0
  11. nrel_erad-1.0.0/erad/db/assets/critical_infras.py +171 -0
  12. nrel_erad-1.0.0/erad/db/assets/distribution_lines.py +101 -0
  13. nrel_erad-1.0.0/erad/db/credential_model.py +20 -0
  14. nrel_erad-1.0.0/erad/db/disaster_input_model.py +23 -0
  15. nrel_erad-1.0.0/erad/db/inject_earthquake.py +52 -0
  16. nrel_erad-1.0.0/erad/db/inject_flooding.py +53 -0
  17. nrel_erad-1.0.0/erad/db/neo4j_.py +162 -0
  18. nrel_erad-1.0.0/erad/db/utils.py +14 -0
  19. nrel_erad-1.0.0/erad/exceptions.py +68 -0
  20. nrel_erad-1.0.0/erad/metrics/__init__.py +0 -0
  21. nrel_erad-1.0.0/erad/metrics/check_microgrid.py +208 -0
  22. nrel_erad-1.0.0/erad/metrics/metric.py +178 -0
  23. nrel_erad-1.0.0/erad/programs/__init__.py +0 -0
  24. nrel_erad-1.0.0/erad/programs/backup.py +62 -0
  25. nrel_erad-1.0.0/erad/programs/microgrid.py +45 -0
  26. nrel_erad-1.0.0/erad/scenarios/__init__.py +0 -0
  27. nrel_erad-1.0.0/erad/scenarios/abstract_scenario.py +103 -0
  28. nrel_erad-1.0.0/erad/scenarios/common.py +93 -0
  29. nrel_erad-1.0.0/erad/scenarios/earthquake_scenario.py +161 -0
  30. nrel_erad-1.0.0/erad/scenarios/fire_scenario.py +160 -0
  31. nrel_erad-1.0.0/erad/scenarios/flood_scenario.py +494 -0
  32. nrel_erad-1.0.0/erad/scenarios/flows.csv +671 -0
  33. nrel_erad-1.0.0/erad/scenarios/utilities.py +76 -0
  34. nrel_erad-1.0.0/erad/scenarios/wind_scenario.py +89 -0
  35. nrel_erad-1.0.0/erad/utils/__init__.py +0 -0
  36. nrel_erad-1.0.0/erad/utils/ditto_utils.py +252 -0
  37. nrel_erad-1.0.0/erad/utils/hifld_utils.py +147 -0
  38. nrel_erad-1.0.0/erad/utils/opendss_utils.py +357 -0
  39. nrel_erad-1.0.0/erad/utils/overpass.py +76 -0
  40. nrel_erad-1.0.0/erad/utils/util.py +178 -0
  41. nrel_erad-1.0.0/erad/visualization/__init__.py +0 -0
  42. nrel_erad-1.0.0/erad/visualization/plot_graph.py +218 -0
  43. nrel_erad-1.0.0/pyproject.toml +84 -0
  44. nrel_erad-0.1.0/PKG-INFO +0 -55
  45. nrel_erad-0.1.0/pyproject.toml +0 -109
  46. nrel_erad-0.1.0/setup.cfg +0 -4
  47. nrel_erad-0.1.0/src/NREL_erad.egg-info/SOURCES.txt +0 -47
  48. nrel_erad-0.1.0/src/NREL_erad.egg-info/dependency_links.txt +0 -1
  49. nrel_erad-0.1.0/src/NREL_erad.egg-info/requires.txt +0 -20
  50. nrel_erad-0.1.0/src/NREL_erad.egg-info/top_level.txt +0 -1
  51. nrel_erad-0.1.0/src/erad/__init__.py +0 -1
  52. nrel_erad-0.1.0/src/erad/constants.py +0 -68
  53. nrel_erad-0.1.0/src/erad/default_fragility_curves/__init__.py +0 -15
  54. nrel_erad-0.1.0/src/erad/default_fragility_curves/default_fire_boundary_dist.py +0 -94
  55. nrel_erad-0.1.0/src/erad/default_fragility_curves/default_flood_depth.py +0 -108
  56. nrel_erad-0.1.0/src/erad/default_fragility_curves/default_flood_velocity.py +0 -101
  57. nrel_erad-0.1.0/src/erad/default_fragility_curves/default_fragility_curves.py +0 -23
  58. nrel_erad-0.1.0/src/erad/default_fragility_curves/default_peak_ground_acceleration.py +0 -163
  59. nrel_erad-0.1.0/src/erad/default_fragility_curves/default_peak_ground_velocity.py +0 -94
  60. nrel_erad-0.1.0/src/erad/default_fragility_curves/default_wind_speed.py +0 -94
  61. nrel_erad-0.1.0/src/erad/enums.py +0 -40
  62. nrel_erad-0.1.0/src/erad/gdm_mapping.py +0 -83
  63. nrel_erad-0.1.0/src/erad/models/__init__.py +0 -1
  64. nrel_erad-0.1.0/src/erad/models/asset.py +0 -287
  65. nrel_erad-0.1.0/src/erad/models/asset_mapping.py +0 -20
  66. nrel_erad-0.1.0/src/erad/models/fragility_curve.py +0 -116
  67. nrel_erad-0.1.0/src/erad/models/hazard/__init__.py +0 -5
  68. nrel_erad-0.1.0/src/erad/models/hazard/base_models.py +0 -12
  69. nrel_erad-0.1.0/src/erad/models/hazard/common.py +0 -26
  70. nrel_erad-0.1.0/src/erad/models/hazard/earthquake.py +0 -93
  71. nrel_erad-0.1.0/src/erad/models/hazard/flood.py +0 -83
  72. nrel_erad-0.1.0/src/erad/models/hazard/wild_fire.py +0 -121
  73. nrel_erad-0.1.0/src/erad/models/hazard/wind.py +0 -143
  74. nrel_erad-0.1.0/src/erad/models/probability.py +0 -73
  75. nrel_erad-0.1.0/src/erad/probability_builder.py +0 -35
  76. nrel_erad-0.1.0/src/erad/quantities.py +0 -25
  77. nrel_erad-0.1.0/src/erad/runner.py +0 -122
  78. nrel_erad-0.1.0/src/erad/systems/__init__.py +0 -2
  79. nrel_erad-0.1.0/src/erad/systems/asset_system.py +0 -414
  80. nrel_erad-0.1.0/src/erad/systems/hazard_system.py +0 -122
  81. nrel_erad-0.1.0/tests/test_asset_system.py +0 -42
  82. nrel_erad-0.1.0/tests/test_fragility_curves.py +0 -88
  83. nrel_erad-0.1.0/tests/test_from_history.py +0 -13
  84. nrel_erad-0.1.0/tests/test_gdm_model_interface.py +0 -51
  85. nrel_erad-0.1.0/tests/test_hazard_scenario_generator.py +0 -36
  86. nrel_erad-0.1.0/tests/test_hazard_system.py +0 -71
  87. nrel_erad-0.1.0/tests/test_models.py +0 -8
  88. nrel_erad-0.1.0/tests/test_plot_probability_fuctions.py +0 -11
  89. nrel_erad-0.1.0/tests/test_runner.py +0 -31
@@ -0,0 +1,136 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ .vscode/**
6
+
7
+ # C extensions
8
+ *.so
9
+
10
+ notebooks/*.csv
11
+ erad_web/
12
+ *.pdf
13
+ *.jats
14
+
15
+ # Distribution / packaging
16
+ .Python
17
+ cache/
18
+ build/
19
+ develop-eggs/
20
+ dist/
21
+ downloads/
22
+ eggs/
23
+ .eggs/
24
+ lib/
25
+ lib64/
26
+ parts/
27
+ sdist/
28
+ var/
29
+ wheels/
30
+ pip-wheel-metadata/
31
+ share/python-wheels/
32
+ *.egg-info/
33
+ .installed.cfg
34
+ *.egg
35
+ MANIFEST
36
+
37
+ # PyInstaller
38
+ # Usually these files are written by a python script from a template
39
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
40
+ *.manifest
41
+ *.spec
42
+
43
+ # Installer logs
44
+ pip-log.txt
45
+ pip-delete-this-directory.txt
46
+
47
+ # Unit test / coverage reports
48
+ htmlcov/
49
+ .tox/
50
+ .nox/
51
+ .coverage
52
+ .coverage.*
53
+ .cache
54
+ nosetests.xml
55
+ coverage.xml
56
+ *.cover
57
+ *.py,cover
58
+ .hypothesis/
59
+ .pytest_cache/
60
+
61
+ # Translations
62
+ *.mo
63
+ *.pot
64
+
65
+ # Django stuff:
66
+ *.log
67
+ local_settings.py
68
+ db.sqlite3
69
+ db.sqlite3-journal
70
+
71
+ # Flask stuff:
72
+ instance/
73
+ .webassets-cache
74
+
75
+ # Scrapy stuff:
76
+ .scrapy
77
+
78
+ # Sphinx documentation
79
+ docs/_build/
80
+
81
+ # PyBuilder
82
+ target/
83
+
84
+ # Jupyter Notebook
85
+ .ipynb_checkpoints
86
+
87
+ # IPython
88
+ profile_default/
89
+ ipython_config.py
90
+
91
+ # pyenv
92
+ .python-version
93
+
94
+ # pipenv
95
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
96
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
97
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
98
+ # install all needed dependencies.
99
+ #Pipfile.lock
100
+
101
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
102
+ __pypackages__/
103
+
104
+ # Celery stuff
105
+ celerybeat-schedule
106
+ celerybeat.pid
107
+
108
+ # SageMath parsed files
109
+ *.sage.py
110
+
111
+ # Environments
112
+ .env
113
+ .venv
114
+ env/
115
+ venv/
116
+ ENV/
117
+ env.bak/
118
+ venv.bak/
119
+
120
+ # Spyder project settings
121
+ .spyderproject
122
+ .spyproject
123
+
124
+ # Rope project settings
125
+ .ropeproject
126
+
127
+ # mkdocs documentation
128
+ /site
129
+
130
+ # mypy
131
+ .mypy_cache/
132
+ .dmypy.json
133
+ dmypy.json
134
+
135
+ # Pyre type checker
136
+ .pyre/
@@ -1,29 +1,29 @@
1
- BSD 3-Clause License
2
-
3
- Copyright (c) 2023, Alliance for Sustainable Energy, LLC
4
- All rights reserved.
5
-
6
- Redistribution and use in source and binary forms, with or without
7
- modification, are permitted provided that the following conditions are met:
8
-
9
- 1. Redistributions of source code must retain the above copyright notice, this
10
- list of conditions and the following disclaimer.
11
-
12
- 2. Redistributions in binary form must reproduce the above copyright notice,
13
- this list of conditions and the following disclaimer in the documentation
14
- and/or other materials provided with the distribution.
15
-
16
- 3. Neither the name of the copyright holder nor the names of its
17
- contributors may be used to endorse or promote products derived from
18
- this software without specific prior written permission.
19
-
20
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2023, Alliance for Sustainable Energy, LLC
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted provided that the following conditions are met:
8
+
9
+ 1. Redistributions of source code must retain the above copyright notice, this
10
+ list of conditions and the following disclaimer.
11
+
12
+ 2. Redistributions in binary form must reproduce the above copyright notice,
13
+ this list of conditions and the following disclaimer in the documentation
14
+ and/or other materials provided with the distribution.
15
+
16
+ 3. Neither the name of the copyright holder nor the names of its
17
+ contributors may be used to endorse or promote products derived from
18
+ this software without specific prior written permission.
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
29
  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -1,42 +1,52 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.3
2
2
  Name: NREL-erad
3
- Version: 0.1.0
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>
3
+ Version: 1.0.0
4
+ Summary: Graph based scalable tool for computing equitable resilience metrics for distribution systems.
7
5
  Project-URL: Homepage, https://github.com/nrel/erad
8
- Keywords: Distribution,Earthquake,Energy,Fire,Flooding,Power,Python,Resilience,Systems
6
+ 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>
7
+ License-File: LICENSE.txt
8
+ Keywords: Distribution,Earthquake,Equity,Fire,Flooding,Power,Python,Resilience,Systems
9
9
  Classifier: License :: OSI Approved :: BSD License
10
10
  Classifier: Operating System :: OS Independent
11
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
12
+ Requires-Python: >=3.8
13
+ Requires-Dist: boto3
14
+ Requires-Dist: botocore
15
+ Requires-Dist: ditto-py
16
+ Requires-Dist: geojson
17
17
  Requires-Dist: geopandas
18
- Requires-Dist: requests
19
- Requires-Dist: shapely
20
- Requires-Dist: pandas
21
- Requires-Dist: pyhigh
22
18
  Requires-Dist: geopy
19
+ Requires-Dist: graphdatascience
20
+ Requires-Dist: jupyter
21
+ Requires-Dist: matplotlib
22
+ Requires-Dist: neo4j-driver
23
+ Requires-Dist: networkx
24
+ Requires-Dist: opendssdirect-py
25
+ Requires-Dist: pandas
26
+ Requires-Dist: plotly
27
+ Requires-Dist: pydantic~=1.10.14
28
+ Requires-Dist: pytest
29
+ Requires-Dist: python-dotenv
30
+ Requires-Dist: pyyaml
31
+ Requires-Dist: rasterio
32
+ Requires-Dist: requests
23
33
  Requires-Dist: scipy
34
+ Requires-Dist: shapely
35
+ Requires-Dist: stateplane
36
+ Requires-Dist: xmltodict
24
37
  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
- Dynamic: license-file
38
+ Requires-Dist: black; extra == 'dev'
39
+ Requires-Dist: mkdocs; extra == 'dev'
40
+ Requires-Dist: mkdocs-jupyter; extra == 'dev'
41
+ Requires-Dist: mkdocs-material; extra == 'dev'
42
+ Requires-Dist: mkdocstrings[python]; extra == 'dev'
43
+ Requires-Dist: pylint; extra == 'dev'
44
+ Description-Content-Type: text/markdown
35
45
 
36
- # ERAD (<u>E</u>nergy <u>R</u>esilience <u>A</u>nalysis for electric <u>D</u>istribution systems)
46
+ # ERAD (<u>E</u>quity and <u>R</u>esilience <u>A</u>nalysis for electric <u>D</u>istribution systems)
37
47
  <p align="center">
38
48
  <img src="docs/images/logo.svg" width="250" style="display:flex;justify-content:center;">
39
- <p align="center">Graph based python tool for computing energy resilience. </p>
49
+ <p align="center">Graph based python tool for computing equitable resilience. </p>
40
50
  </p>
41
51
 
42
52
  ![GitHub all releases](https://img.shields.io/github/downloads/NREL/erad/total?logo=Github&logoColor=%2300ff00&style=flat-square)
@@ -50,6 +60,6 @@ Dynamic: license-file
50
60
 
51
61
  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.
52
62
 
53
- 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.
63
+ 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.
54
64
 
55
- 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.
65
+ 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 publicly available with open license.
@@ -1,20 +1,20 @@
1
- # ERAD (<u>E</u>nergy <u>R</u>esilience <u>A</u>nalysis for electric <u>D</u>istribution systems)
2
- <p align="center">
3
- <img src="docs/images/logo.svg" width="250" style="display:flex;justify-content:center;">
4
- <p align="center">Graph based python tool for computing energy resilience. </p>
5
- </p>
6
-
7
- ![GitHub all releases](https://img.shields.io/github/downloads/NREL/erad/total?logo=Github&logoColor=%2300ff00&style=flat-square)
8
- ![GitHub repo size](https://img.shields.io/github/repo-size/nrel/erad?style=flat-square)
9
- [![CodeFactor](https://www.codefactor.io/repository/github/nrel/erad/badge)](https://www.codefactor.io/repository/github/nrel/erad)
10
- [![GitHub license](https://img.shields.io/github/license/NREL/erad?style=flat-square)](https://github.com/NREL/erad/blob/main/LICENSE.txt)
11
- [![GitHub issues](https://img.shields.io/github/issues/NREL/erad?style=flat-square)](https://github.com/NREL/erad/issues)
12
- ![GitHub top language](https://img.shields.io/github/languages/top/nrel/erad?style=flat-square)
13
-
14
- [Visit full documentation here.](https://nrel.github.io/erad/)
15
-
16
- 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.
17
-
18
- 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.
19
-
20
- 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.
1
+ # ERAD (<u>E</u>quity and <u>R</u>esilience <u>A</u>nalysis for electric <u>D</u>istribution systems)
2
+ <p align="center">
3
+ <img src="docs/images/logo.svg" width="250" style="display:flex;justify-content:center;">
4
+ <p align="center">Graph based python tool for computing equitable resilience. </p>
5
+ </p>
6
+
7
+ ![GitHub all releases](https://img.shields.io/github/downloads/NREL/erad/total?logo=Github&logoColor=%2300ff00&style=flat-square)
8
+ ![GitHub repo size](https://img.shields.io/github/repo-size/nrel/erad?style=flat-square)
9
+ [![CodeFactor](https://www.codefactor.io/repository/github/nrel/erad/badge)](https://www.codefactor.io/repository/github/nrel/erad)
10
+ [![GitHub license](https://img.shields.io/github/license/NREL/erad?style=flat-square)](https://github.com/NREL/erad/blob/main/LICENSE.txt)
11
+ [![GitHub issues](https://img.shields.io/github/issues/NREL/erad?style=flat-square)](https://github.com/NREL/erad/issues)
12
+ ![GitHub top language](https://img.shields.io/github/languages/top/nrel/erad?style=flat-square)
13
+
14
+ [Visit full documentation here.](https://nrel.github.io/erad/)
15
+
16
+ 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.
17
+
18
+ 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.
19
+
20
+ 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 publicly available with open license.
@@ -0,0 +1 @@
1
+ __version__ = "1.0.0"
@@ -0,0 +1,20 @@
1
+ """ Module for managing constants in ERAD package.
2
+
3
+ _Do not change this constants in your code._
4
+ """
5
+
6
+ import os
7
+
8
+ ROOT_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
9
+ DATA_FOLDER_NAME = "data"
10
+ DATA_FOLDER = os.path.join(ROOT_PATH, DATA_FOLDER_NAME)
11
+
12
+ FIRE_HISTORIC_GEODATAFRAME_PATH = "US_Wildfires_1878_2019.gdb"
13
+ EARTHQUAKE_HISTORIC_CSV_PATH = "World_Earthquakes_1960_2016.csv"
14
+ FLOOD_HISTORIC_SHP_PATH = "FEMA_100_Year_Flood_Zones_in_the_US\\FEMA_100_Year_Flood_Zones_in_the_US.shp"
15
+ #FLOOD_HISTORIC_SHP_PATH = "NFHL_06_20230323.gdb"
16
+ ELEVATION_RASTER_FILE = "TrueMarble.250m.21600x21600.B2.tif"
17
+
18
+ SMARTDS_VALID_YEARS = [2016, 2017, 2018]
19
+ SMARTDS_VALID_AREAS = ['SFO', 'GSO', 'AUS']
20
+
@@ -0,0 +1,212 @@
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;