Skip to content

Commit

Permalink
upgrade stepspy to 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
changgang committed Oct 16, 2023
1 parent ed8a57b commit 123b80e
Show file tree
Hide file tree
Showing 4 changed files with 527 additions and 7 deletions.
3 changes: 2 additions & 1 deletion python/stepspy-current/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ stepspy is a Python module of Simulation Toolkit for Electrical Power Systems (S

stepspy is a Python module of Simulation Toolkit for Electrical Power Systems (STEPS). It provides wrapper of APIs of STEPS in a dynamic library.

STEPS is a simulation toolkit for powerflow and dynamic simulation of large-scale power systems. It provides detailed models of bus, line, transformer, HVDC, generator, wind turbine generator, load, and fixed shunt. For more information about STEPS, see (https://github.com/changgang/steps).
STEPS is a simulation toolkit for powerflow, short circuit and dynamic simulation of large-scale power systems. It provides detailed models of bus, line, transformer, HVDC, VSC-HVDC, generator, wind turbine generator, photovoltaic unit, load, and fixed shunt. For more information about STEPS, see (https://gitee.com/lichgang/steps/ or https://github.com/changgang/steps).

## Release Note
- 2.0.0. Oct. 16, 2023. Major version. Add short circuit analysis functions.
- 1.6.2. Oct. 13, 2023. Add option to select libSTEPS version when calling STEPS().
- 1.6.1. Sep. 26, 2022. Fix bug in set_bus_capacity.
- 1.6.0. April 13, 2022. Add VSC HVDC model APIs. Use STEPS>=1.6.0.
Expand Down
2 changes: 1 addition & 1 deletion python/stepspy-current/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="stepspy",
version="1.6.2",
version="2.0.0",
author="Changgang Li",
author_email="[email protected]",
description="Python module of Simulation Toolkit for Electrical Power Systems",
Expand Down
66 changes: 62 additions & 4 deletions python/stepspy-current/stepspy/libsteps/pylibsteps.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,17 @@ def load_library(libsteps_file):
libsteps.api_load_vsc_hvdc_powerflow_data_from_file.argtypes = (c_char_p, c_char_p, c_uint)
libsteps.api_load_powerflow_result_from_file.restype = None
libsteps.api_load_powerflow_result_from_file.argtypes = (c_char_p, c_char_p, c_uint)
libsteps.api_load_sequence_data_from_file.restype = None
libsteps.api_load_sequence_data_from_file.argtypes = (c_char_p, c_char_p, c_uint)
libsteps.api_load_dynamic_data_from_file.restype = None
libsteps.api_load_dynamic_data_from_file.argtypes = (c_char_p, c_char_p, c_uint)

libsteps.api_save_powerflow_data_to_file.restype = None
libsteps.api_save_powerflow_data_to_file.argtypes = (c_char_p, c_char_p, c_bool, c_bool, c_bool, c_uint, c_uint)
libsteps.api_save_vsc_hvdc_powerflow_data_to_file.restype = None
libsteps.api_save_vsc_hvdc_powerflow_data_to_file.argtypes = (c_char_p, c_char_p, c_bool, c_bool, c_bool, c_uint, c_uint)
libsteps.api_save_sequence_data_to_file.restype = None
libsteps.api_save_sequence_data_to_file.argtypes = (c_char_p, c_char_p, c_uint)
libsteps.api_save_dynamic_data_to_file.restype = None
libsteps.api_save_dynamic_data_to_file.argtypes = (c_char_p, c_char_p, c_bool, c_uint)

Expand Down Expand Up @@ -380,6 +384,19 @@ def load_library(libsteps_file):
libsteps.api_set_source_boolean_data.restype = None
libsteps.api_set_source_boolean_data.argtypes = (c_uint, c_char_p, c_char_p, c_bool, c_uint)

libsteps.api_get_generator_sequence_float_data.restype = (c_double)
libsteps.api_get_generator_sequence_float_data.argtypes = (c_uint, c_char_p, c_char_p, c_uint)
libsteps.api_get_wt_generator_sequence_float_data.restype = (c_double)
libsteps.api_get_wt_generator_sequence_float_data.argtypes = (c_uint, c_char_p, c_char_p, c_uint)
libsteps.api_get_pv_unit_sequence_float_data.restype = (c_double)
libsteps.api_get_pv_unit_sequence_float_data.argtypes = (c_uint, c_char_p, c_char_p, c_uint)
libsteps.api_set_generator_sequence_float_data.restype = None
libsteps.api_set_generator_sequence_float_data.argtypes = (c_uint, c_char_p, c_char_p, c_double, c_uint)
libsteps.api_set_wt_generator_sequence_float_data.restype = None
libsteps.api_set_wt_generator_sequence_float_data.argtypes = (c_uint, c_char_p, c_char_p, c_double, c_uint)
libsteps.api_set_pv_unit_sequence_float_data.restype = None
libsteps.api_set_pv_unit_sequence_float_data.argtypes = (c_uint, c_char_p, c_char_p, c_double, c_uint)

libsteps.api_get_fixed_shunt_integer_data.restype = (c_int)
libsteps.api_get_fixed_shunt_integer_data.argtypes = (c_uint, c_char_p, c_char_p, c_uint)
libsteps.api_get_fixed_shunt_float_data.restype = (c_double)
Expand Down Expand Up @@ -625,8 +642,6 @@ def load_library(libsteps_file):
libsteps.api_build_decoupled_network_B_matrix.argtypes = (c_uint, )
libsteps.api_build_dc_network_B_matrix.restype = None
libsteps.api_build_dc_network_B_matrix.argtypes = (c_uint, )
libsteps.api_build_dynamic_network_Y_matrix.restype = None
libsteps.api_build_dynamic_network_Y_matrix.argtypes = (c_uint, )
libsteps.api_build_network_Z_matrix.restype = None
libsteps.api_build_network_Z_matrix.argtypes = (c_uint, )
libsteps.api_save_network_Y_matrix.restype = None
Expand All @@ -635,11 +650,54 @@ def load_library(libsteps_file):
libsteps.api_save_decoupled_network_B_matrix.argtypes = (c_char_p, c_uint)
libsteps.api_save_dc_network_B_matrix.restype = None
libsteps.api_save_dc_network_B_matrix.argtypes = (c_char_p, c_uint)
libsteps.api_save_dynamic_network_Y_matrix.restype = None
libsteps.api_save_dynamic_network_Y_matrix.argtypes = (c_char_p, c_uint)
libsteps.api_save_network_Z_matrix.restype = None
libsteps.api_save_network_Z_matrix.argtypes = (c_char_p, c_uint)

libsteps.api_build_sequence_network_Y_matrix.restype = None
libsteps.api_build_sequence_network_Y_matrix.argtypes = (c_uint, )
libsteps.api_save_positive_sequence_network_Y_matrix.restype = None
libsteps.api_save_positive_sequence_network_Y_matrix.argtypes = (c_char_p, c_uint)
libsteps.api_save_negative_sequence_network_Y_matrix.restype = None
libsteps.api_save_negative_sequence_network_Y_matrix.argtypes = (c_char_p, c_uint)
libsteps.api_save_zero_sequence_network_Y_matrix.restype = None
libsteps.api_save_zero_sequence_network_Y_matrix.argtypes = (c_char_p, c_uint)

libsteps.api_build_dynamic_network_Y_matrix.restype = None
libsteps.api_build_dynamic_network_Y_matrix.argtypes = (c_uint, )
libsteps.api_save_dynamic_network_Y_matrix.restype = None
libsteps.api_save_dynamic_network_Y_matrix.argtypes = (c_char_p, c_uint)

libsteps.api_get_short_circuit_solver_integer_parameter.restype = (c_uint)
libsteps.api_get_short_circuit_solver_integer_parameter.argtypes = (c_char_p, c_uint)
libsteps.api_get_short_circuit_solver_float_parameter.restype = (c_double)
libsteps.api_get_short_circuit_solver_float_parameter.argtypes = (c_char_p, c_uint)
libsteps.api_get_short_circuit_solver_boolean_parameter.restype = (c_bool)
libsteps.api_get_short_circuit_solver_boolean_parameter.argtypes = (c_char_p, c_uint)
libsteps.api_set_short_circuit_solver_integer_parameter.restype = None
libsteps.api_set_short_circuit_solver_integer_parameter.argtypes = (c_char_p, c_int, c_uint)
libsteps.api_set_short_circuit_solver_float_parameter.restype = None
libsteps.api_set_short_circuit_solver_float_parameter.argtypes = (c_char_p, c_double, c_uint)
libsteps.api_set_short_circuit_solver_boolean_parameter.restype = None
libsteps.api_set_short_circuit_solver_boolean_parameter.argtypes = (c_char_p, c_bool, c_uint)

libsteps.api_solve_short_circuit.restype = None
libsteps.api_solve_short_circuit.argtypes = (c_uint, )
libsteps.api_get_short_circuit_result_float_data.restype = (c_double)
libsteps.api_get_short_circuit_result_float_data.argtypes = (c_char_p, c_uint)
libsteps.api_show_short_circuit_result.restype = None
libsteps.api_show_short_circuit_result.argtypes = (c_uint, )
libsteps.api_save_short_circuit_result_to_file.restype = None
libsteps.api_save_short_circuit_result_to_file.argtypes = (c_char_p, c_uint)
libsteps.api_save_extended_short_circuit_result_to_file.restype = None
libsteps.api_save_extended_short_circuit_result_to_file.argtypes = (c_char_p, c_uint)

libsteps.api_short_circuit_set_bus_fault.restype = None
libsteps.api_short_circuit_set_bus_fault.argtypes = (c_uint, c_char_p, c_double, c_double, c_uint)
libsteps.api_short_circuit_set_line_fault.restype = None
libsteps.api_short_circuit_set_line_fault.argtypes = (c_uint, c_uint, c_char_p, c_char_p, c_double, c_double, c_double, c_uint)
libsteps.api_short_circuit_clear_fault.restype = None
libsteps.api_short_circuit_clear_fault.argtype = (c_uint)

libsteps.api_get_dynamic_simulator_integer_parameter.restype = (c_uint)
libsteps.api_get_dynamic_simulator_integer_parameter.argtypes = (c_char_p, c_uint)
libsteps.api_get_dynamic_simulator_float_parameter.restype = (c_double)
Expand Down
Loading

0 comments on commit 123b80e

Please sign in to comment.