NREL-erad 0.0.0a0__tar.gz → 0.1.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 (92) hide show
  1. nrel_erad-0.1.0/PKG-INFO +55 -0
  2. nrel_erad-0.1.0/README.md +20 -0
  3. nrel_erad-0.1.0/pyproject.toml +109 -0
  4. {NREL-erad-0.0.0a0 → nrel_erad-0.1.0}/setup.cfg +4 -4
  5. nrel_erad-0.1.0/src/NREL_erad.egg-info/PKG-INFO +55 -0
  6. nrel_erad-0.1.0/src/NREL_erad.egg-info/SOURCES.txt +47 -0
  7. nrel_erad-0.1.0/src/NREL_erad.egg-info/requires.txt +20 -0
  8. nrel_erad-0.1.0/src/erad/__init__.py +1 -0
  9. nrel_erad-0.1.0/src/erad/constants.py +68 -0
  10. nrel_erad-0.1.0/src/erad/default_fragility_curves/__init__.py +15 -0
  11. nrel_erad-0.1.0/src/erad/default_fragility_curves/default_fire_boundary_dist.py +94 -0
  12. nrel_erad-0.1.0/src/erad/default_fragility_curves/default_flood_depth.py +108 -0
  13. nrel_erad-0.1.0/src/erad/default_fragility_curves/default_flood_velocity.py +101 -0
  14. nrel_erad-0.1.0/src/erad/default_fragility_curves/default_fragility_curves.py +23 -0
  15. nrel_erad-0.1.0/src/erad/default_fragility_curves/default_peak_ground_acceleration.py +163 -0
  16. nrel_erad-0.1.0/src/erad/default_fragility_curves/default_peak_ground_velocity.py +94 -0
  17. nrel_erad-0.1.0/src/erad/default_fragility_curves/default_wind_speed.py +94 -0
  18. nrel_erad-0.1.0/src/erad/enums.py +40 -0
  19. nrel_erad-0.1.0/src/erad/gdm_mapping.py +83 -0
  20. nrel_erad-0.1.0/src/erad/models/__init__.py +1 -0
  21. nrel_erad-0.1.0/src/erad/models/asset.py +287 -0
  22. nrel_erad-0.1.0/src/erad/models/asset_mapping.py +20 -0
  23. nrel_erad-0.1.0/src/erad/models/fragility_curve.py +116 -0
  24. nrel_erad-0.1.0/src/erad/models/hazard/__init__.py +5 -0
  25. nrel_erad-0.1.0/src/erad/models/hazard/base_models.py +12 -0
  26. nrel_erad-0.1.0/src/erad/models/hazard/common.py +26 -0
  27. nrel_erad-0.1.0/src/erad/models/hazard/earthquake.py +93 -0
  28. nrel_erad-0.1.0/src/erad/models/hazard/flood.py +83 -0
  29. nrel_erad-0.1.0/src/erad/models/hazard/wild_fire.py +121 -0
  30. nrel_erad-0.1.0/src/erad/models/hazard/wind.py +143 -0
  31. nrel_erad-0.1.0/src/erad/models/probability.py +73 -0
  32. nrel_erad-0.1.0/src/erad/probability_builder.py +35 -0
  33. nrel_erad-0.1.0/src/erad/quantities.py +25 -0
  34. nrel_erad-0.1.0/src/erad/runner.py +122 -0
  35. nrel_erad-0.1.0/src/erad/systems/__init__.py +2 -0
  36. nrel_erad-0.1.0/src/erad/systems/asset_system.py +414 -0
  37. nrel_erad-0.1.0/src/erad/systems/hazard_system.py +122 -0
  38. nrel_erad-0.1.0/tests/test_asset_system.py +42 -0
  39. nrel_erad-0.1.0/tests/test_fragility_curves.py +88 -0
  40. nrel_erad-0.1.0/tests/test_from_history.py +13 -0
  41. nrel_erad-0.1.0/tests/test_gdm_model_interface.py +51 -0
  42. nrel_erad-0.1.0/tests/test_hazard_scenario_generator.py +36 -0
  43. nrel_erad-0.1.0/tests/test_hazard_system.py +71 -0
  44. nrel_erad-0.1.0/tests/test_models.py +8 -0
  45. nrel_erad-0.1.0/tests/test_plot_probability_fuctions.py +11 -0
  46. nrel_erad-0.1.0/tests/test_runner.py +31 -0
  47. NREL-erad-0.0.0a0/NREL_erad.egg-info/PKG-INFO +0 -31
  48. NREL-erad-0.0.0a0/NREL_erad.egg-info/SOURCES.txt +0 -45
  49. NREL-erad-0.0.0a0/NREL_erad.egg-info/requires.txt +0 -32
  50. NREL-erad-0.0.0a0/PKG-INFO +0 -31
  51. NREL-erad-0.0.0a0/README.md +0 -15
  52. NREL-erad-0.0.0a0/erad/__init__.py +0 -0
  53. NREL-erad-0.0.0a0/erad/constants.py +0 -20
  54. NREL-erad-0.0.0a0/erad/cypher_queries/load_data_v1.cypher +0 -212
  55. NREL-erad-0.0.0a0/erad/data/World_Earthquakes_1960_2016.csv +0 -23410
  56. NREL-erad-0.0.0a0/erad/db/__init__.py +0 -0
  57. NREL-erad-0.0.0a0/erad/db/assets/__init__.py +0 -0
  58. NREL-erad-0.0.0a0/erad/db/assets/critical_infras.py +0 -171
  59. NREL-erad-0.0.0a0/erad/db/assets/distribution_lines.py +0 -101
  60. NREL-erad-0.0.0a0/erad/db/credential_model.py +0 -20
  61. NREL-erad-0.0.0a0/erad/db/disaster_input_model.py +0 -23
  62. NREL-erad-0.0.0a0/erad/db/inject_earthquake.py +0 -52
  63. NREL-erad-0.0.0a0/erad/db/inject_flooding.py +0 -53
  64. NREL-erad-0.0.0a0/erad/db/neo4j_.py +0 -162
  65. NREL-erad-0.0.0a0/erad/db/utils.py +0 -14
  66. NREL-erad-0.0.0a0/erad/exceptions.py +0 -68
  67. NREL-erad-0.0.0a0/erad/metrics/__init__.py +0 -0
  68. NREL-erad-0.0.0a0/erad/metrics/check_microgrid.py +0 -208
  69. NREL-erad-0.0.0a0/erad/metrics/metric.py +0 -178
  70. NREL-erad-0.0.0a0/erad/programs/__init__.py +0 -0
  71. NREL-erad-0.0.0a0/erad/programs/backup.py +0 -62
  72. NREL-erad-0.0.0a0/erad/programs/microgrid.py +0 -45
  73. NREL-erad-0.0.0a0/erad/scenarios/__init__.py +0 -0
  74. NREL-erad-0.0.0a0/erad/scenarios/abstract_scenario.py +0 -103
  75. NREL-erad-0.0.0a0/erad/scenarios/common.py +0 -93
  76. NREL-erad-0.0.0a0/erad/scenarios/earthquake_scenario.py +0 -161
  77. NREL-erad-0.0.0a0/erad/scenarios/fire_scenario.py +0 -160
  78. NREL-erad-0.0.0a0/erad/scenarios/flood_scenario.py +0 -494
  79. NREL-erad-0.0.0a0/erad/scenarios/utilities.py +0 -76
  80. NREL-erad-0.0.0a0/erad/scenarios/wind_scenario.py +0 -89
  81. NREL-erad-0.0.0a0/erad/utils/__init__.py +0 -0
  82. NREL-erad-0.0.0a0/erad/utils/ditto_utils.py +0 -252
  83. NREL-erad-0.0.0a0/erad/utils/hifld_utils.py +0 -147
  84. NREL-erad-0.0.0a0/erad/utils/opendss_utils.py +0 -357
  85. NREL-erad-0.0.0a0/erad/utils/overpass.py +0 -76
  86. NREL-erad-0.0.0a0/erad/utils/util.py +0 -178
  87. NREL-erad-0.0.0a0/erad/visualization/__init__.py +0 -0
  88. NREL-erad-0.0.0a0/erad/visualization/plot_graph.py +0 -218
  89. NREL-erad-0.0.0a0/setup.py +0 -54
  90. {NREL-erad-0.0.0a0 → nrel_erad-0.1.0}/LICENSE.txt +0 -0
  91. {NREL-erad-0.0.0a0 → nrel_erad-0.1.0/src}/NREL_erad.egg-info/dependency_links.txt +0 -0
  92. {NREL-erad-0.0.0a0 → nrel_erad-0.1.0/src}/NREL_erad.egg-info/top_level.txt +0 -0
@@ -0,0 +1,55 @@
1
+ Metadata-Version: 2.4
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>
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
+ Dynamic: license-file
35
+
36
+ # ERAD (<u>E</u>nergy <u>R</u>esilience <u>A</u>nalysis for electric <u>D</u>istribution systems)
37
+ <p align="center">
38
+ <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>
40
+ </p>
41
+
42
+ ![GitHub all releases](https://img.shields.io/github/downloads/NREL/erad/total?logo=Github&logoColor=%2300ff00&style=flat-square)
43
+ ![GitHub repo size](https://img.shields.io/github/repo-size/nrel/erad?style=flat-square)
44
+ [![CodeFactor](https://www.codefactor.io/repository/github/nrel/erad/badge)](https://www.codefactor.io/repository/github/nrel/erad)
45
+ [![GitHub license](https://img.shields.io/github/license/NREL/erad?style=flat-square)](https://github.com/NREL/erad/blob/main/LICENSE.txt)
46
+ [![GitHub issues](https://img.shields.io/github/issues/NREL/erad?style=flat-square)](https://github.com/NREL/erad/issues)
47
+ ![GitHub top language](https://img.shields.io/github/languages/top/nrel/erad?style=flat-square)
48
+
49
+ [Visit full documentation here.](https://nrel.github.io/erad/)
50
+
51
+ 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
+
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.
54
+
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.
@@ -0,0 +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.
@@ -0,0 +1,109 @@
1
+ [build-system]
2
+ requires = ["setuptools >= 61.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "NREL-erad"
7
+ version="0.1.0"
8
+ description = "Graph based scalable tool for computing energy resilience metrics for distribution systems."
9
+ readme = "README.md"
10
+ requires-python = ">=3.11"
11
+ authors = [
12
+ { name = "Kapil Duwadi", email = "kapil.duwadi@nrel.gov" },
13
+ { name = "Aadil Latif", email = "aadil.altif@nrel.gov" },
14
+ { name = "Kwami Sedzro", email = "sherinann.abraham@nrel.gov" },
15
+ { name = "Sherin Ann Abraham", email = "kwami.sedzro@nrel.gov" },
16
+ { name = "Bryan Palmintier", email = "bryan.palmintier@nrel.gov" },
17
+ ]
18
+ maintainers = [
19
+ { name = "Aadil Latif", email = "Aadil.Latif@nrel.gov" },
20
+ ]
21
+ keywords = [
22
+ "Distribution",
23
+ "Earthquake",
24
+ "Energy",
25
+ "Fire",
26
+ "Flooding",
27
+ "Power",
28
+ "Python",
29
+ "Resilience",
30
+ "Systems",
31
+ ]
32
+ classifiers = [
33
+ "License :: OSI Approved :: BSD License",
34
+ "Operating System :: OS Independent",
35
+ "Programming Language :: Python :: 3.8",
36
+ ]
37
+ dependencies = [
38
+ "grid-data-models~=2.1.3",
39
+ "gdmloader",
40
+ "geopandas",
41
+ "requests",
42
+ "shapely",
43
+ "pandas",
44
+ "pyhigh",
45
+ "geopy",
46
+ "scipy",
47
+ ]
48
+
49
+ [project.optional-dependencies]
50
+ dev = [
51
+ "black",
52
+ "mkdocs",
53
+ "mkdocs-jupyter",
54
+ "mkdocs-material",
55
+ "mkdocstrings[python]",
56
+ "pylint",
57
+ "pytest",
58
+ "pytest-cov",
59
+ "ruff"
60
+ ]
61
+
62
+ [project.urls]
63
+ Homepage = "https://github.com/nrel/erad"
64
+
65
+
66
+ [tool.ruff]
67
+ # Exclude a variety of commonly ignored directories.
68
+ exclude = [
69
+ ".git",
70
+ ".ruff_cache",
71
+ ".venv",
72
+ "_build",
73
+ "build",
74
+ "dist",
75
+ "env",
76
+ "venv",
77
+ ]
78
+ ignore-init-module-imports = true
79
+ line-length = 99
80
+ indent-width = 4
81
+ target-version = "py311"
82
+
83
+ [tool.ruff.lint]
84
+ # Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
85
+ select = [
86
+ "C901", # McCabe complexity
87
+ "E4", # Subset of pycodestyle (E)
88
+ "E7",
89
+ "E9",
90
+ "F", # Pyflakes
91
+ "W", # pycodestyle warnings
92
+ ]
93
+ ignore = []
94
+
95
+ # Allow fix for all enabled rules (when `--fix`) is provided.
96
+ fixable = ["ALL"]
97
+ unfixable = []
98
+
99
+ [tool.ruff.format]
100
+ quote-style = "double"
101
+ indent-style = "space"
102
+ skip-magic-trailing-comma = false
103
+ line-ending = "auto"
104
+ docstring-code-format = true
105
+ docstring-code-line-length = "dynamic"
106
+
107
+ [tool.ruff.lint.per-file-ignores]
108
+ "__init__.py" = ["E402", "F401"]
109
+ "**/{tests,docs,tools}/*" = ["E402"]
@@ -1,4 +1,4 @@
1
- [egg_info]
2
- tag_build =
3
- tag_date = 0
4
-
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,55 @@
1
+ Metadata-Version: 2.4
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>
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
+ Dynamic: license-file
35
+
36
+ # ERAD (<u>E</u>nergy <u>R</u>esilience <u>A</u>nalysis for electric <u>D</u>istribution systems)
37
+ <p align="center">
38
+ <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>
40
+ </p>
41
+
42
+ ![GitHub all releases](https://img.shields.io/github/downloads/NREL/erad/total?logo=Github&logoColor=%2300ff00&style=flat-square)
43
+ ![GitHub repo size](https://img.shields.io/github/repo-size/nrel/erad?style=flat-square)
44
+ [![CodeFactor](https://www.codefactor.io/repository/github/nrel/erad/badge)](https://www.codefactor.io/repository/github/nrel/erad)
45
+ [![GitHub license](https://img.shields.io/github/license/NREL/erad?style=flat-square)](https://github.com/NREL/erad/blob/main/LICENSE.txt)
46
+ [![GitHub issues](https://img.shields.io/github/issues/NREL/erad?style=flat-square)](https://github.com/NREL/erad/issues)
47
+ ![GitHub top language](https://img.shields.io/github/languages/top/nrel/erad?style=flat-square)
48
+
49
+ [Visit full documentation here.](https://nrel.github.io/erad/)
50
+
51
+ 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
+
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.
54
+
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.
@@ -0,0 +1,47 @@
1
+ LICENSE.txt
2
+ README.md
3
+ pyproject.toml
4
+ src/NREL_erad.egg-info/PKG-INFO
5
+ src/NREL_erad.egg-info/SOURCES.txt
6
+ src/NREL_erad.egg-info/dependency_links.txt
7
+ src/NREL_erad.egg-info/requires.txt
8
+ src/NREL_erad.egg-info/top_level.txt
9
+ src/erad/__init__.py
10
+ src/erad/constants.py
11
+ src/erad/enums.py
12
+ src/erad/gdm_mapping.py
13
+ src/erad/probability_builder.py
14
+ src/erad/quantities.py
15
+ src/erad/runner.py
16
+ src/erad/default_fragility_curves/__init__.py
17
+ src/erad/default_fragility_curves/default_fire_boundary_dist.py
18
+ src/erad/default_fragility_curves/default_flood_depth.py
19
+ src/erad/default_fragility_curves/default_flood_velocity.py
20
+ src/erad/default_fragility_curves/default_fragility_curves.py
21
+ src/erad/default_fragility_curves/default_peak_ground_acceleration.py
22
+ src/erad/default_fragility_curves/default_peak_ground_velocity.py
23
+ src/erad/default_fragility_curves/default_wind_speed.py
24
+ src/erad/models/__init__.py
25
+ src/erad/models/asset.py
26
+ src/erad/models/asset_mapping.py
27
+ src/erad/models/fragility_curve.py
28
+ src/erad/models/probability.py
29
+ src/erad/models/hazard/__init__.py
30
+ src/erad/models/hazard/base_models.py
31
+ src/erad/models/hazard/common.py
32
+ src/erad/models/hazard/earthquake.py
33
+ src/erad/models/hazard/flood.py
34
+ src/erad/models/hazard/wild_fire.py
35
+ src/erad/models/hazard/wind.py
36
+ src/erad/systems/__init__.py
37
+ src/erad/systems/asset_system.py
38
+ src/erad/systems/hazard_system.py
39
+ tests/test_asset_system.py
40
+ tests/test_fragility_curves.py
41
+ tests/test_from_history.py
42
+ tests/test_gdm_model_interface.py
43
+ tests/test_hazard_scenario_generator.py
44
+ tests/test_hazard_system.py
45
+ tests/test_models.py
46
+ tests/test_plot_probability_fuctions.py
47
+ tests/test_runner.py
@@ -0,0 +1,20 @@
1
+ grid-data-models~=2.1.3
2
+ gdmloader
3
+ geopandas
4
+ requests
5
+ shapely
6
+ pandas
7
+ pyhigh
8
+ geopy
9
+ scipy
10
+
11
+ [dev]
12
+ black
13
+ mkdocs
14
+ mkdocs-jupyter
15
+ mkdocs-material
16
+ mkdocstrings[python]
17
+ pylint
18
+ pytest
19
+ pytest-cov
20
+ ruff
@@ -0,0 +1 @@
1
+ __version__ = "0.0.1"
@@ -0,0 +1,68 @@
1
+ """Module for managing constants in ERAD package.
2
+
3
+ _Do not change this constants in your code._
4
+ """
5
+
6
+ from datetime import datetime
7
+ from pathlib import Path
8
+
9
+ import erad.models.fragility_curve as frag
10
+ import erad.models.probability as prob
11
+ import erad.models.hazard as hazard
12
+ import erad.models.asset as asset
13
+
14
+ # Get list of continuous distributions
15
+
16
+
17
+ ROOT_PATH = Path(__file__).parent.parent.parent
18
+ TEST_PATH = Path(__file__).parent.parent.parent / "tests"
19
+ DATA_FOLDER_NAME = "data"
20
+ DATA_FOLDER = TEST_PATH / DATA_FOLDER_NAME
21
+
22
+ DEFAULT_TIME_STAMP = datetime(1970, 1, 1, 0, 0, 0)
23
+
24
+ ASSET_TYPES = (
25
+ asset.AssetState,
26
+ asset.Asset,
27
+ prob.AccelerationProbability,
28
+ prob.TemperatureProbability,
29
+ prob.DistanceProbability,
30
+ prob.SpeedProbability,
31
+ )
32
+
33
+ HAZARD_TYPES = (
34
+ hazard.EarthQuakeModel,
35
+ hazard.FloodModel,
36
+ hazard.FireModel,
37
+ hazard.WindModel,
38
+ )
39
+
40
+ HAZARD_MODELS = (
41
+ hazard.EarthQuakeModel,
42
+ hazard.FloodModelArea,
43
+ hazard.FireModelArea,
44
+ hazard.FloodModel,
45
+ hazard.FireModel,
46
+ hazard.WindModel,
47
+ frag.ProbabilityFunction,
48
+ frag.FragilityCurve,
49
+ frag.HazardFragilityCurves,
50
+ )
51
+
52
+ SUPPORTED_MODELS = [
53
+ hazard.EarthQuakeModel,
54
+ hazard.FloodModelArea,
55
+ hazard.FireModelArea,
56
+ hazard.FloodModel,
57
+ hazard.FireModel,
58
+ hazard.WindModel,
59
+ prob.AccelerationProbability,
60
+ prob.TemperatureProbability,
61
+ prob.DistanceProbability,
62
+ prob.SpeedProbability,
63
+ frag.ProbabilityFunction,
64
+ frag.FragilityCurve,
65
+ frag.HazardFragilityCurves,
66
+ asset.AssetState,
67
+ asset.Asset,
68
+ ]
@@ -0,0 +1,15 @@
1
+ from erad.default_fragility_curves.default_peak_ground_acceleration import (
2
+ DEFAULT_PEAK_GROUND_ACCELERATION_FRAGILITY_CURVES,
3
+ )
4
+ from erad.default_fragility_curves.default_peak_ground_velocity import (
5
+ DEFAULT_PEAK_GROUND_VELOCITY_FRAGILITY_CURVES,
6
+ )
7
+ from erad.default_fragility_curves.default_fire_boundary_dist import (
8
+ DEFAULT_FIRE_BOUNDARY_FRAGILITY_CURVES,
9
+ )
10
+ from erad.default_fragility_curves.default_flood_velocity import (
11
+ DEFAULT_FLOOD_VELOCITY_FRAGILITY_CURVES,
12
+ )
13
+ from erad.default_fragility_curves.default_flood_depth import DEFAULT_FLOOD_DEPTH_FRAGILITY_CURVES
14
+ from erad.default_fragility_curves.default_wind_speed import DEFAULT_WIND_SPEED_FRAGILITY_CURVES
15
+ from erad.default_fragility_curves.default_fragility_curves import DEFAULT_FRAGILTY_CURVES
@@ -0,0 +1,94 @@
1
+ from gdm.quantities import Distance
2
+
3
+ import erad.models.fragility_curve as frag
4
+ from erad.enums import AssetTypes
5
+
6
+ DEFAULT_FIRE_BOUNDARY_FRAGILITY_CURVES = frag.HazardFragilityCurves(
7
+ asset_state_param="fire_boundary_dist",
8
+ curves=[
9
+ frag.FragilityCurve(
10
+ asset_type=AssetTypes.switch,
11
+ prob_function=frag.ProbabilityFunction(
12
+ distribution="expon", parameters=[Distance(0.65, "km"), 0.95]
13
+ ),
14
+ ),
15
+ frag.FragilityCurve(
16
+ asset_type=AssetTypes.battery_storage,
17
+ prob_function=frag.ProbabilityFunction(
18
+ distribution="expon", parameters=[Distance(0.65, "km"), 0.95]
19
+ ),
20
+ ),
21
+ frag.FragilityCurve(
22
+ asset_type=AssetTypes.distribution_junction_box,
23
+ prob_function=frag.ProbabilityFunction(
24
+ distribution="expon", parameters=[Distance(0.5, "km"), 0.95]
25
+ ),
26
+ ),
27
+ frag.FragilityCurve(
28
+ asset_type=AssetTypes.distribution_overhead_lines,
29
+ prob_function=frag.ProbabilityFunction(
30
+ distribution="expon", parameters=[Distance(0.5, "km"), 0.95]
31
+ ),
32
+ ),
33
+ frag.FragilityCurve(
34
+ asset_type=AssetTypes.distribution_poles,
35
+ prob_function=frag.ProbabilityFunction(
36
+ distribution="expon", parameters=[Distance(1.0, "km"), 0.95]
37
+ ),
38
+ ),
39
+ frag.FragilityCurve(
40
+ asset_type=AssetTypes.distribution_underground_cables,
41
+ prob_function=frag.ProbabilityFunction(
42
+ distribution="expon", parameters=[Distance(0.1, "km"), 0.95]
43
+ ),
44
+ ),
45
+ frag.FragilityCurve(
46
+ asset_type=AssetTypes.solar_panels,
47
+ prob_function=frag.ProbabilityFunction(
48
+ distribution="expon", parameters=[Distance(0.55, "km"), 0.95]
49
+ ),
50
+ ),
51
+ frag.FragilityCurve(
52
+ asset_type=AssetTypes.substation,
53
+ prob_function=frag.ProbabilityFunction(
54
+ distribution="expon", parameters=[Distance(0.7, "km"), 0.95]
55
+ ),
56
+ ),
57
+ frag.FragilityCurve(
58
+ asset_type=AssetTypes.transformer_mad_mount,
59
+ prob_function=frag.ProbabilityFunction(
60
+ distribution="expon", parameters=[Distance(0.9, "km"), 0.95]
61
+ ),
62
+ ),
63
+ frag.FragilityCurve(
64
+ asset_type=AssetTypes.transformer_pole_mount,
65
+ prob_function=frag.ProbabilityFunction(
66
+ distribution="expon", parameters=[Distance(1.0, "km"), 0.95]
67
+ ),
68
+ ),
69
+ frag.FragilityCurve(
70
+ asset_type=AssetTypes.transmission_junction_box,
71
+ prob_function=frag.ProbabilityFunction(
72
+ distribution="expon", parameters=[Distance(0.55, "km"), 0.95]
73
+ ),
74
+ ),
75
+ frag.FragilityCurve(
76
+ asset_type=AssetTypes.transmission_overhead_lines,
77
+ prob_function=frag.ProbabilityFunction(
78
+ distribution="expon", parameters=[Distance(1.1, "km"), 0.95]
79
+ ),
80
+ ),
81
+ frag.FragilityCurve(
82
+ asset_type=AssetTypes.transmission_tower,
83
+ prob_function=frag.ProbabilityFunction(
84
+ distribution="expon", parameters=[Distance(0.7, "km"), 0.95]
85
+ ),
86
+ ),
87
+ frag.FragilityCurve(
88
+ asset_type=AssetTypes.transmission_underground_cables,
89
+ prob_function=frag.ProbabilityFunction(
90
+ distribution="expon", parameters=[Distance(0.15, "km"), 0.95]
91
+ ),
92
+ ),
93
+ ],
94
+ )
@@ -0,0 +1,108 @@
1
+ from gdm.quantities import Distance
2
+
3
+ import erad.models.fragility_curve as frag
4
+ from erad.enums import AssetTypes
5
+
6
+ DEFAULT_FLOOD_DEPTH_FRAGILITY_CURVES = frag.HazardFragilityCurves(
7
+ asset_state_param="flood_depth",
8
+ curves=[
9
+ frag.FragilityCurve(
10
+ asset_type=AssetTypes.switch,
11
+ prob_function=frag.ProbabilityFunction(
12
+ distribution="lognorm",
13
+ parameters=[Distance(0.35, "m"), Distance(0.50, "m"), 1 / 0.35],
14
+ ),
15
+ ),
16
+ frag.FragilityCurve(
17
+ asset_type=AssetTypes.battery_storage,
18
+ prob_function=frag.ProbabilityFunction(
19
+ distribution="lognorm",
20
+ parameters=[Distance(0.35, "m"), Distance(0.50, "m"), 1 / 0.35],
21
+ ),
22
+ ),
23
+ frag.FragilityCurve(
24
+ asset_type=AssetTypes.distribution_junction_box,
25
+ prob_function=frag.ProbabilityFunction(
26
+ distribution="lognorm",
27
+ parameters=[Distance(0.40, "m"), Distance(1.0, "m"), 1 / 0.40],
28
+ ),
29
+ ),
30
+ frag.FragilityCurve(
31
+ asset_type=AssetTypes.distribution_overhead_lines,
32
+ prob_function=frag.ProbabilityFunction(
33
+ distribution="lognorm",
34
+ parameters=[Distance(0.35, "m"), Distance(1.0, "m"), 1 / 0.35],
35
+ ),
36
+ ),
37
+ frag.FragilityCurve(
38
+ asset_type=AssetTypes.distribution_poles,
39
+ prob_function=frag.ProbabilityFunction(
40
+ distribution="lognorm",
41
+ parameters=[Distance(0.35, "m"), Distance(1.0, "m"), 1 / 0.35],
42
+ ),
43
+ ),
44
+ frag.FragilityCurve(
45
+ asset_type=AssetTypes.distribution_underground_cables,
46
+ prob_function=frag.ProbabilityFunction(
47
+ distribution="lognorm",
48
+ parameters=[Distance(0.8, "m"), Distance(1.0, "m"), 1 / 0.8],
49
+ ),
50
+ ),
51
+ frag.FragilityCurve(
52
+ asset_type=AssetTypes.solar_panels,
53
+ prob_function=frag.ProbabilityFunction(
54
+ distribution="lognorm",
55
+ parameters=[Distance(0.35, "m"), Distance(0.6, "m"), 1 / 0.35],
56
+ ),
57
+ ),
58
+ frag.FragilityCurve(
59
+ asset_type=AssetTypes.substation,
60
+ prob_function=frag.ProbabilityFunction(
61
+ distribution="lognorm",
62
+ parameters=[Distance(0.40, "m"), Distance(1.0, "m"), 1 / 0.4],
63
+ ),
64
+ ),
65
+ frag.FragilityCurve(
66
+ asset_type=AssetTypes.transformer_mad_mount,
67
+ prob_function=frag.ProbabilityFunction(
68
+ distribution="lognorm",
69
+ parameters=[Distance(0.35, "m"), Distance(0.6, "m"), 1 / 0.35],
70
+ ),
71
+ ),
72
+ frag.FragilityCurve(
73
+ asset_type=AssetTypes.transformer_pole_mount,
74
+ prob_function=frag.ProbabilityFunction(
75
+ distribution="lognorm",
76
+ parameters=[Distance(0.30, "m"), Distance(0.8, "m"), 1 / 0.3],
77
+ ),
78
+ ),
79
+ frag.FragilityCurve(
80
+ asset_type=AssetTypes.transmission_junction_box,
81
+ prob_function=frag.ProbabilityFunction(
82
+ distribution="lognorm",
83
+ parameters=[Distance(0.40, "m"), Distance(1.0, "m"), 1 / 0.40],
84
+ ),
85
+ ),
86
+ frag.FragilityCurve(
87
+ asset_type=AssetTypes.transmission_overhead_lines,
88
+ prob_function=frag.ProbabilityFunction(
89
+ distribution="lognorm",
90
+ parameters=[Distance(0.30, "m"), Distance(1.8, "m"), 1 / 0.3],
91
+ ),
92
+ ),
93
+ frag.FragilityCurve(
94
+ asset_type=AssetTypes.transmission_tower,
95
+ prob_function=frag.ProbabilityFunction(
96
+ distribution="lognorm",
97
+ parameters=[Distance(0.40, "m"), Distance(2.2, "m"), 1 / 0.40],
98
+ ),
99
+ ),
100
+ frag.FragilityCurve(
101
+ asset_type=AssetTypes.transmission_underground_cables,
102
+ prob_function=frag.ProbabilityFunction(
103
+ distribution="lognorm",
104
+ parameters=[Distance(0.25, "m"), Distance(0.8, "m"), 1 / 0.25],
105
+ ),
106
+ ),
107
+ ],
108
+ )