-
Notifications
You must be signed in to change notification settings - Fork 19
How to install stepspy in Python
stepspy is a module wrapping STEPS kernel (dynamic library) in Python. The official package location is: https://pypi.org/project/stepspy/.
It is the RECOMMENDED practice to use stepspy instead of STEPS console for further applications.
Download the latest version of Python from Python official websit and install it. The Python version must be compatible with STEPS dynamic library. If you use 64-bit version of STEPS dynamic library, use 64-bit Python. Otherwise, use both 32-bit version.
Remember, Python 2 is no longer officially maintained. Use Python 3!
You have 2 options to install stepspy:
- Use Python pip utitlity to install it from pypi. It can be invoked by one of the following commands:
pip install stepspy
python -m pip install stepspy
- Go to steps source codes, and go find the stepspy module at python/stepspy-current/stepspy. Just copy the codes to folder site-packages of Python.
Once you finish building STEPS kernel following the standard procedure, you can find a file named libsteps.dll or libsteps.so_ in folder build/bin/release/. Copy the dynamic library to the stepspy module folder stepspy/libsteps/. For example, if you are using Windows system and the site-packages folder is located at C:/Python/Lib/site-packages, then copy the libsteps.dll to C:/Python/Lib/site-packages/stepspy/libsteps/.
To test if stepspy is properly installed or not, simply try the following codes in Python:
from stepspy import STEPS
simulator = STEPS()
If you can see the following outputs, then stepspy is ready to use.
[TK DFLT][2021-02-05 12:20:26][ 0.002] No configuration file <steps_config.json> is found. Use default power system database capacity.
[TK DFLT][2021-02-05 12:20:26][ 0.003] STEPS simulation toolkit is started.
[TK 0000][2021-02-05 12:20:26][ 0.000] No configuration file <steps_config.json> is found. Use default power system database capacity.
[TK 0000][2021-02-05 12:20:26][ 0.000] STEPS simulation toolkit [TK 0000] @ 0XE4819490 is created.
Since STEPS and stepspy are actively updated, please make sure use the latest version of both STEPS and stepspy. If you find something goes wrong after updating stepspy, go check if STEPS kernel is the latest version or not. Rebuid STEPS kernel and update the dynamic library can help fix the problem.
If you cannot find the proper kernel version, check the dev branch or contact maintainer.
Cite STEPS via: Changgang Li, Yue Wu, Hengxu Zhang, Hua Ye, Yutian Liu and Yilu Liu, "STEPS: A Portable Numerical Simulation Toolkit for Electrical Power System Dynamic Studies," in IEEE Transactions on Power Systems, doi: 10.1109/TPWRS.2020.3045102.