From fdd39b3a1b58f57406f0f0e56674a4800d6ddc59 Mon Sep 17 00:00:00 2001 From: Changgang Li Date: Tue, 9 Mar 2021 17:00:10 +0800 Subject: [PATCH] update readme --- README.md | 7 ++- python/stepspy-current/stepspy/stepspy.py | 56 +++++++++++------------ 2 files changed, 33 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index 5741d690..6290aa0c 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,10 @@ # Simulation Toolkit for Electrical Power Systems - Maintainer: Changgang Li from School of Electrical Engineering, Shandong University. -- Documentation: https://github.com/changgang/steps/wiki/ -- Date of Readme: Feb. 5, 2021 +- Trust the following pages or other credible duplications: + * STEPS: https://github.com/changgang/steps + * stepspy: https://pypi.org/project/stepspy/ + * Documentation: https://github.com/changgang/steps/wiki/ +- Date of Readme: March 9, 2021 # Reference Please cite STEPS with the following paper: diff --git a/python/stepspy-current/stepspy/stepspy.py b/python/stepspy-current/stepspy/stepspy.py index b14a7570..5cc6dd79 100644 --- a/python/stepspy-current/stepspy/stepspy.py +++ b/python/stepspy-current/stepspy/stepspy.py @@ -455,7 +455,20 @@ def get_pv_unit_capacity(self): global STEPS_LIB device = self.__get_c_char_p_of_string("PV Unit") return int(STEPS_LIB.api_get_device_capacity(device, self.toolkit_index)) - + + def get_energy_storage_capacity(self): + """ + Get capacity for storing energy storages in database. + Args: N/A + Rets: + (1) Maximum number of energy storages that can be stored in the database. + Example: + nstorage_max = simulator.get_energy_storage_capacity() + """ + global STEPS_LIB + device = self.__get_c_char_p_of_string("Energy Storage") + return int(STEPS_LIB.api_get_device_capacity(device, self.toolkit_index)) + def get_load_capacity(self): """ Get capacity for storing loads in database. @@ -534,19 +547,6 @@ def get_equivalent_device_capacity(self): device = self.__get_c_char_p_of_string("Equivalent Device") return int(STEPS_LIB.api_get_device_capacity(device, self.toolkit_index)) - def get_energy_storage_capacity(self): - """ - Get capacity for storing energy storages in database. - Args: N/A - Rets: - (1) Maximum number of energy storages that can be stored in the database. - Example: - nstorage_max = simulator.get_energy_storage_capacity() - """ - global STEPS_LIB - device = self.__get_c_char_p_of_string("Energy Storage") - return int(STEPS_LIB.api_get_device_capacity(device, self.toolkit_index)) - def get_area_capacity(self): """ Get capacity for storing areas in database. @@ -639,6 +639,20 @@ def set_pv_unit_capacity(self, capacity): device = self.__get_c_char_p_of_string("PV Unit") return STEPS_LIB.api_set_device_capacity(device, capacity, self.toolkit_index) + def set_energy_storage_capacity(self, capacity): + """ + Set capacity for storing energy storages in database. + Args: + (1) capacity: Maximum number of energy storages that can be stored in the database. + Rets: N/A + Tips: + This function SHOULD be called before adding devices to the database. + Example: N/A + """ + global STEPS_LIB + device = self.__get_c_char_p_of_string("Energy Storage") + return STEPS_LIB.api_set_device_capacity(device, capacity, self.toolkit_index) + def set_load_capacity(self, capacity): """ Set capacity for storing loads in database. @@ -723,20 +737,6 @@ def set_equivalent_device_capacity(self, capacity): device = self.__get_c_char_p_of_string("Equivalent Device") return STEPS_LIB.api_set_device_capacity(device, capacity, self.toolkit_index) - def set_energy_storage_capacity(self, capacity): - """ - Set capacity for storing energy storages in database. - Args: - (1) capacity: Maximum number of energy storages that can be stored in the database. - Rets: N/A - Tips: - This function SHOULD be called before adding devices to the database. - Example: N/A - """ - global STEPS_LIB - device = self.__get_c_char_p_of_string("Energy Storage") - return STEPS_LIB.api_set_device_capacity(device, capacity, self.toolkit_index) - def set_area_capacity(self, capacity): """ Set capacity for storing areas in database.