stepss 3.59__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.
@@ -0,0 +1,190 @@
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 the 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 the 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 any 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
+ Copyright 2026 Petros Aristidou
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
@@ -0,0 +1,2 @@
1
+ include README.rst
2
+ include LICENSE.rst
stepss-3.59/PKG-INFO ADDED
@@ -0,0 +1,296 @@
1
+ Metadata-Version: 2.4
2
+ Name: stepss
3
+ Version: 3.59
4
+ Summary: Python interface to the STEPSS power-system simulation platform.
5
+ Home-page: https://stepss.sps-lab.org
6
+ Author: Petros Aristidou
7
+ Author-email: apetros@pm.me
8
+ License: Apache-2.0
9
+ Keywords: STEPSS,RAMSES,Helios,Power Systems,Simulator
10
+ Classifier: Development Status :: 5 - Production/Stable
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Environment :: Console
13
+ Classifier: License :: OSI Approved :: Apache Software License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Description-Content-Type: text/x-rst
16
+ License-File: LICENSE.rst
17
+ Requires-Dist: matplotlib
18
+ Requires-Dist: scipy
19
+ Requires-Dist: numpy
20
+ Dynamic: author
21
+ Dynamic: author-email
22
+ Dynamic: classifier
23
+ Dynamic: description
24
+ Dynamic: description-content-type
25
+ Dynamic: home-page
26
+ Dynamic: keywords
27
+ Dynamic: license
28
+ Dynamic: license-file
29
+ Dynamic: requires-dist
30
+ Dynamic: summary
31
+
32
+ |PyPI version| |PyPI status| |Docs status|
33
+
34
+ .. |PyPI version| image:: https://img.shields.io/pypi/v/stepss
35
+ :target: https://pypi.org/project/stepss/
36
+ :alt: PyPI version
37
+
38
+ .. |PyPI status| image:: https://img.shields.io/pypi/status/stepss
39
+ :target: https://pypi.org/project/stepss/
40
+ :alt: PyPI status
41
+
42
+ .. |Docs status| image:: https://img.shields.io/github/actions/workflow/status/SPS-L/stepss-docs/deploy.yml?branch=main&label=docs
43
+ :target: https://github.com/SPS-L/stepss-docs/
44
+ :alt: Docs deploy status
45
+
46
+ STEPSS for Python
47
+ =================
48
+
49
+ Scripted power system dynamic simulation and AC power-flow analysis.
50
+
51
+ **STEPSS** (*Static and Transient Electric Power Systems Simulation*) is a power system simulation platform for dynamic studies of electrical grids, developed by `Dr. Petros Aristidou <https://sps-lab.org>`_ (Cyprus University of Technology) and Dr. Thierry Van Cutsem (University of Liège).
52
+
53
+ STEPSS is delivered in two editions, which drive the same simulation engines and read the same data files:
54
+
55
+ - **STEPSS for Python**, this package. ``pip install stepss``, then script simulations from Python or a Jupyter notebook.
56
+ - **STEPSS for Java**, a desktop application. A single ``stepss.jar`` with a graphical interface, published on the `releases page <https://github.com/SPS-L/stepss-java-ui/releases>`_.
57
+
58
+ Neither is a wrapper around the other: they are two front ends onto the same Fortran engines, and a case built in one runs unchanged in the other. Pick this one to automate, sweep parameters, or work inside the scientific Python stack; pick the Java edition for interactive work, or for the model-building and curve-viewing tools it carries that this edition does not (see `Choosing an edition`_).
59
+
60
+ What this edition bundles
61
+ -------------------------
62
+
63
+ ``pip install stepss`` is self-contained: no separate solver installation, no compiler, no licence server.
64
+
65
+ - `RAMSES <https://stepss.sps-lab.org/getting-started/overview/>`_ (RApid Multithreaded Simulation of Electric power Systems), the dynamic simulator. It simulates the evolution of a power system under the phasor approximation, using Backward Euler, Trapezoidal or BDF2 integration with OpenMP parallelism.
66
+ - `Helios <https://stepss.sps-lab.org/user-guide/power-flow/>`_, the AC power-flow engine, solving by Newton-Raphson in polar coordinates. Exposed through the ``stepss.helios`` module (see `Helios Power-Flow Interface`_ below).
67
+
68
+ Pre-compiled shared libraries for Linux, Windows and macOS ship inside the wheel.
69
+
70
+ Choosing an edition
71
+ -------------------
72
+
73
+ Two capabilities live only in the Java edition, because they are separate executables rather than libraries:
74
+
75
+ - **CODEGEN**, which translates user-written model descriptions into Fortran 2003 and compiles them into a custom simulator. Writing your own exciter, governor or injector needs the Java edition or the `CODEGEN toolchain <https://stepss.sps-lab.org/developer/user-models/>`_ directly.
76
+ - **DYNGRAPH**, the interactive trajectory viewer. This edition reads trajectories into NumPy instead, which is usually what you want from Python.
77
+
78
+ Everything else, running dynamic simulations and power flows against the same engines and data files, is available here.
79
+
80
+ Key Features
81
+ ------------
82
+
83
+ - **Complete simulation workflow** - define cases, run simulations, pause/continue, and extract results, all from Python
84
+ - **Runtime interaction** - query bus voltages, branch flows, and component observables while paused; inject disturbances on-the-fly
85
+ - **Trajectory post-processing** - extract and plot time-series results from Fortran binary trajectory files
86
+ - **Parameter sweeps** - script multiple simulations with varying parameters or disturbances
87
+ - **Eigenanalysis support** - export system Jacobian matrices for small-signal stability analysis
88
+ - **AC power flow** - the ``stepss.helios`` module runs Helios power flows: solve, modify with redispatch, N-1 contingency screening, and file exports
89
+ - **Shared data files** - the same ``.dat``, ``.dst`` and ``.obs`` files run in the Java edition, so a case can move between the two
90
+ - **Scientific Python integration** - works natively with NumPy, SciPy, Matplotlib, and Jupyter
91
+
92
+ Installation
93
+ ------------
94
+
95
+ Install stepss and all recommended dependencies via pip::
96
+
97
+ pip install jupyter ipython stepss
98
+
99
+ Required dependencies (matplotlib, scipy, and numpy) are installed automatically.
100
+
101
+ Minimal installation (no plotting or notebook support)::
102
+
103
+ pip install stepss
104
+
105
+ **Optional:** Install `Gnuplot <http://www.gnuplot.info/>`_ to enable real-time observable plots during simulation. stepss will still work without it, but runtime plots will be disabled.
106
+
107
+ Renamed from PyRAMSES
108
+ ~~~~~~~~~~~~~~~~~~~~~
109
+
110
+ This package was published as ``pyramses`` up to version 3.58. Existing code
111
+ keeps working: ``pip install pyramses`` now installs a shim that forwards to
112
+ this package. New code should use ``import stepss``.
113
+
114
+ Linux System Prerequisites
115
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
116
+
117
+ On Linux, the following system libraries must be installed before running stepss::
118
+
119
+ sudo apt install libopenblas0 libgfortran5 libgomp1
120
+
121
+ These packages provide:
122
+
123
+ - **libopenblas0** - OpenBLAS BLAS/LAPACK routines used by the solver
124
+ - **libgfortran5** - GNU Fortran runtime required by the Fortran components of RAMSES
125
+ - **libgomp1** - OpenMP runtime for multi-core parallel execution
126
+
127
+ On most desktop Linux distributions these are already present. If ``stepss`` fails to import with a shared-library error, install the packages above and retry.
128
+
129
+ macOS System Prerequisites
130
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
131
+
132
+ On macOS, the following system libraries must be installed before running stepss::
133
+
134
+ brew install openblas gcc
135
+
136
+ These packages provide:
137
+
138
+ - **openblas** - OpenBLAS BLAS/LAPACK routines used by the solver
139
+ - **gcc** - GNU Fortran (``libgfortran``) and OpenMP (``libgomp``) runtimes required by the Fortran components of RAMSES
140
+
141
+ macOS is supported on Apple Silicon (arm64) only: both the bundled RAMSES and Helios binaries are arm64. If ``stepss`` fails to import with a shared-library error, install the packages above and retry.
142
+
143
+ Platform Support
144
+ ~~~~~~~~~~~~~~~~
145
+
146
+ .. list-table::
147
+ :widths: 20 20 60
148
+ :header-rows: 1
149
+
150
+ * - Platform
151
+ - Binaries
152
+ - Notes
153
+ * - Windows
154
+ - ``ramses.dll``, ``helios_api.dll``
155
+ - Primary platform, full support
156
+ * - Linux
157
+ - ``ramses.so``, ``libhelios_api.so``
158
+ - Full support
159
+ * - macOS
160
+ - ``ramses.so``, ``libhelios_api.dylib``
161
+ - Apple Silicon (arm64) only; RAMSES additionally needs Homebrew ``openblas``/``gcc`` (see `macOS System Prerequisites`_)
162
+
163
+ The free version is limited to 1000 buses and 2 OpenMP cores. See the `License <https://stepss.sps-lab.org/getting-started/license/>`_ page for full terms.
164
+
165
+ Quick Start
166
+ -----------
167
+
168
+ .. code-block:: python
169
+
170
+ import stepss
171
+
172
+ # 1. Define the test case
173
+ case = stepss.cfg()
174
+ case.addData('dyn.dat') # dynamic model data
175
+ case.addData('volt_rat.dat') # power-flow initialisation
176
+ case.addData('settings.dat') # solver settings
177
+ case.addDst('fault.dst') # disturbance sequence
178
+ case.addObs('obs.dat') # define observables to record
179
+ case.addTrj('output.trj') # trajectory output file
180
+
181
+ # 2. Run simulation
182
+ ram = stepss.sim()
183
+ ram.execSim(case) # run to completion
184
+
185
+ # 3. Extract and plot results
186
+ ext = stepss.extractor(case.getTrj())
187
+ ext.getBus('1041').mag.plot() # bus voltage magnitude
188
+ ext.getSync('g1').S.plot() # generator rotor speed
189
+
190
+ For interactive usage, pause/continue and on-the-fly disturbance injection is supported:
191
+
192
+ .. code-block:: python
193
+
194
+ ram = stepss.sim()
195
+ ram.execSim(case, 0.0) # initialise, paused at t=0
196
+ ram.addDisturb(10.0, 'BREAKER SYNC_MACH g7 0') # schedule generator trip
197
+ ram.contSim(ram.getInfTime()) # run to end of time horizon
198
+ ram.endSim()
199
+
200
+ Helios Power-Flow Interface
201
+ ---------------------------
202
+
203
+ `Helios <https://stepss.sps-lab.org/user-guide/power-flow/>`_ is the AC power-flow engine both editions use, exposed here through the ``stepss.helios`` module. Unlike the RAMSES classes, this interface uses PEP 8 snake_case naming.
204
+
205
+ .. code-block:: python
206
+
207
+ from stepss.helios import HeliosSession
208
+
209
+ with HeliosSession() as pf:
210
+ pf.load_file('network.dat')
211
+ pf.solve()
212
+
213
+ v, angle = pf.get_bus_voltage('1041') # one bus
214
+ v_all, angle_all = pf.get_bus_voltages() # all buses (NumPy arrays)
215
+
216
+ # modify the system and re-solve with redispatch
217
+ pf.trip_branch('1042-1044')
218
+ pf.change_load('1041', 50.0, 10.0) # +50 MW, +10 Mvar
219
+ pf.apply_changes()
220
+
221
+ # N-1 contingency screening
222
+ for result in pf.run_contingencies(branches=True, generators=True):
223
+ print(result.name, result.accepted, result.violations)
224
+
225
+ # export the operating point (e.g. as RAMSES initial conditions)
226
+ pf.write_voltrat('volt_rat.dat')
227
+
228
+ Runnable examples live in ``examples/helios/``.
229
+
230
+ Main Classes
231
+ ------------
232
+
233
+ .. list-table::
234
+ :widths: 25 75
235
+ :header-rows: 1
236
+
237
+ * - Class
238
+ - Description
239
+ * - ``stepss.cfg``
240
+ - Defines a test case: data files, disturbance file, output files, observables, and runtime options.
241
+ * - ``stepss.sim``
242
+ - Runs simulations. Supports start/pause/continue, runtime queries, and on-the-fly disturbance injection.
243
+ * - ``stepss.extractor``
244
+ - Extracts and visualises time-series results from trajectory (``.trj``) files produced by a simulation.
245
+ * - ``stepss.helios.HeliosSession``
246
+ - Runs AC power flows with the Helios engine: load, modify, solve, contingency screening, and file exports.
247
+
248
+ Bundled Binaries Are CI-Managed
249
+ -------------------------------
250
+
251
+ The native libraries under ``src/stepss/libs/`` and the version record in
252
+ ``src/stepss/_bundled.py`` are written by automation, not by hand. When
253
+ RAMSES or Helios publishes a release, a workflow refreshes the affected
254
+ libraries, bumps the patch version, and publishes a new stepss release only
255
+ after the full test suite (including the Nordic voltage-collapse regression)
256
+ passes on Linux, Windows and macOS.
257
+
258
+ Check what a given release bundles with::
259
+
260
+ python -c "import stepss; print(stepss.__ramses_version__, stepss.__helios_version__)"
261
+
262
+ Contributors should not edit those paths directly; a manual change is
263
+ overwritten by the next sync.
264
+
265
+ Documentation
266
+ -------------
267
+
268
+ Full documentation is available at `https://stepss.sps-lab.org/python/ <https://stepss.sps-lab.org/python/>`_.
269
+
270
+ - `Overview <https://stepss.sps-lab.org/python/overview/>`_
271
+ - `Installation <https://stepss.sps-lab.org/python/installation/>`_
272
+ - `Power Flow with Helios <https://stepss.sps-lab.org/python/helios/>`_
273
+ - `API Reference <https://stepss.sps-lab.org/python/api-reference/>`_
274
+ - `Examples <https://stepss.sps-lab.org/python/examples/>`_
275
+
276
+ Support:
277
+
278
+ - Issues: `https://github.com/SPS-L/stepss-python-ui/issues <https://github.com/SPS-L/stepss-python-ui/issues>`_
279
+ - Project page: `https://sps-lab.org/project/stepss/ <https://sps-lab.org/project/stepss/>`_
280
+
281
+ License
282
+ -------
283
+
284
+ stepss (the Python wrapper) is distributed under the **Apache License 2.0** - see ``LICENSE.rst``. Copyright © Petros Aristidou.
285
+
286
+ The RAMSES solver (the dynamic library bundled in this package) is proprietary software owned by the University of Liège and is distributed under the Academic Public License for the use of STEPSS: free for non-commercial use (teaching, academic research, personal purposes), with a limit of 1000 buses and 2 CPU cores. For commercial use or larger models, contact the authors. See the `STEPSS License page <https://stepss.sps-lab.org/getting-started/license/>`_ for full terms.
287
+
288
+ The STEPSS-Helios power-flow library (``libhelios_api``, also bundled in this package and used by ``stepss.helios``) is the property of Dr. Petros Aristidou, distributed under the STEPSS-Helios Academic Public License: free for non-commercial use; commercial use requires a license (info@sps-lab.org). See the ``NOTICE`` file for details.
289
+
290
+ Authors
291
+ -------
292
+
293
+ Developed and maintained by the `Sustainable Power Systems Laboratory (SPS-L) <https://sps-lab.org/>`_ at the Cyprus University of Technology, under the direction of Dr. Petros Aristidou.
294
+
295
+ - `Dr. Petros Aristidou <https://sps-lab.org/>`_ - Cyprus University of Technology
296
+ - Dr. Thierry Van Cutsem - Emeritus, University of Liège
stepss-3.59/README.rst ADDED
@@ -0,0 +1,13 @@
1
+ stepss (Packaging Compatibility README)
2
+ =======================================
3
+
4
+ The canonical project README is maintained at:
5
+
6
+ - ../README.rst
7
+
8
+ Packaging now reads from ../README.rst first (see setup.py), with this file kept only as a fallback for legacy build contexts that copy only the src/ directory.
9
+
10
+ Project homepage and full docs:
11
+
12
+ - https://stepss.sps-lab.org/python/
13
+ - https://github.com/SPS-L/stepss-python-ui
stepss-3.59/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
stepss-3.59/setup.py ADDED
@@ -0,0 +1,91 @@
1
+ #!/usr/bin/env python
2
+ # -*- coding: utf-8 -*-
3
+ """Package build script for stepss.
4
+
5
+ Reads version metadata from the installed :mod:`stepss` package and uses
6
+ :func:`setuptools.setup` to define the distribution. Run via
7
+ ``python setup.py install`` (legacy) or, preferably, with ``pip install .``.
8
+ """
9
+
10
+ try:
11
+ from setuptools import setup, find_packages
12
+ except ImportError:
13
+ from distutils.core import setup, find_packages
14
+ import os
15
+ import re
16
+
17
+ def read_first_existing(*paths):
18
+ base = os.path.dirname(__file__)
19
+ for path in paths:
20
+ full_path = os.path.join(base, path)
21
+ if os.path.exists(full_path):
22
+ with open(full_path, encoding='utf-8') as f:
23
+ return f.read()
24
+ raise FileNotFoundError("None of the candidate files exist: {}".format(paths))
25
+
26
+ # Metadata is parsed (not imported) from the package so that setup.py works
27
+ # in pip's isolated build environment, where the package's runtime
28
+ # dependencies (numpy, scipy, ...) are not installed.
29
+ def read_metadata():
30
+ init_path = os.path.join(os.path.dirname(__file__), 'stepss', '__init__.py')
31
+ with open(init_path, encoding='utf-8') as f:
32
+ content = f.read()
33
+ def grab(name):
34
+ match = re.search(r"^__%s__\s*=\s*['\"]([^'\"]+)['\"]" % name, content, re.M)
35
+ if not match:
36
+ raise RuntimeError("__%s__ not found in %s" % (name, init_path))
37
+ return match.group(1)
38
+ return {name: grab(name) for name in
39
+ ('version', 'author', 'email', 'status', 'url', 'package_name')}
40
+
41
+ # Since RAMSES v3.50 the bundled binaries are gfortran builds: they link only
42
+ # system libraries (OpenBLAS/gfortran/OpenMP runtimes on Linux, none on
43
+ # Windows), so no MKL dependency is needed.
44
+ install_requires = ['matplotlib','scipy','numpy']
45
+
46
+ _meta = read_metadata()
47
+ __version__ = _meta['version']
48
+ __author__ = _meta['author']
49
+ __email__ = _meta['email']
50
+ __status__ = _meta['status']
51
+ __url__ = _meta['url']
52
+ __name__ = _meta['package_name']
53
+
54
+ setup(
55
+ name=__name__,
56
+ version=__version__,
57
+ description='Python interface to the STEPSS power-system simulation platform.',
58
+ author=__author__,
59
+ author_email=__email__,
60
+ url=__url__,
61
+ keywords=['STEPSS', 'RAMSES', 'Helios', 'Power Systems', 'Simulator'],
62
+ license='Apache-2.0',
63
+ # Prefer the repository-level README as the single source of truth.
64
+ # Keep a local fallback for legacy build contexts that only copy ./src.
65
+ long_description=read_first_existing('../README.rst', 'README.rst'),
66
+ long_description_content_type='text/x-rst',
67
+ packages=find_packages(),
68
+ install_requires=install_requires,
69
+ package_data={
70
+ # Headers are platform-independent and live at the libs/ root; the
71
+ # shared libraries are split per platform because the Linux and macOS
72
+ # RAMSES builds share the filename ramses.so.
73
+ 'stepss': ['libs/*.h',
74
+ 'libs/win/*.dll',
75
+ 'libs/lin/*.so',
76
+ 'libs/mac/*.so', 'libs/mac/*.dylib'],
77
+ },
78
+ classifiers=[
79
+ "Development Status :: " + __status__,
80
+ "Intended Audience :: Developers",
81
+ "Environment :: Console",
82
+ "License :: OSI Approved :: Apache Software License",
83
+ "Programming Language :: Python :: 3"
84
+ ],
85
+ entry_points={
86
+ 'console_scripts' : [
87
+ 'ramses = stepss.scripts.exec:run',
88
+ ]
89
+ }
90
+
91
+ )
@@ -0,0 +1,66 @@
1
+ #!/usr/bin/env python
2
+ # -*- coding: utf-8 -*-
3
+ """stepss - Python interface to the STEPSS power-system simulation platform.
4
+
5
+ Drives RAMSES, the time-domain dynamic simulator, and Helios, the AC
6
+ power-flow engine, both of which ship as bundled shared libraries.
7
+
8
+ Public API exported by this package:
9
+
10
+ - :class:`~stepss.cases.cfg` - build and manage a simulation case (input/output files).
11
+ - :class:`~stepss.simulator.sim` - load the RAMSES shared library and run simulations.
12
+ - :class:`~stepss.extractor.extractor` - parse Fortran binary trajectory files post-simulation.
13
+ - :class:`~stepss.extractor.cur` - lightweight NamedTuple holding a (time, value, msg) timeseries.
14
+ - :func:`~stepss.extractor.curplot` - plot one or more :class:`cur` objects on a single axes.
15
+ - :class:`~stepss.helios.HeliosSession` - run AC power flows with the Helios engine.
16
+ - :class:`~stepss.globals.HeliosError` - exception raised by Helios calls.
17
+
18
+ Module-level flags set at import time:
19
+
20
+ - ``__runTimeObs__`` - ``True`` when gnuplot is available on the system PATH and runtime
21
+ observable plots are therefore enabled; ``False`` otherwise.
22
+
23
+ This package was previously distributed as ``pyramses``. The ``pyramses``
24
+ distribution on PyPI is now a forwarding shim onto this one.
25
+ """
26
+
27
+ __package_name__ = "stepss"
28
+ __version__ = '3.59'
29
+ __author__ = "Petros Aristidou"
30
+ __copyright__ = "Petros Aristidou"
31
+ __license__ = "Apache-2.0"
32
+ __maintainer__ = "Petros Aristidou"
33
+ __email__ = "apetros@pm.me"
34
+ __url__ = "https://stepss.sps-lab.org"
35
+ __status__ = "5 - Production/Stable"
36
+
37
+ import sys
38
+ from warnings import warn
39
+
40
+ from . import globals as _globals
41
+ from .cases import cfg
42
+ from .globals import __which, HeliosError
43
+ from .simulator import sim
44
+ from .extractor import extractor, curplot, cur
45
+ from . import helios
46
+ from .helios import HeliosSession
47
+ from ._bundled import RAMSES_VERSION as __ramses_version__
48
+ from ._bundled import HELIOS_VERSION as __helios_version__
49
+
50
+ __all__ = ["cfg", "sim", "extractor", "cur", "curplot", "helios",
51
+ "HeliosSession", "HeliosError"]
52
+
53
+ # Detect gnuplot at import time; propagate result to globals so that cases.py
54
+ # (which reads __runTimeObs__ from globals at import time) also gets the correct value.
55
+ if sys.platform in ('win32', 'cygwin'):
56
+ checkGnuplot = __which('gnuplot.exe')
57
+ else:
58
+ checkGnuplot = __which('gnuplot')
59
+ if checkGnuplot is None:
60
+ warn("RAMSES: Gnuplot executable could not be found in the system path, so the runtime observables are disabled.")
61
+ _globals.__runTimeObs__ = False
62
+ else:
63
+ _globals.__runTimeObs__ = True
64
+
65
+ # Re-export the (now-updated) flag under the expected public name.
66
+ __runTimeObs__ = _globals.__runTimeObs__