esapp 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 (85) hide show
  1. esapp-0.1.0/LICENSE +201 -0
  2. esapp-0.1.0/PKG-INFO +173 -0
  3. esapp-0.1.0/README.rst +121 -0
  4. esapp-0.1.0/VERSION +1 -0
  5. esapp-0.1.0/docs/conf.py +96 -0
  6. esapp-0.1.0/esapp/__init__.py +26 -0
  7. esapp-0.1.0/esapp/apps/__init__.py +19 -0
  8. esapp-0.1.0/esapp/apps/dynamics.py +135 -0
  9. esapp-0.1.0/esapp/apps/gic.py +1178 -0
  10. esapp-0.1.0/esapp/apps/modes.py +35 -0
  11. esapp-0.1.0/esapp/apps/network.py +376 -0
  12. esapp-0.1.0/esapp/apps/static.py +501 -0
  13. esapp-0.1.0/esapp/dev/generate_components.py +266 -0
  14. esapp-0.1.0/esapp/gobject.py +123 -0
  15. esapp-0.1.0/esapp/grid.py +178613 -0
  16. esapp-0.1.0/esapp/indexable.py +231 -0
  17. esapp-0.1.0/esapp/saw/__init__.py +52 -0
  18. esapp-0.1.0/esapp/saw/_exceptions.py +148 -0
  19. esapp-0.1.0/esapp/saw/_helpers.py +109 -0
  20. esapp-0.1.0/esapp/saw/atc.py +451 -0
  21. esapp-0.1.0/esapp/saw/base.py +1552 -0
  22. esapp-0.1.0/esapp/saw/case_actions.py +403 -0
  23. esapp-0.1.0/esapp/saw/contingency.py +851 -0
  24. esapp-0.1.0/esapp/saw/fault.py +66 -0
  25. esapp-0.1.0/esapp/saw/general.py +829 -0
  26. esapp-0.1.0/esapp/saw/gic.py +380 -0
  27. esapp-0.1.0/esapp/saw/matrices.py +339 -0
  28. esapp-0.1.0/esapp/saw/modify.py +877 -0
  29. esapp-0.1.0/esapp/saw/oneline.py +302 -0
  30. esapp-0.1.0/esapp/saw/opf.py +132 -0
  31. esapp-0.1.0/esapp/saw/powerflow.py +241 -0
  32. esapp-0.1.0/esapp/saw/pv.py +169 -0
  33. esapp-0.1.0/esapp/saw/qv.py +155 -0
  34. esapp-0.1.0/esapp/saw/regions.py +193 -0
  35. esapp-0.1.0/esapp/saw/saw.py +55 -0
  36. esapp-0.1.0/esapp/saw/scheduled.py +173 -0
  37. esapp-0.1.0/esapp/saw/sensitivity.py +521 -0
  38. esapp-0.1.0/esapp/saw/timestep.py +339 -0
  39. esapp-0.1.0/esapp/saw/topology.py +409 -0
  40. esapp-0.1.0/esapp/saw/transient.py +472 -0
  41. esapp-0.1.0/esapp/saw/weather.py +196 -0
  42. esapp-0.1.0/esapp/utils/__init__.py +8 -0
  43. esapp-0.1.0/esapp/utils/b3d.py +234 -0
  44. esapp-0.1.0/esapp/utils/decorators.py +13 -0
  45. esapp-0.1.0/esapp/utils/exceptions.py +42 -0
  46. esapp-0.1.0/esapp/utils/map.py +204 -0
  47. esapp-0.1.0/esapp/utils/mathtools.py +451 -0
  48. esapp-0.1.0/esapp/utils/mesh.py +193 -0
  49. esapp-0.1.0/esapp/utils/misc.py +135 -0
  50. esapp-0.1.0/esapp/utils/plotwavelet.py +157 -0
  51. esapp-0.1.0/esapp/utils/shapes/Texas/Shape.cpg +1 -0
  52. esapp-0.1.0/esapp/utils/shapes/Texas/Shape.dbf +0 -0
  53. esapp-0.1.0/esapp/utils/shapes/Texas/Shape.prj +1 -0
  54. esapp-0.1.0/esapp/utils/shapes/Texas/Shape.shp +0 -0
  55. esapp-0.1.0/esapp/utils/shapes/Texas/Shape.shx +0 -0
  56. esapp-0.1.0/esapp/utils/shapes/US/Shape.cpg +1 -0
  57. esapp-0.1.0/esapp/utils/shapes/US/Shape.dbf +0 -0
  58. esapp-0.1.0/esapp/utils/shapes/US/Shape.prj +1 -0
  59. esapp-0.1.0/esapp/utils/shapes/US/Shape.shp +0 -0
  60. esapp-0.1.0/esapp/utils/shapes/US/Shape.shp.ea.iso.xml +254 -0
  61. esapp-0.1.0/esapp/utils/shapes/US/Shape.shx +0 -0
  62. esapp-0.1.0/esapp/utils/shapes/US/Shape.xml +531 -0
  63. esapp-0.1.0/esapp/workbench.py +1167 -0
  64. esapp-0.1.0/esapp.egg-info/PKG-INFO +173 -0
  65. esapp-0.1.0/esapp.egg-info/SOURCES.txt +83 -0
  66. esapp-0.1.0/esapp.egg-info/dependency_links.txt +1 -0
  67. esapp-0.1.0/esapp.egg-info/not-zip-safe +1 -0
  68. esapp-0.1.0/esapp.egg-info/requires.txt +28 -0
  69. esapp-0.1.0/esapp.egg-info/top_level.txt +4 -0
  70. esapp-0.1.0/pyproject.toml +131 -0
  71. esapp-0.1.0/setup.cfg +4 -0
  72. esapp-0.1.0/tests/config_test.example.py +18 -0
  73. esapp-0.1.0/tests/conftest.py +626 -0
  74. esapp-0.1.0/tests/test_apps_network_gic.py +247 -0
  75. esapp-0.1.0/tests/test_exceptions.py +376 -0
  76. esapp-0.1.0/tests/test_grid_components.py +192 -0
  77. esapp-0.1.0/tests/test_indexable_data_access.py +366 -0
  78. esapp-0.1.0/tests/test_integration_analysis.py +290 -0
  79. esapp-0.1.0/tests/test_integration_contingency.py +323 -0
  80. esapp-0.1.0/tests/test_integration_powerflow.py +356 -0
  81. esapp-0.1.0/tests/test_integration_saw_powerworld.py +331 -0
  82. esapp-0.1.0/tests/test_integration_workbench.py +341 -0
  83. esapp-0.1.0/tests/test_saw_core_methods.py +3119 -0
  84. esapp-0.1.0/tests/test_workbench.py +554 -0
  85. esapp-0.1.0/tests/test_workbench_unit.py +243 -0
esapp-0.1.0/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2022 Zeyu Mao, Brandon Thayer, and Yijing Liu
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
esapp-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,173 @@
1
+ Metadata-Version: 2.4
2
+ Name: esapp
3
+ Version: 0.1.0
4
+ Summary: ESA++ is an open-source power-grid toolkit.
5
+ Author-email: Adam Birchfield <abirchfield@tamu.edu>, Luke Lowery <wyattluke.lowery@tamu.edu>
6
+ License: Apache License 2.0
7
+ Project-URL: Homepage, https://github.com/lukelowry/ESApp
8
+ Keywords: Python,PowerWorld,PowerWorld Simulator,Simulator,PowerWorld Simulation Automation Server,SimAuto,Automation,Power Systems,Electric Power,Power,Easy SimAuto,ESA,ESAplus,Smart Grid
9
+ Classifier: Programming Language :: Python :: 3 :: Only
10
+ Classifier: Programming Language :: Python :: 3.7
11
+ Classifier: Programming Language :: Python :: 3.8
12
+ Classifier: Programming Language :: Python :: 3.9
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: License :: OSI Approved :: Apache Software License
15
+ Classifier: Operating System :: Microsoft :: Windows
16
+ Classifier: Development Status :: 5 - Production/Stable
17
+ Classifier: Environment :: Win32 (MS Windows)
18
+ Classifier: Intended Audience :: Developers
19
+ Classifier: Intended Audience :: Education
20
+ Classifier: Intended Audience :: Science/Research
21
+ Classifier: Natural Language :: English
22
+ Classifier: Topic :: Education
23
+ Classifier: Topic :: Scientific/Engineering
24
+ Classifier: Topic :: Software Development
25
+ Requires-Python: >=3.7
26
+ Description-Content-Type: text/x-rst
27
+ License-File: LICENSE
28
+ Requires-Dist: pandas
29
+ Requires-Dist: numpy<2.0
30
+ Requires-Dist: scipy
31
+ Requires-Dist: pywin32; sys_platform == "win32"
32
+ Provides-Extra: test
33
+ Requires-Dist: pytest>=7.0; extra == "test"
34
+ Requires-Dist: pytest-cov>=4.0; extra == "test"
35
+ Requires-Dist: pytest-xdist>=3.0; extra == "test"
36
+ Requires-Dist: pytest-timeout>=2.1; extra == "test"
37
+ Requires-Dist: pytest-mock>=3.10; extra == "test"
38
+ Requires-Dist: pytest-order>=1.2; extra == "test"
39
+ Provides-Extra: dev
40
+ Requires-Dist: matplotlib; extra == "dev"
41
+ Requires-Dist: pytest>=7.0; extra == "dev"
42
+ Requires-Dist: pytest-cov>=4.0; extra == "dev"
43
+ Requires-Dist: pytest-order>=1.2; extra == "dev"
44
+ Provides-Extra: docs
45
+ Requires-Dist: sphinx; extra == "docs"
46
+ Requires-Dist: sphinx-rtd-theme; extra == "docs"
47
+ Requires-Dist: sphinx-copybutton; extra == "docs"
48
+ Requires-Dist: nbsphinx; extra == "docs"
49
+ Requires-Dist: ipykernel; extra == "docs"
50
+ Requires-Dist: matplotlib; extra == "docs"
51
+ Dynamic: license-file
52
+
53
+ ESA++
54
+ ====================================
55
+
56
+ .. image:: https://img.shields.io/badge/License-Apache%202.0-blue.svg
57
+ :target: https://opensource.org/licenses/Apache-2.0
58
+ :alt: License
59
+
60
+ .. image:: https://img.shields.io/badge/python-3.9%2B-blue.svg
61
+ :target: https://www.python.org/downloads/
62
+ :alt: Python 3.9+
63
+
64
+ .. image:: https://img.shields.io/badge/docs-Read%20the%20Docs-blue.svg
65
+ :target: https://esapp.readthedocs.io/
66
+ :alt: Documentation
67
+
68
+ .. image:: https://img.shields.io/badge/coverage-92%25-brightgreen.svg
69
+ :alt: Coverage 92%
70
+
71
+ An open-source Python toolkit for power system automation, providing a high-performance "syntax-sugar" fork of Easy SimAuto (ESA). This library streamlines interaction with PowerWorld's Simulator Automation Server (SimAuto), transforming complex COM calls into intuitive, Pythonic operations.
72
+
73
+ Key Features
74
+ ------------
75
+
76
+ - **Intuitive Indexing Syntax**: Access and modify grid components using a unique indexing system (e.g., ``wb[Bus, "BusPUVolt"]``) that feels like native Python.
77
+ - **Comprehensive SimAuto Wrapper**: Full coverage of PowerWorld's API through the ``SAW`` class, organized into modular mixins for power flow, contingencies, transients, and more.
78
+ - **High-Level Adapter Interface**: A collection of simplified "one-liner" functions for common tasks like GIC calculation, fault analysis, and voltage violation detection.
79
+ - **Native Pandas Integration**: Every data retrieval operation returns a Pandas DataFrame or Series, enabling immediate analysis, filtering, and visualization.
80
+ - **Advanced Analysis Apps**: Built-in specialized modules for Network topology analysis, Geomagnetically Induced Currents (GIC), and Forced Oscillation detection.
81
+
82
+ Installation
83
+ ------------
84
+
85
+ For local development and the latest features, install the package in editable mode from the root directory:
86
+
87
+ .. code-block:: bash
88
+
89
+ python -m pip install esapp -e .
90
+
91
+
92
+ Documentation
93
+ -------------
94
+
95
+ For a comprehensive tutorial, usage guides, and the full API reference, please visit our `documentation website <https://esapp.readthedocs.io/>`_.
96
+
97
+ Usage Example
98
+ -------------
99
+
100
+ Here is a quick example of how ESA++ simplifies data access and power flow analysis.
101
+
102
+ .. code-block:: python
103
+
104
+ from esapp import GridWorkBench
105
+ from esapp.grid import *
106
+
107
+ # Open Case
108
+ wb = GridWorkBench("path/to/case.pwb")
109
+
110
+ # Retrieve data
111
+ bus_data = wb[Bus, ["BusName", "BusPUVolt"]]
112
+
113
+ # Solve power flow
114
+ V = wb.pflow()
115
+
116
+ # Do some action, write to PW
117
+ violations = wb.find_violations(v_min=0.95)
118
+ wb[Gen, "GenMW"] = 100.0
119
+
120
+ # Save case
121
+ wb.save()
122
+
123
+ Why ESA++?
124
+ ----------
125
+
126
+ Traditional automation of PowerWorld Simulator often involves verbose COM calls and manual data parsing. ESA++ abstracts these complexities:
127
+
128
+ * **Speed**: Optimized data transfer between Python and SimAuto.
129
+ * **Clarity**: Code that reads like the engineering operations it performs.
130
+ * **Ecosystem**: Built on top of the proven ESA library, adding modern Python features and better integration with the SciPy stack.
131
+
132
+
133
+ More Examples
134
+ -------------
135
+
136
+ The `examples/ <https://github.com/lukelowry/ESApp/tree/main/docs/examples>`_ directory contains a gallery of demonstrations, including:
137
+
138
+ - **Object Field Access**: Reduce the time you spend searching for field names with ESA++ IDE typehints for objects and fields.
139
+ - **Matrix Extraction**: Retrieving Y-Bus, Jacobian, and GIC conductance matrices for external mathematical modeling.
140
+
141
+ Testing
142
+ -------
143
+
144
+ ESA++ includes an extensive test suite covering both offline mocks and live PowerWorld connections. To run the tests, install the test dependencies and execute pytest:
145
+
146
+ .. code-block:: bash
147
+
148
+ pip install .[test]
149
+ pytest tests/test_saw.py
150
+
151
+ Citation
152
+ --------
153
+
154
+ If you use this toolkit in your research or industrial projects, please cite the original ESA work and this fork:
155
+
156
+ .. code-block:: bibtex
157
+
158
+ @article{esa2020,
159
+ title={Easy SimAuto (ESA): A Python Package for PowerWorld Simulator Automation},
160
+ author={Mao, Zeyu and Thayer, Brandon and Liu, Yijing and Birchfield, Adam},
161
+ year={2020}
162
+ }
163
+
164
+ Authors
165
+ -------
166
+
167
+ Luke Lowery developed this module during his PhD studies at Texas A&M University. You can learn more on his `research page <https://lukelowry.github.io/>`_ or view his publications on `Google Scholar <https://scholar.google.com/citations?user=CTynuRMAAAAJ&hl=en>`_.
168
+
169
+ ESA++ is maintained by **Luke Lowery** and **Adam Birchfield** at Texas A&M University. You can explore more of our research at the `Birchfield Research Group <https://birchfield.engr.tamu.edu/>`_.
170
+
171
+ License
172
+ -------
173
+ Distributed under the `Apache License 2.0 <https://www.apache.org/licenses/LICENSE-2.0>`_.
esapp-0.1.0/README.rst ADDED
@@ -0,0 +1,121 @@
1
+ ESA++
2
+ ====================================
3
+
4
+ .. image:: https://img.shields.io/badge/License-Apache%202.0-blue.svg
5
+ :target: https://opensource.org/licenses/Apache-2.0
6
+ :alt: License
7
+
8
+ .. image:: https://img.shields.io/badge/python-3.9%2B-blue.svg
9
+ :target: https://www.python.org/downloads/
10
+ :alt: Python 3.9+
11
+
12
+ .. image:: https://img.shields.io/badge/docs-Read%20the%20Docs-blue.svg
13
+ :target: https://esapp.readthedocs.io/
14
+ :alt: Documentation
15
+
16
+ .. image:: https://img.shields.io/badge/coverage-92%25-brightgreen.svg
17
+ :alt: Coverage 92%
18
+
19
+ An open-source Python toolkit for power system automation, providing a high-performance "syntax-sugar" fork of Easy SimAuto (ESA). This library streamlines interaction with PowerWorld's Simulator Automation Server (SimAuto), transforming complex COM calls into intuitive, Pythonic operations.
20
+
21
+ Key Features
22
+ ------------
23
+
24
+ - **Intuitive Indexing Syntax**: Access and modify grid components using a unique indexing system (e.g., ``wb[Bus, "BusPUVolt"]``) that feels like native Python.
25
+ - **Comprehensive SimAuto Wrapper**: Full coverage of PowerWorld's API through the ``SAW`` class, organized into modular mixins for power flow, contingencies, transients, and more.
26
+ - **High-Level Adapter Interface**: A collection of simplified "one-liner" functions for common tasks like GIC calculation, fault analysis, and voltage violation detection.
27
+ - **Native Pandas Integration**: Every data retrieval operation returns a Pandas DataFrame or Series, enabling immediate analysis, filtering, and visualization.
28
+ - **Advanced Analysis Apps**: Built-in specialized modules for Network topology analysis, Geomagnetically Induced Currents (GIC), and Forced Oscillation detection.
29
+
30
+ Installation
31
+ ------------
32
+
33
+ For local development and the latest features, install the package in editable mode from the root directory:
34
+
35
+ .. code-block:: bash
36
+
37
+ python -m pip install esapp -e .
38
+
39
+
40
+ Documentation
41
+ -------------
42
+
43
+ For a comprehensive tutorial, usage guides, and the full API reference, please visit our `documentation website <https://esapp.readthedocs.io/>`_.
44
+
45
+ Usage Example
46
+ -------------
47
+
48
+ Here is a quick example of how ESA++ simplifies data access and power flow analysis.
49
+
50
+ .. code-block:: python
51
+
52
+ from esapp import GridWorkBench
53
+ from esapp.grid import *
54
+
55
+ # Open Case
56
+ wb = GridWorkBench("path/to/case.pwb")
57
+
58
+ # Retrieve data
59
+ bus_data = wb[Bus, ["BusName", "BusPUVolt"]]
60
+
61
+ # Solve power flow
62
+ V = wb.pflow()
63
+
64
+ # Do some action, write to PW
65
+ violations = wb.find_violations(v_min=0.95)
66
+ wb[Gen, "GenMW"] = 100.0
67
+
68
+ # Save case
69
+ wb.save()
70
+
71
+ Why ESA++?
72
+ ----------
73
+
74
+ Traditional automation of PowerWorld Simulator often involves verbose COM calls and manual data parsing. ESA++ abstracts these complexities:
75
+
76
+ * **Speed**: Optimized data transfer between Python and SimAuto.
77
+ * **Clarity**: Code that reads like the engineering operations it performs.
78
+ * **Ecosystem**: Built on top of the proven ESA library, adding modern Python features and better integration with the SciPy stack.
79
+
80
+
81
+ More Examples
82
+ -------------
83
+
84
+ The `examples/ <https://github.com/lukelowry/ESApp/tree/main/docs/examples>`_ directory contains a gallery of demonstrations, including:
85
+
86
+ - **Object Field Access**: Reduce the time you spend searching for field names with ESA++ IDE typehints for objects and fields.
87
+ - **Matrix Extraction**: Retrieving Y-Bus, Jacobian, and GIC conductance matrices for external mathematical modeling.
88
+
89
+ Testing
90
+ -------
91
+
92
+ ESA++ includes an extensive test suite covering both offline mocks and live PowerWorld connections. To run the tests, install the test dependencies and execute pytest:
93
+
94
+ .. code-block:: bash
95
+
96
+ pip install .[test]
97
+ pytest tests/test_saw.py
98
+
99
+ Citation
100
+ --------
101
+
102
+ If you use this toolkit in your research or industrial projects, please cite the original ESA work and this fork:
103
+
104
+ .. code-block:: bibtex
105
+
106
+ @article{esa2020,
107
+ title={Easy SimAuto (ESA): A Python Package for PowerWorld Simulator Automation},
108
+ author={Mao, Zeyu and Thayer, Brandon and Liu, Yijing and Birchfield, Adam},
109
+ year={2020}
110
+ }
111
+
112
+ Authors
113
+ -------
114
+
115
+ Luke Lowery developed this module during his PhD studies at Texas A&M University. You can learn more on his `research page <https://lukelowry.github.io/>`_ or view his publications on `Google Scholar <https://scholar.google.com/citations?user=CTynuRMAAAAJ&hl=en>`_.
116
+
117
+ ESA++ is maintained by **Luke Lowery** and **Adam Birchfield** at Texas A&M University. You can explore more of our research at the `Birchfield Research Group <https://birchfield.engr.tamu.edu/>`_.
118
+
119
+ License
120
+ -------
121
+ Distributed under the `Apache License 2.0 <https://www.apache.org/licenses/LICENSE-2.0>`_.
esapp-0.1.0/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.0
@@ -0,0 +1,96 @@
1
+ import os
2
+ import sys
3
+ import importlib.metadata
4
+
5
+ # Ensure the project root is in the path
6
+ sys.path.insert(0, os.path.abspath(".."))
7
+
8
+ extensions = [
9
+ "sphinx.ext.autodoc",
10
+ "sphinx.ext.autosummary", # Re-enabled to allow automatic class listing
11
+ "sphinx.ext.viewcode",
12
+ "sphinx.ext.todo",
13
+ "sphinx.ext.mathjax",
14
+ "sphinx.ext.inheritance_diagram",
15
+ "sphinx.ext.autosectionlabel",
16
+ "sphinx.ext.intersphinx",
17
+ "sphinx.ext.napoleon",
18
+ "sphinx_copybutton",
19
+ "nbsphinx",
20
+ ]
21
+
22
+ autosummary_generate = True
23
+
24
+ autodoc_default_options = {
25
+ "member-order": "groupwise",
26
+ }
27
+
28
+ autodoc_preserve_defaults = True
29
+ todo_include_todos = True
30
+ autosectionlabel_prefix_document = True
31
+
32
+ autoclass_content = "both"
33
+ autodoc_typehints = "none"
34
+ add_module_names = False
35
+
36
+ intersphinx_mapping = {
37
+ "python": ("docs.python.org", None),
38
+ "numpy": ("numpy.org", None),
39
+ "scipy": ("docs.scipy.org", None),
40
+ }
41
+
42
+ napoleon_google_docstring = False
43
+ napoleon_numpy_docstring = True
44
+ napoleon_include_init_with_doc = False
45
+ napoleon_use_param = True
46
+ napoleon_use_rtype = True
47
+ napoleon_preprocess_types = True
48
+ napoleon_type_aliases = {
49
+ "np": "numpy",
50
+ "np.ndarray": "~numpy.ndarray",
51
+ "pd": "pandas",
52
+ "pd.DataFrame": "~pandas.DataFrame",
53
+ "optional": "typing.Optional",
54
+ "union": "typing.Union",
55
+ }
56
+
57
+ exclude_patterns = [
58
+ "_build",
59
+ "**/*.cpg",
60
+ "**/*.dbf",
61
+ "**/*.prj",
62
+ "**/*.shp",
63
+ "**/*.shx",
64
+ "**/Shape.xml",
65
+ "**/Shape.shp.ea.iso.xml",
66
+ "**/PWRaw",
67
+ ]
68
+
69
+ nbsphinx_execute = 'never'
70
+ html_sourcelink_suffix = ''
71
+ master_doc = "index"
72
+
73
+ project = "ESA++"
74
+ copyright = "2026, Luke Lowery"
75
+ author = "Luke Lowery"
76
+
77
+ try:
78
+ version = importlib.metadata.version("esapp")
79
+ except importlib.metadata.PackageNotFoundError:
80
+ version = "unknown"
81
+ release = version
82
+
83
+ html_theme = "sphinx_rtd_theme"
84
+ html_theme_options = {
85
+ "navigation_depth": 2,
86
+ }
87
+
88
+ autodoc_mock_imports = [
89
+ "win32com",
90
+ "win32com.client",
91
+ "pythoncom",
92
+ "geopandas",
93
+ "shapely",
94
+ "fiona",
95
+ "pyproj",
96
+ ]
@@ -0,0 +1,26 @@
1
+ """
2
+ esapp: A Pythonic Interface for PowerWorld Simulator
3
+ =====================================================
4
+
5
+ The ``esapp`` package provides a high-level, object-oriented interface for
6
+ interacting with PowerWorld Simulator's Automation Server (SimAuto). It aims
7
+ to simplify common power systems analysis tasks by providing a more Pythonic
8
+ and user-friendly API.
9
+
10
+ The main entry point is the :class:`~.GridWorkBench` class.
11
+ """
12
+
13
+ # Please keep the docstring above up to date with all the imports.
14
+ from .saw import (
15
+ SAW,
16
+ PowerWorldError,
17
+ COMError,
18
+ CommandNotRespectedError,
19
+ Error,
20
+ SimAutoFeatureError,
21
+ PowerWorldPrerequisiteError,
22
+ PowerWorldAddonError,
23
+ )
24
+
25
+ # Main Grid Work Bench Class
26
+ from .workbench import GridWorkBench
@@ -0,0 +1,19 @@
1
+ """
2
+ Specialized Applications (:mod:`esapp.apps`)
3
+ ============================================
4
+
5
+ This package contains higher-level, specialized tools for advanced power
6
+ systems analysis tasks built on top of the core ``esapp`` components.
7
+ """
8
+
9
+ # Applications
10
+ from .gic import GIC
11
+ from .network import Network, BranchType
12
+ from .modes import ForcedOscillation
13
+
14
+ __all__ = [
15
+ "GIC",
16
+ "Network",
17
+ "BranchType",
18
+ "ForcedOscillation",
19
+ ]