grid-data-models 0.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.
- grid_data_models-0.0.0/.gitignore +163 -0
- grid_data_models-0.0.0/LICENSE.txt +29 -0
- grid_data_models-0.0.0/PKG-INFO +54 -0
- grid_data_models-0.0.0/README.md +27 -0
- grid_data_models-0.0.0/pyproject.toml +81 -0
- grid_data_models-0.0.0/src/gdm/__init__.py +107 -0
- grid_data_models-0.0.0/src/gdm/bus.py +28 -0
- grid_data_models-0.0.0/src/gdm/capacitor.py +43 -0
- grid_data_models-0.0.0/src/gdm/dataset/__init__.py +0 -0
- grid_data_models-0.0.0/src/gdm/dataset/cost_model.py +49 -0
- grid_data_models-0.0.0/src/gdm/dataset/dataset_system.py +76 -0
- grid_data_models-0.0.0/src/gdm/distribution/__init__.py +3 -0
- grid_data_models-0.0.0/src/gdm/distribution/components/__init__.py +0 -0
- grid_data_models-0.0.0/src/gdm/distribution/components/distribution_branch.py +104 -0
- grid_data_models-0.0.0/src/gdm/distribution/components/distribution_bus.py +49 -0
- grid_data_models-0.0.0/src/gdm/distribution/components/distribution_capacitor.py +89 -0
- grid_data_models-0.0.0/src/gdm/distribution/components/distribution_component.py +25 -0
- grid_data_models-0.0.0/src/gdm/distribution/components/distribution_feeder.py +11 -0
- grid_data_models-0.0.0/src/gdm/distribution/components/distribution_fuse.py +13 -0
- grid_data_models-0.0.0/src/gdm/distribution/components/distribution_load.py +60 -0
- grid_data_models-0.0.0/src/gdm/distribution/components/distribution_recloser.py +13 -0
- grid_data_models-0.0.0/src/gdm/distribution/components/distribution_regulator.py +86 -0
- grid_data_models-0.0.0/src/gdm/distribution/components/distribution_solar.py +63 -0
- grid_data_models-0.0.0/src/gdm/distribution/components/distribution_substation.py +23 -0
- grid_data_models-0.0.0/src/gdm/distribution/components/distribution_switch.py +13 -0
- grid_data_models-0.0.0/src/gdm/distribution/components/distribution_transformer.py +132 -0
- grid_data_models-0.0.0/src/gdm/distribution/components/distribution_vsource.py +76 -0
- grid_data_models-0.0.0/src/gdm/distribution/components/geometry_branch.py +35 -0
- grid_data_models-0.0.0/src/gdm/distribution/components/matrix_impedance_branch.py +45 -0
- grid_data_models-0.0.0/src/gdm/distribution/components/matrix_impedance_fuse.py +24 -0
- grid_data_models-0.0.0/src/gdm/distribution/components/matrix_impedance_recloser.py +33 -0
- grid_data_models-0.0.0/src/gdm/distribution/components/matrix_impedance_switch.py +41 -0
- grid_data_models-0.0.0/src/gdm/distribution/components/sequence_impedance_branch.py +38 -0
- grid_data_models-0.0.0/src/gdm/distribution/controllers/__init__.py +0 -0
- grid_data_models-0.0.0/src/gdm/distribution/controllers/distribution_capacitor_controller.py +196 -0
- grid_data_models-0.0.0/src/gdm/distribution/controllers/distribution_inverter_controller.py +106 -0
- grid_data_models-0.0.0/src/gdm/distribution/controllers/distribution_recloser_controller.py +67 -0
- grid_data_models-0.0.0/src/gdm/distribution/controllers/distribution_regulator_controller.py +41 -0
- grid_data_models-0.0.0/src/gdm/distribution/controllers/distribution_switch_controller.py +28 -0
- grid_data_models-0.0.0/src/gdm/distribution/curve.py +67 -0
- grid_data_models-0.0.0/src/gdm/distribution/distribution_common.py +17 -0
- grid_data_models-0.0.0/src/gdm/distribution/distribution_enum.py +38 -0
- grid_data_models-0.0.0/src/gdm/distribution/distribution_graph.py +25 -0
- grid_data_models-0.0.0/src/gdm/distribution/distribution_system.py +26 -0
- grid_data_models-0.0.0/src/gdm/distribution/equipment/__init__.py +0 -0
- grid_data_models-0.0.0/src/gdm/distribution/equipment/bare_conductor_equipment.py +61 -0
- grid_data_models-0.0.0/src/gdm/distribution/equipment/capacitor_equipment.py +34 -0
- grid_data_models-0.0.0/src/gdm/distribution/equipment/concentric_cable_equipment.py +105 -0
- grid_data_models-0.0.0/src/gdm/distribution/equipment/distribution_transformer_equipment.py +248 -0
- grid_data_models-0.0.0/src/gdm/distribution/equipment/geometry_branch_equipment.py +57 -0
- grid_data_models-0.0.0/src/gdm/distribution/equipment/inverter_equipment.py +37 -0
- grid_data_models-0.0.0/src/gdm/distribution/equipment/load_equipment.py +31 -0
- grid_data_models-0.0.0/src/gdm/distribution/equipment/matrix_impedance_branch_equipment.py +56 -0
- grid_data_models-0.0.0/src/gdm/distribution/equipment/matrix_impedance_fuse_equipment.py +28 -0
- grid_data_models-0.0.0/src/gdm/distribution/equipment/matrix_impedance_recloser_equipment.py +16 -0
- grid_data_models-0.0.0/src/gdm/distribution/equipment/matrix_impedance_switch_equipment.py +29 -0
- grid_data_models-0.0.0/src/gdm/distribution/equipment/phase_capacitor_equipment.py +38 -0
- grid_data_models-0.0.0/src/gdm/distribution/equipment/phase_load_equipment.py +30 -0
- grid_data_models-0.0.0/src/gdm/distribution/equipment/recloser_controller_equipment.py +12 -0
- grid_data_models-0.0.0/src/gdm/distribution/equipment/sequence_impedance_branch_equipment.py +62 -0
- grid_data_models-0.0.0/src/gdm/distribution/equipment/solar_equipment.py +73 -0
- grid_data_models-0.0.0/src/gdm/distribution/limitset.py +32 -0
- grid_data_models-0.0.0/src/gdm/distribution/sequence_pair.py +10 -0
- grid_data_models-0.0.0/src/gdm/exceptions.py +13 -0
- grid_data_models-0.0.0/src/gdm/load.py +68 -0
- grid_data_models-0.0.0/src/gdm/quantities.py +146 -0
- grid_data_models-0.0.0/src/gdm/transformer.py +7 -0
- grid_data_models-0.0.0/src/gdm/transmission/transmission_branch.py +18 -0
- grid_data_models-0.0.0/src/gdm/transmission/transmission_bus.py +15 -0
- grid_data_models-0.0.0/src/gdm/transmission/transmission_capacitor.py +12 -0
- grid_data_models-0.0.0/src/gdm/transmission/transmission_component.py +13 -0
- grid_data_models-0.0.0/src/gdm/transmission/transmission_load.py +12 -0
- grid_data_models-0.0.0/src/gdm/transmission/transmission_substation.py +10 -0
- grid_data_models-0.0.0/src/gdm/version.py +62 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
*.code-workspace
|
|
9
|
+
*.sqlite
|
|
10
|
+
*.ruff_cache/
|
|
11
|
+
|
|
12
|
+
# Distribution / packaging
|
|
13
|
+
.Python
|
|
14
|
+
build/
|
|
15
|
+
develop-eggs/
|
|
16
|
+
dist/
|
|
17
|
+
downloads/
|
|
18
|
+
eggs/
|
|
19
|
+
.eggs/
|
|
20
|
+
lib/
|
|
21
|
+
lib64/
|
|
22
|
+
parts/
|
|
23
|
+
sdist/
|
|
24
|
+
var/
|
|
25
|
+
wheels/
|
|
26
|
+
share/python-wheels/
|
|
27
|
+
*.egg-info/
|
|
28
|
+
.installed.cfg
|
|
29
|
+
*.egg
|
|
30
|
+
MANIFEST
|
|
31
|
+
|
|
32
|
+
# PyInstaller
|
|
33
|
+
# Usually these files are written by a python script from a template
|
|
34
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
35
|
+
*.manifest
|
|
36
|
+
*.spec
|
|
37
|
+
|
|
38
|
+
# Installer logs
|
|
39
|
+
pip-log.txt
|
|
40
|
+
pip-delete-this-directory.txt
|
|
41
|
+
|
|
42
|
+
# Unit test / coverage reports
|
|
43
|
+
htmlcov/
|
|
44
|
+
.tox/
|
|
45
|
+
.nox/
|
|
46
|
+
.coverage
|
|
47
|
+
.coverage.*
|
|
48
|
+
.cache
|
|
49
|
+
nosetests.xml
|
|
50
|
+
coverage.xml
|
|
51
|
+
*.cover
|
|
52
|
+
*.py,cover
|
|
53
|
+
.hypothesis/
|
|
54
|
+
.pytest_cache/
|
|
55
|
+
cover/
|
|
56
|
+
|
|
57
|
+
# Translations
|
|
58
|
+
*.mo
|
|
59
|
+
*.pot
|
|
60
|
+
|
|
61
|
+
# Django stuff:
|
|
62
|
+
*.log
|
|
63
|
+
local_settings.py
|
|
64
|
+
db.sqlite3
|
|
65
|
+
db.sqlite3-journal
|
|
66
|
+
|
|
67
|
+
# Flask stuff:
|
|
68
|
+
instance/
|
|
69
|
+
.webassets-cache
|
|
70
|
+
|
|
71
|
+
# Scrapy stuff:
|
|
72
|
+
.scrapy
|
|
73
|
+
|
|
74
|
+
# Sphinx documentation
|
|
75
|
+
docs/_build/
|
|
76
|
+
|
|
77
|
+
# PyBuilder
|
|
78
|
+
.pybuilder/
|
|
79
|
+
target/
|
|
80
|
+
|
|
81
|
+
# Jupyter Notebook
|
|
82
|
+
.ipynb_checkpoints
|
|
83
|
+
|
|
84
|
+
# IPython
|
|
85
|
+
profile_default/
|
|
86
|
+
ipython_config.py
|
|
87
|
+
|
|
88
|
+
# pyenv
|
|
89
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
90
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
91
|
+
# .python-version
|
|
92
|
+
|
|
93
|
+
# pipenv
|
|
94
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
95
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
96
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
97
|
+
# install all needed dependencies.
|
|
98
|
+
#Pipfile.lock
|
|
99
|
+
|
|
100
|
+
# poetry
|
|
101
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
102
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
103
|
+
# commonly ignored for libraries.
|
|
104
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
105
|
+
#poetry.lock
|
|
106
|
+
|
|
107
|
+
# pdm
|
|
108
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
109
|
+
#pdm.lock
|
|
110
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
111
|
+
# in version control.
|
|
112
|
+
# https://pdm.fming.dev/#use-with-ide
|
|
113
|
+
.pdm.toml
|
|
114
|
+
|
|
115
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
116
|
+
__pypackages__/
|
|
117
|
+
|
|
118
|
+
# Celery stuff
|
|
119
|
+
celerybeat-schedule
|
|
120
|
+
celerybeat.pid
|
|
121
|
+
|
|
122
|
+
# SageMath parsed files
|
|
123
|
+
*.sage.py
|
|
124
|
+
|
|
125
|
+
# Environments
|
|
126
|
+
.env
|
|
127
|
+
.venv
|
|
128
|
+
env/
|
|
129
|
+
venv/
|
|
130
|
+
ENV/
|
|
131
|
+
env.bak/
|
|
132
|
+
venv.bak/
|
|
133
|
+
|
|
134
|
+
# Spyder project settings
|
|
135
|
+
.spyderproject
|
|
136
|
+
.spyproject
|
|
137
|
+
|
|
138
|
+
# Rope project settings
|
|
139
|
+
.ropeproject
|
|
140
|
+
|
|
141
|
+
# mkdocs documentation
|
|
142
|
+
/site
|
|
143
|
+
|
|
144
|
+
# mypy
|
|
145
|
+
.mypy_cache/
|
|
146
|
+
.dmypy.json
|
|
147
|
+
dmypy.json
|
|
148
|
+
|
|
149
|
+
# Pyre type checker
|
|
150
|
+
.pyre/
|
|
151
|
+
|
|
152
|
+
# pytype static type analyzer
|
|
153
|
+
.pytype/
|
|
154
|
+
|
|
155
|
+
# Cython debug symbols
|
|
156
|
+
cython_debug/
|
|
157
|
+
|
|
158
|
+
# PyCharm
|
|
159
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
160
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
161
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
162
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
163
|
+
#.idea/
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024, 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
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: grid-data-models
|
|
3
|
+
Version: 0.0.0
|
|
4
|
+
Project-URL: Documentation, https://github.com/NREL-Distribution-Suites/grid-data-models#readme
|
|
5
|
+
Project-URL: Issues, https://github.com/NREL-Distribution-Suites/grid-data-models/issues
|
|
6
|
+
Project-URL: Source, https://github.com/NREL-Distribution-Suites/grid-data-models
|
|
7
|
+
Author-email: Kapil Duwadi <Kapil.Duwadi@nrel.gov>, Aadil Latif <Aadil.Latif@nrel.gov>, Tarek Elgindy <tarek.elgindy@nrel.gov>
|
|
8
|
+
License-Expression: BSD-3-Clause
|
|
9
|
+
License-File: LICENSE.txt
|
|
10
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Requires-Python: >=3.11
|
|
14
|
+
Requires-Dist: infrasys
|
|
15
|
+
Requires-Dist: networkx
|
|
16
|
+
Provides-Extra: dev
|
|
17
|
+
Requires-Dist: pre-commit; extra == 'dev'
|
|
18
|
+
Requires-Dist: pytest; extra == 'dev'
|
|
19
|
+
Requires-Dist: pytest-cov; extra == 'dev'
|
|
20
|
+
Requires-Dist: ruff; extra == 'dev'
|
|
21
|
+
Provides-Extra: doc
|
|
22
|
+
Requires-Dist: myst-parser; extra == 'doc'
|
|
23
|
+
Requires-Dist: sphinx; extra == 'doc'
|
|
24
|
+
Requires-Dist: sphinx-immaterial; extra == 'doc'
|
|
25
|
+
Requires-Dist: sphinxcontrib-mermaid; extra == 'doc'
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
|
|
28
|
+
# Grid Data Models (GDM)
|
|
29
|
+
|
|
30
|
+
GDM is a python package containing [pydantic](https://docs.pydantic.dev/latest/) data models for power system assets and datasets. This package is actively being developed at [National Renewable Energy Laboratory (NREL)](https://www.nrel.gov/).
|
|
31
|
+
|
|
32
|
+
## Why Grid Data Models ?
|
|
33
|
+
|
|
34
|
+
In an effort to reduce code duplication and provide client packages a standard interface to interact with power system data, a group of
|
|
35
|
+
research engineers at NREL is working on developing standard data models. Features:
|
|
36
|
+
|
|
37
|
+
- **Builtin validation layer:** Use of [pydantic](https://docs.pydantic.dev/latest/) in creating data models allows us to check for fields during the time of construction and update.
|
|
38
|
+
- **Timeseries data management:** GDM uses [infrasys](https://github.nrel.gov/CADET/infrastructure_systems) package which enables attaching time series data to fields in the data model. For example, we can attach time series power consumption data to a load profile.
|
|
39
|
+
- **Builtin unit conversion:** GDM leverages [pint](https://pint.readthedocs.io/en/stable/) for unit conversion for power system quantities. For e.g power, voltage, time etc.
|
|
40
|
+
- **JSON serialization/deserializatin:** GDM uses [infrasys](https://github.nrel.gov/CADET/infrastructure_systems) to serialize and deserialize distribution system containing power system components and time series data attached to components.
|
|
41
|
+
|
|
42
|
+
## How to get started ?
|
|
43
|
+
|
|
44
|
+
To get started, you can clone and pip install this library from [here](https://github.nrel.gov/CADET/grid-data-models).
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
## Contributors
|
|
48
|
+
|
|
49
|
+
- **Kapil Duwadi**
|
|
50
|
+
- **Tarek Elgindy**
|
|
51
|
+
- **Aadil Latif**
|
|
52
|
+
- **Pedro Andres Sanchez Perez**
|
|
53
|
+
- **Daniel Thompson**
|
|
54
|
+
- **Jeremy Keen**
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Grid Data Models (GDM)
|
|
2
|
+
|
|
3
|
+
GDM is a python package containing [pydantic](https://docs.pydantic.dev/latest/) data models for power system assets and datasets. This package is actively being developed at [National Renewable Energy Laboratory (NREL)](https://www.nrel.gov/).
|
|
4
|
+
|
|
5
|
+
## Why Grid Data Models ?
|
|
6
|
+
|
|
7
|
+
In an effort to reduce code duplication and provide client packages a standard interface to interact with power system data, a group of
|
|
8
|
+
research engineers at NREL is working on developing standard data models. Features:
|
|
9
|
+
|
|
10
|
+
- **Builtin validation layer:** Use of [pydantic](https://docs.pydantic.dev/latest/) in creating data models allows us to check for fields during the time of construction and update.
|
|
11
|
+
- **Timeseries data management:** GDM uses [infrasys](https://github.nrel.gov/CADET/infrastructure_systems) package which enables attaching time series data to fields in the data model. For example, we can attach time series power consumption data to a load profile.
|
|
12
|
+
- **Builtin unit conversion:** GDM leverages [pint](https://pint.readthedocs.io/en/stable/) for unit conversion for power system quantities. For e.g power, voltage, time etc.
|
|
13
|
+
- **JSON serialization/deserializatin:** GDM uses [infrasys](https://github.nrel.gov/CADET/infrastructure_systems) to serialize and deserialize distribution system containing power system components and time series data attached to components.
|
|
14
|
+
|
|
15
|
+
## How to get started ?
|
|
16
|
+
|
|
17
|
+
To get started, you can clone and pip install this library from [here](https://github.nrel.gov/CADET/grid-data-models).
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
## Contributors
|
|
21
|
+
|
|
22
|
+
- **Kapil Duwadi**
|
|
23
|
+
- **Tarek Elgindy**
|
|
24
|
+
- **Aadil Latif**
|
|
25
|
+
- **Pedro Andres Sanchez Perez**
|
|
26
|
+
- **Daniel Thompson**
|
|
27
|
+
- **Jeremy Keen**
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "grid-data-models"
|
|
7
|
+
dynamic = ["version"]
|
|
8
|
+
description = ''
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.11"
|
|
11
|
+
license = "BSD-3-Clause"
|
|
12
|
+
keywords = []
|
|
13
|
+
authors = [
|
|
14
|
+
{ name = "Kapil Duwadi", email = "Kapil.Duwadi@nrel.gov" },
|
|
15
|
+
{ name = "Aadil Latif", email = "Aadil.Latif@nrel.gov" },
|
|
16
|
+
{ name = "Tarek Elgindy", email = "tarek.elgindy@nrel.gov" },
|
|
17
|
+
]
|
|
18
|
+
classifiers = [
|
|
19
|
+
"Programming Language :: Python :: 3.11",
|
|
20
|
+
"License :: OSI Approved :: BSD License",
|
|
21
|
+
"Operating System :: OS Independent",
|
|
22
|
+
]
|
|
23
|
+
dependencies = ["networkx", "infrasys"]
|
|
24
|
+
|
|
25
|
+
[project.optional-dependencies]
|
|
26
|
+
dev = ["pre-commit", "pytest", "pytest-cov", "ruff"]
|
|
27
|
+
doc = ["sphinx", "sphinx-immaterial", "myst-parser", "sphinxcontrib-mermaid"]
|
|
28
|
+
|
|
29
|
+
[project.urls]
|
|
30
|
+
Documentation = "https://github.com/NREL-Distribution-Suites/grid-data-models#readme"
|
|
31
|
+
Issues = "https://github.com/NREL-Distribution-Suites/grid-data-models/issues"
|
|
32
|
+
Source = "https://github.com/NREL-Distribution-Suites/grid-data-models"
|
|
33
|
+
|
|
34
|
+
[tool.ruff]
|
|
35
|
+
# Exclude a variety of commonly ignored directories.
|
|
36
|
+
exclude = [".git", ".ruff_cache", ".venv", "_build", "build", "dist", "venv"]
|
|
37
|
+
ignore-init-module-imports = true
|
|
38
|
+
line-length = 99
|
|
39
|
+
indent-width = 4
|
|
40
|
+
target-version = "py311"
|
|
41
|
+
|
|
42
|
+
[tool.hatch.version]
|
|
43
|
+
path = 'src/gdm/version.py'
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
[tool.ruff.lint]
|
|
47
|
+
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
|
|
48
|
+
select = [
|
|
49
|
+
"C901", # McCabe complexity
|
|
50
|
+
"E4", # Subset of pycodestyle (E)
|
|
51
|
+
"E7",
|
|
52
|
+
"E9",
|
|
53
|
+
"F", # Pyflakes
|
|
54
|
+
"W", # pycodestyle warnings
|
|
55
|
+
]
|
|
56
|
+
ignore = []
|
|
57
|
+
|
|
58
|
+
# Allow fix for all enabled rules (when `--fix`) is provided.
|
|
59
|
+
fixable = ["ALL"]
|
|
60
|
+
unfixable = []
|
|
61
|
+
|
|
62
|
+
[tool.ruff.format]
|
|
63
|
+
quote-style = "double"
|
|
64
|
+
indent-style = "space"
|
|
65
|
+
skip-magic-trailing-comma = false
|
|
66
|
+
line-ending = "auto"
|
|
67
|
+
docstring-code-format = true
|
|
68
|
+
docstring-code-line-length = "dynamic"
|
|
69
|
+
|
|
70
|
+
[tool.hatch.metadata]
|
|
71
|
+
allow-direct-references = true
|
|
72
|
+
|
|
73
|
+
[tool.ruff.lint.per-file-ignores]
|
|
74
|
+
"__init__.py" = ["E402", "F401"]
|
|
75
|
+
"**/{tests,docs,tools}/*" = ["E402"]
|
|
76
|
+
|
|
77
|
+
[tool.hatch.build.targets.wheel]
|
|
78
|
+
packages = ["src/gdm"]
|
|
79
|
+
|
|
80
|
+
[tool.hatch.build.targets.sdist]
|
|
81
|
+
include = ["src/gdm"]
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
""" Managing imports for this package."""
|
|
2
|
+
|
|
3
|
+
from gdm.distribution.components.distribution_substation import DistributionSubstation
|
|
4
|
+
from gdm.distribution.components.distribution_component import DistributionComponent
|
|
5
|
+
from gdm.distribution.components.distribution_feeder import DistributionFeeder
|
|
6
|
+
from gdm.distribution.components.distribution_bus import DistributionBus
|
|
7
|
+
from gdm.distribution.components.distribution_vsource import (
|
|
8
|
+
PhaseVoltageSourceEquipment,
|
|
9
|
+
VoltageSourceEquipment,
|
|
10
|
+
DistributionVoltageSource,
|
|
11
|
+
)
|
|
12
|
+
from gdm.distribution.components.distribution_branch import (
|
|
13
|
+
DistributionBranch,
|
|
14
|
+
SwitchedDistributionBranch,
|
|
15
|
+
)
|
|
16
|
+
from gdm.distribution.components.sequence_impedance_branch import SequenceImpedanceBranch
|
|
17
|
+
from gdm.distribution.components.matrix_impedance_branch import MatrixImpedanceBranch
|
|
18
|
+
from gdm.distribution.components.geometry_branch import GeometryBranch
|
|
19
|
+
from gdm.distribution.components.distribution_switch import DistributionSwitch
|
|
20
|
+
from gdm.distribution.components.matrix_impedance_switch import MatrixImpedanceSwitch
|
|
21
|
+
from gdm.distribution.components.distribution_fuse import DistributionFuse
|
|
22
|
+
from gdm.distribution.components.matrix_impedance_fuse import MatrixImpedanceFuse
|
|
23
|
+
from gdm.distribution.components.distribution_recloser import DistributionRecloser
|
|
24
|
+
from gdm.distribution.components.matrix_impedance_recloser import MatrixImpedanceRecloser
|
|
25
|
+
from gdm.distribution.components.distribution_load import DistributionLoad
|
|
26
|
+
from gdm.distribution.components.distribution_transformer import (
|
|
27
|
+
DistributionTransformer,
|
|
28
|
+
)
|
|
29
|
+
from gdm.distribution.components.distribution_regulator import DistributionRegulator
|
|
30
|
+
from gdm.distribution.components.distribution_solar import (
|
|
31
|
+
DistributionSolar,
|
|
32
|
+
)
|
|
33
|
+
from gdm.distribution.components.distribution_capacitor import DistributionCapacitor
|
|
34
|
+
|
|
35
|
+
from gdm.distribution.equipment.matrix_impedance_branch_equipment import (
|
|
36
|
+
MatrixImpedanceBranchEquipment,
|
|
37
|
+
)
|
|
38
|
+
from gdm.distribution.equipment.bare_conductor_equipment import BareConductorEquipment
|
|
39
|
+
from gdm.distribution.equipment.concentric_cable_equipment import ConcentricCableEquipment
|
|
40
|
+
from gdm.distribution.equipment.matrix_impedance_fuse_equipment import MatrixImpedanceFuseEquipment
|
|
41
|
+
from gdm.distribution.equipment.matrix_impedance_recloser_equipment import (
|
|
42
|
+
MatrixImpedanceRecloserEquipment,
|
|
43
|
+
)
|
|
44
|
+
from gdm.distribution.equipment.matrix_impedance_switch_equipment import (
|
|
45
|
+
MatrixImpedanceSwitchEquipment,
|
|
46
|
+
)
|
|
47
|
+
from gdm.distribution.equipment.recloser_controller_equipment import RecloserControllerEquipment
|
|
48
|
+
from gdm.distribution.equipment.phase_capacitor_equipment import PhaseCapacitorEquipment
|
|
49
|
+
from gdm.distribution.equipment.capacitor_equipment import CapacitorEquipment
|
|
50
|
+
from gdm.distribution.equipment.geometry_branch_equipment import GeometryBranchEquipment
|
|
51
|
+
from gdm.distribution.equipment.sequence_impedance_branch_equipment import (
|
|
52
|
+
SequenceImpedanceBranchEquipment,
|
|
53
|
+
)
|
|
54
|
+
from gdm.distribution.equipment.phase_load_equipment import PhaseLoadEquipment
|
|
55
|
+
from gdm.distribution.equipment.load_equipment import LoadEquipment
|
|
56
|
+
|
|
57
|
+
from gdm.distribution.equipment.distribution_transformer_equipment import (
|
|
58
|
+
DistributionTransformerEquipment,
|
|
59
|
+
TapWindingEquipment,
|
|
60
|
+
WindingEquipment,
|
|
61
|
+
)
|
|
62
|
+
from gdm.distribution.equipment.solar_equipment import SolarEquipment
|
|
63
|
+
from gdm.distribution.equipment.inverter_equipment import InverterEquipment
|
|
64
|
+
|
|
65
|
+
from gdm.distribution.controllers.distribution_inverter_controller import (
|
|
66
|
+
InverterController,
|
|
67
|
+
PowerfactorInverterController,
|
|
68
|
+
VoltVarInverterController,
|
|
69
|
+
VoltVarVoltWattInverterController,
|
|
70
|
+
VoltWattInverterController,
|
|
71
|
+
)
|
|
72
|
+
from gdm.distribution.controllers.distribution_capacitor_controller import (
|
|
73
|
+
CapacitorController,
|
|
74
|
+
VoltageCapacitorController,
|
|
75
|
+
ActivePowerCapacitorController,
|
|
76
|
+
ReactivePowerCapacitorController,
|
|
77
|
+
CurrentCapacitorController,
|
|
78
|
+
DailyTimedCapacitorController,
|
|
79
|
+
)
|
|
80
|
+
from gdm.distribution.controllers.distribution_regulator_controller import (
|
|
81
|
+
RegulatorController,
|
|
82
|
+
)
|
|
83
|
+
from gdm.distribution.controllers.distribution_switch_controller import (
|
|
84
|
+
DistributionSwitchController,
|
|
85
|
+
)
|
|
86
|
+
from gdm.distribution.controllers.distribution_recloser_controller import (
|
|
87
|
+
DistributionRecloserController,
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
from gdm.distribution.sequence_pair import SequencePair
|
|
91
|
+
from gdm.distribution.limitset import ThermalLimitSet, VoltageLimitSet
|
|
92
|
+
from gdm.distribution.distribution_enum import (
|
|
93
|
+
Phase,
|
|
94
|
+
ConnectionType,
|
|
95
|
+
VoltageTypes,
|
|
96
|
+
LimitType,
|
|
97
|
+
)
|
|
98
|
+
from gdm.distribution.distribution_system import DistributionSystem
|
|
99
|
+
from gdm.distribution.distribution_graph import build_graph_from_system
|
|
100
|
+
from gdm.distribution.curve import Curve, TimeCurrentCurve
|
|
101
|
+
|
|
102
|
+
from gdm.transmission.transmission_bus import TransmissionBus
|
|
103
|
+
from gdm.transmission.transmission_component import TransmissionComponent
|
|
104
|
+
from gdm.transmission.transmission_branch import TransmissionBranch
|
|
105
|
+
from gdm.transmission.transmission_capacitor import TransmissionCapacitor
|
|
106
|
+
from gdm.transmission.transmission_load import TransmissionLoad
|
|
107
|
+
from gdm.transmission.transmission_substation import TransmissionSubstation
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
""" Interface for power system bus."""
|
|
2
|
+
|
|
3
|
+
from typing import Annotated, Optional
|
|
4
|
+
|
|
5
|
+
from infrasys import Component, Location
|
|
6
|
+
from pydantic import Field
|
|
7
|
+
|
|
8
|
+
from gdm.quantities import PositiveVoltage
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class PowerSystemBus(Component):
|
|
12
|
+
"""Interface for power system bus."""
|
|
13
|
+
|
|
14
|
+
nominal_voltage: Annotated[
|
|
15
|
+
PositiveVoltage, Field(..., description="Nominal voltage for this bus.")
|
|
16
|
+
]
|
|
17
|
+
coordinate: Annotated[
|
|
18
|
+
Optional[Location],
|
|
19
|
+
Field(None, description="Coordinate for the power system bus."),
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
@classmethod
|
|
23
|
+
def example(cls) -> "PowerSystemBus":
|
|
24
|
+
return PowerSystemBus(
|
|
25
|
+
name="Bus1",
|
|
26
|
+
nominal_voltage=PositiveVoltage(400, "volt"),
|
|
27
|
+
coordinate=Location(x=20.0, y=30.0),
|
|
28
|
+
)
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
""" This module contains interface for power system capacitor."""
|
|
2
|
+
|
|
3
|
+
# pylint:disable=pointless-statement
|
|
4
|
+
|
|
5
|
+
from typing import Annotated
|
|
6
|
+
|
|
7
|
+
from pydantic import Field, NonNegativeInt, PositiveInt, model_validator
|
|
8
|
+
|
|
9
|
+
from infrasys import Component
|
|
10
|
+
from gdm.quantities import PositiveReactivePower
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class PowerSystemCapacitor(Component):
|
|
14
|
+
"""Interface for power system capacitor."""
|
|
15
|
+
|
|
16
|
+
rated_capacity: Annotated[
|
|
17
|
+
PositiveReactivePower,
|
|
18
|
+
Field(..., description="Capacity of this capacitor."),
|
|
19
|
+
]
|
|
20
|
+
num_banks_on: Annotated[
|
|
21
|
+
NonNegativeInt, Field(..., description="Number of banks currently on.")
|
|
22
|
+
]
|
|
23
|
+
num_banks: Annotated[PositiveInt, Field(1, description="Number of banks in the capacitor.")]
|
|
24
|
+
|
|
25
|
+
@model_validator(mode="after")
|
|
26
|
+
def validate_fields(self) -> "PowerSystemCapacitor":
|
|
27
|
+
"""Custom validator for fields."""
|
|
28
|
+
if self.num_banks < self.num_banks_on:
|
|
29
|
+
msg = f"Status {self.num_banks_on} must be less than or equal"
|
|
30
|
+
f"to number of banks. {self.num_banks}"
|
|
31
|
+
raise ValueError(msg)
|
|
32
|
+
|
|
33
|
+
return self
|
|
34
|
+
|
|
35
|
+
@classmethod
|
|
36
|
+
def example(cls) -> "PowerSystemCapacitor":
|
|
37
|
+
"""Example for power system capacitor."""
|
|
38
|
+
return PowerSystemCapacitor(
|
|
39
|
+
name="Phase-Cap-1",
|
|
40
|
+
rated_capacity=PositiveReactivePower(200, "kvar"),
|
|
41
|
+
num_banks_on=1,
|
|
42
|
+
num_banks=1,
|
|
43
|
+
)
|
|
File without changes
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"""This module contains cost model interface."""
|
|
2
|
+
|
|
3
|
+
from datetime import datetime
|
|
4
|
+
from enum import Enum
|
|
5
|
+
from typing import Annotated, Optional
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
from pydantic import (
|
|
9
|
+
PlainSerializer,
|
|
10
|
+
PositiveFloat,
|
|
11
|
+
ConfigDict,
|
|
12
|
+
model_validator,
|
|
13
|
+
)
|
|
14
|
+
from infrasys import Component
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class OperatingUnitEnum(str, Enum):
|
|
18
|
+
"""Interface for operating unit enumeration."""
|
|
19
|
+
|
|
20
|
+
KWH = "kWh"
|
|
21
|
+
HOUR = "hr"
|
|
22
|
+
KW = "kW"
|
|
23
|
+
KVA = "kVA"
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class CostModel(Component):
|
|
27
|
+
"""Interface for base cost model."""
|
|
28
|
+
|
|
29
|
+
purchase_date: Annotated[datetime, PlainSerializer(lambda x: x.strftime("%Y-%m-%d %H:%M:%S"))]
|
|
30
|
+
capital_dollars: PositiveFloat
|
|
31
|
+
operating_dollars: Optional[PositiveFloat] = None
|
|
32
|
+
operating_unit: Optional[OperatingUnitEnum] = None
|
|
33
|
+
labor_dollars: Optional[PositiveFloat] = None
|
|
34
|
+
name: str = ""
|
|
35
|
+
notes: Optional[str] = None
|
|
36
|
+
location: Optional[str] = None
|
|
37
|
+
model_config = ConfigDict(arbitrary_types_allowed=True, use_enum_values=False)
|
|
38
|
+
|
|
39
|
+
@model_validator(mode="after")
|
|
40
|
+
def validate_fields(self) -> "CostModel":
|
|
41
|
+
"""Custom validator for cost fields."""
|
|
42
|
+
if self.operating_dollars is not None and self.operating_unit is None:
|
|
43
|
+
msg = "Operating unit can not be null when operating dollar is specified"
|
|
44
|
+
raise ValueError(msg)
|
|
45
|
+
|
|
46
|
+
@classmethod
|
|
47
|
+
def example(cls) -> "CostModel":
|
|
48
|
+
"""Example for cost model."""
|
|
49
|
+
return CostModel(purchase_date=datetime.utcnow(), capital_dollars=234.45)
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"""This module contains dataset store."""
|
|
2
|
+
|
|
3
|
+
from typing import Any
|
|
4
|
+
from uuid import UUID
|
|
5
|
+
|
|
6
|
+
from infrasys import System, Component
|
|
7
|
+
|
|
8
|
+
from gdm.exceptions import GDMIncompatibleInstanceError
|
|
9
|
+
from gdm.dataset.cost_model import CostModel
|
|
10
|
+
import gdm
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class DatasetSystem(System):
|
|
14
|
+
"""Class interface for dataset system."""
|
|
15
|
+
|
|
16
|
+
def __init__(self, *args, catalog_cost_mapping: dict[str, list[str]] | None = None, **kwargs):
|
|
17
|
+
super().__init__(*args, **kwargs)
|
|
18
|
+
self.data_format_version = gdm.distribution.__version__
|
|
19
|
+
self.catalog_cost_mapping = catalog_cost_mapping or {}
|
|
20
|
+
|
|
21
|
+
def serialize_system_attributes(self) -> dict[str, Any]:
|
|
22
|
+
"""Method to serialize system attributes."""
|
|
23
|
+
return {"catalog_cost_mapping": self.catalog_cost_mapping}
|
|
24
|
+
|
|
25
|
+
def deserialize_system_attributes(self, data: dict[str, Any]) -> None:
|
|
26
|
+
"""Method to deserialize system attributes."""
|
|
27
|
+
self.catalog_cost_mapping = data["catalog_cost_mapping"]
|
|
28
|
+
|
|
29
|
+
def add_cost(self, catalog: Component, cost: CostModel):
|
|
30
|
+
"""Method to add cost to catalog."""
|
|
31
|
+
|
|
32
|
+
if isinstance(catalog, CostModel):
|
|
33
|
+
msg = f"Catalog can not be an instance of cost model {catalog=}"
|
|
34
|
+
raise GDMIncompatibleInstanceError(msg)
|
|
35
|
+
|
|
36
|
+
self.add_component(cost)
|
|
37
|
+
cost = self.get_component(CostModel, name=cost.name)
|
|
38
|
+
catalog_uuid = str(catalog.uuid)
|
|
39
|
+
cost_uuid = str(cost.uuid)
|
|
40
|
+
|
|
41
|
+
if catalog_uuid not in self.catalog_cost_mapping:
|
|
42
|
+
self.catalog_cost_mapping[catalog_uuid] = []
|
|
43
|
+
|
|
44
|
+
if cost_uuid not in self.catalog_cost_mapping[catalog_uuid]:
|
|
45
|
+
self.catalog_cost_mapping[catalog_uuid].append(cost_uuid)
|
|
46
|
+
|
|
47
|
+
def add_costs(self, catalog: Component, costs: list[CostModel]):
|
|
48
|
+
"""Method to add cost to catalog."""
|
|
49
|
+
for cost in costs:
|
|
50
|
+
self.add_cost(catalog, cost)
|
|
51
|
+
|
|
52
|
+
def get_costs(self, catalog: Component) -> list[CostModel]:
|
|
53
|
+
"""Get costs for a catalog."""
|
|
54
|
+
|
|
55
|
+
catalog_uuid = str(catalog.uuid)
|
|
56
|
+
if catalog_uuid not in self.catalog_cost_mapping:
|
|
57
|
+
return []
|
|
58
|
+
|
|
59
|
+
return [
|
|
60
|
+
self.get_component_by_uuid(UUID(cost_uuid))
|
|
61
|
+
for cost_uuid in self.catalog_cost_mapping[catalog_uuid]
|
|
62
|
+
]
|
|
63
|
+
|
|
64
|
+
def remove_cost(self, catalog: Component, cost: CostModel):
|
|
65
|
+
"""Remove cost from the catalog."""
|
|
66
|
+
|
|
67
|
+
self.remove_component(cost)
|
|
68
|
+
|
|
69
|
+
catalog_uuid = str(catalog.uuid)
|
|
70
|
+
cost_uuid = str(cost.uuid)
|
|
71
|
+
|
|
72
|
+
if (
|
|
73
|
+
str(catalog_uuid) in self.catalog_cost_mapping
|
|
74
|
+
and cost_uuid in self.catalog_cost_mapping[catalog_uuid]
|
|
75
|
+
):
|
|
76
|
+
self.catalog_cost_mapping[catalog_uuid].remove(cost_uuid)
|
|
File without changes
|