GridCal.Engine.IO package¶
Submodules¶
GridCal.Engine.IO.cim_parser module¶
-
class
GridCal.Engine.IO.cim_parser.
ACLineSegment
(id, tpe)¶
-
class
GridCal.Engine.IO.cim_parser.
CIMCircuit
¶ Bases:
object
-
static
check_type
(xml, class_types, starter='<cim:', ender='</cim:')¶ Checks if we are starting an object of the predefined types :param xml: some text :param class_types: list of CIM types :param starter string to add prior to the class when opening an object :param ender string to add prior to a class when closing an object :return: start_recording, end_recording, the found type or None if no one was found
-
clear
()¶ Clear the circuit
-
find_references
(recognised={})¶ Replaces the references of the classes given :return:
-
parse_file
(file_name, classes_=None)¶ Parse CIM file and add all the recognised objects :param file_name: file name or path :return:
-
static
-
class
GridCal.Engine.IO.cim_parser.
CIMExport
(circuit: GridCal.Engine.Core.multi_circuit.MultiCircuit)¶ Bases:
object
-
save
(file_name)¶ Save XML CIM version of a grid Args:
file_name: file path
-
-
class
GridCal.Engine.IO.cim_parser.
CIMImport
¶ Bases:
object
-
add_node_terminal_relation
(connectivity_node, terminal)¶ Add the relation between a Connectivity Node and a Terminal :param terminal: :param connectivity_node: :return:
-
any_in_dict
(dict, keys)¶
-
get_elements
(dict, keys)¶
-
load_cim_file
(equipment_file, topology_file=None)¶ Load CIM file :param equipment_file: Main CIM file :param topology_file: Secondary CIM file that may contain the terminals-connectivity node relations
-
try_properties
(dictionary, properties, defaults=None)¶ Parameters: - dictionary –
- properties –
Returns:
-
-
class
GridCal.Engine.IO.cim_parser.
ConformLoad
(id, tpe)¶
-
class
GridCal.Engine.IO.cim_parser.
GeneralContainer
(id, tpe, resources=[], class_replacements={})¶ Bases:
object
-
get_xml
(level=0)¶ Returns an XML representation of the object Args:
level:Returns:
-
merge
(other)¶ Merge the properties of this object with another :param other: GeneralContainer instance
-
parse_line
(line)¶ Parse xml line that eligibly belongs to this object :param line: xml text line
-
print
()¶
-
-
class
GridCal.Engine.IO.cim_parser.
PowerTransformer
(id, tpe)¶
-
class
GridCal.Engine.IO.cim_parser.
SynchronousMachine
(id, tpe)¶
-
class
GridCal.Engine.IO.cim_parser.
Winding
(id, tpe)¶
-
GridCal.Engine.IO.cim_parser.
index_find
(string, start, end)¶ version of substring that matches :param string: string :param start: string to start splitting :param end: string to end splitting :return: string between start and end
GridCal.Engine.IO.dgs_parser module¶
# This file is part of GridCal. # # GridCal is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # GridCal is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GridCal. If not, see <http://www.gnu.org/licenses/>.
-
GridCal.Engine.IO.dgs_parser.
data_to_grid_object
(data, pos_dict, codification='utf-8')¶ Turns the read data dictionary into a GridCal MultiCircuit object Args:
data: Dictionary of data read from a DGS file pos_dict: Dictionary of objects and their positions read from a DGS fileReturns: GridCal MultiCircuit object
-
GridCal.Engine.IO.dgs_parser.
dgs_to_circuit
(filename)¶
-
GridCal.Engine.IO.dgs_parser.
read_DGS
(filename)¶ Read a DigSilent Power Factory .dgs file and return a dictionary with the data Args:
filename: File name or path- Returns: Dictionary of data where the keys are the object types and the values
- are the data of the objects of the key object type
GridCal.Engine.IO.dpx_parser module¶
-
GridCal.Engine.IO.dpx_parser.
load_dpx
(file_name, contraction_factor=1000)¶ Read DPX file :param file_name: file name :return: MultiCircuit
-
GridCal.Engine.IO.dpx_parser.
read_dpx_data
(file_name)¶ Read the DPX file into a structured dictionary :param file_name: :return:
-
GridCal.Engine.IO.dpx_parser.
reformat
(val)¶ Pick string and give it format :param val: string value :return: int, float or string
-
GridCal.Engine.IO.dpx_parser.
repack
(data_structures, logger=[], verbose=False)¶ Pack the values as DataFrames with headers where available :param data_structures: Raw data structures :param logger: logger (inherited) :return:
GridCal.Engine.IO.excel_interface module¶
-
GridCal.Engine.IO.excel_interface.
check_names
(names)¶ Check that the names are allowed :param names: :return:
-
GridCal.Engine.IO.excel_interface.
create_data_frames
(circuit: GridCal.Engine.Core.multi_circuit.MultiCircuit)¶ Pack the circuit information into tables (DataFrames) :param circuit: MultiCircuit instance :return: dictionary of DataFrames
-
GridCal.Engine.IO.excel_interface.
get_allowed_sheets
(circuit=<GridCal.Engine.Core.multi_circuit.MultiCircuit object>)¶ Parameters: circuit – Returns:
-
GridCal.Engine.IO.excel_interface.
get_objects_dictionary
(circuit=<GridCal.Engine.Core.multi_circuit.MultiCircuit object>)¶ Parameters: circuit – Returns:
-
GridCal.Engine.IO.excel_interface.
interpret_excel_v3
(circuit: GridCal.Engine.Core.multi_circuit.MultiCircuit, data)¶ Interpret the file version 3 In this file version there are no complex numbers saved :param circuit: :param data: Dictionary with the excel file sheet labels and the corresponding DataFrame :return: Nothing, just applies the loaded data to this MultiCircuit instance
-
GridCal.Engine.IO.excel_interface.
interprete_excel_v2
(circuit: GridCal.Engine.Core.multi_circuit.MultiCircuit, data)¶ Interpret the file version 2 :param circuit: :param data: Dictionary with the excel file sheet labels and the corresponding DataFrame :return: Nothing, just applies the loaded data to this MultiCircuit instance
-
GridCal.Engine.IO.excel_interface.
load_from_xls
(filename)¶ Loads the excel file content to a dictionary for parsing the data
-
GridCal.Engine.IO.excel_interface.
save_excel
(circuit: GridCal.Engine.Core.multi_circuit.MultiCircuit, file_path)¶ Save the circuit information in excel format :param circuit: MultiCircuit instance :param file_path: path to the excel file :return: logger with information
GridCal.Engine.IO.file_handler module¶
-
class
GridCal.Engine.IO.file_handler.
FileOpen
(file_name)¶ Bases:
object
-
open
(text_func=None, progress_func=None)¶ Load GridCal compatible file :param text_func: pointer to function that prints the names :param progress_func: pointer to function that prints the progress 0~100 :return: logger with information
-
-
class
GridCal.Engine.IO.file_handler.
FileOpenThread
(file_name)¶ Bases:
PySide2.QtCore.QThread
-
cancel
()¶
-
done_signal
= <PySide2.QtCore.Signal object>¶
-
progress_signal
= <PySide2.QtCore.Signal object>¶
-
progress_text
= <PySide2.QtCore.Signal object>¶
-
run
()¶ run the file open procedure
-
staticMetaObject
= <PySide2.QtCore.QMetaObject object>¶
-
-
class
GridCal.Engine.IO.file_handler.
FileSave
(circuit: GridCal.Engine.Core.multi_circuit.MultiCircuit, file_name, text_func=None, progress_func=None)¶ Bases:
object
-
save
()¶ Save the file in the corresponding format :return: logger with information
-
save_cim
()¶ Save the circuit information in CIM format :return: logger with information
-
save_excel
()¶ Save the circuit information in excel format :return: logger with information
-
save_json
()¶ Save the circuit information in json format :return:logger with information
-
save_zip
()¶ Save the circuit information in zip format :return: logger with information
-
-
class
GridCal.Engine.IO.file_handler.
FileSaveThread
(circuit: GridCal.Engine.Core.multi_circuit.MultiCircuit, file_name)¶ Bases:
PySide2.QtCore.QThread
-
cancel
()¶
-
done_signal
= <PySide2.QtCore.Signal object>¶
-
progress_signal
= <PySide2.QtCore.Signal object>¶
-
progress_text
= <PySide2.QtCore.Signal object>¶
-
run
()¶ run the file save procedure @return:
-
staticMetaObject
= <PySide2.QtCore.QMetaObject object>¶
-
GridCal.Engine.IO.h5_interface module¶
-
GridCal.Engine.IO.h5_interface.
load_dict_from_hdf5
(filename)¶ Parameters: filename – Returns:
-
GridCal.Engine.IO.h5_interface.
open_h5
(file_path)¶
-
GridCal.Engine.IO.h5_interface.
recursively_load_dict_contents_from_group
(h5file, path)¶ Parameters: - h5file –
- path –
Returns:
-
GridCal.Engine.IO.h5_interface.
recursively_save_dict_contents_to_group
(h5file, path, dic)¶ Parameters: - h5file –
- path –
- dic –
Returns:
-
GridCal.Engine.IO.h5_interface.
save_dict_to_hdf5
(dic, filename)¶ Parameters: - dic –
- filename –
Returns:
-
GridCal.Engine.IO.h5_interface.
save_h5
(circuit: GridCal.Engine.Core.multi_circuit.MultiCircuit, file_path)¶ Save the circuit information in excel format :param circuit: MultiCircuit instance :param file_path: path to the excel file :return: logger with information
GridCal.Engine.IO.json_parser module¶
-
GridCal.Engine.IO.json_parser.
parse_json
(file_name)¶ Parse JSON file into Circuit :param file_name: :return: GridCal MultiCircuit
-
GridCal.Engine.IO.json_parser.
parse_json_data
(data)¶ Parse JSON structure into GridCal MultiCircuit :param data: JSON structure (list of dictionaries) :return: GridCal MultiCircuit
-
GridCal.Engine.IO.json_parser.
save_json_file
(file_path, circuit: GridCal.Engine.Core.multi_circuit.MultiCircuit)¶ Save JSON file :param file_path: file path :param circuit: GridCal MultiCircuit element
GridCal.Engine.IO.matpower_branch_definitions module¶
-
GridCal.Engine.IO.matpower_branch_definitions.
branch_headers
= ['fbus', 'tbus', 'r', 'x', 'b', 'rateA', 'rateB', 'rateC', 'ratio', 'angle', 'status', 'angmin', 'angmax', 'Pf', 'Qf', 'Pt', 'Qt', 'Mu_Sf', 'Mu_St', 'Mu_AngMin', 'Mu_AngMax', 'Current', 'Loading', 'Losses', 'Original_index']¶ Defines constants for named column indices to dcline matrix.
Some examples of usage, after defining the constants using the line above, are:
ppc.dcline(4, c[‘BR_STATUS’]) = 0 take branch 4 out of serviceThe index, name and meaning of each column of the branch matrix is given below:
- columns 1-17 must be included in input matrix (in case file)
- 1 F_BUS f, “from” bus number 2 T_BUS t, “to” bus number 3 BR_STATUS initial branch status, 1 - in service, 0 - out of service 4 PF MW flow at “from” bus (“from” -> “to”) 5 PT MW flow at “to” bus (“from” -> “to”) 6 QF MVAr injection at “from” bus (“from” -> “to”) 7 QT MVAr injection at “to” bus (“from” -> “to”) 8 VF voltage setpoint at “from” bus (p.u.) 9 VT voltage setpoint at “to” bus (p.u.)
10 PMIN lower limit on PF (MW flow at “from” end) 11 PMAX upper limit on PF (MW flow at “from” end) 12 QMINF lower limit on MVAr injection at “from” bus 13 QMAXF upper limit on MVAr injection at “from” bus 14 QMINT lower limit on MVAr injection at “to” bus 15 QMAXT upper limit on MVAr injection at “to” bus 16 LOSS0 constant term of linear loss function (MW) 17 LOSS1 linear term of linear loss function (MW/MW)
(loss = LOSS0 + LOSS1 * PF)columns 18-23 are added to matrix after OPF solution they are typically not present in the input matrix
(assume OPF objective function has units, u)18 MU_PMIN Kuhn-Tucker multiplier on lower flow lim at “from” bus (u/MW) 19 MU_PMAX Kuhn-Tucker multiplier on upper flow lim at “from” bus (u/MW) 20 MU_QMINF Kuhn-Tucker multiplier on lower VAr lim at “from” bus (u/MVAr) 21 MU_QMAXF Kuhn-Tucker multiplier on upper VAr lim at “from” bus (u/MVAr) 22 MU_QMINT Kuhn-Tucker multiplier on lower VAr lim at “to” bus (u/MVAr) 23 MU_QMAXT Kuhn-Tucker multiplier on upper VAr lim at “to” bus (u/MVAr)
@see: L{toggle_dcline}
-
GridCal.Engine.IO.matpower_branch_definitions.
get_transformer_impedances
(HV_nominal_voltage, LV_nominal_voltage, Nominal_power, Copper_losses, Iron_losses, No_load_current, Short_circuit_voltage, GR_hv1, GX_hv1)¶ Compute the branch parameters of a transformer from the short circuit test values @param HV_nominal_voltage: High voltage side nominal voltage (kV) @param LV_nominal_voltage: Low voltage side nominal voltage (kV) @param Nominal_power: Transformer nominal power (MVA) @param Copper_losses: Copper losses (kW) @param Iron_losses: Iron Losses (kW) @param No_load_current: No load current (%) @param Short_circuit_voltage: Short circuit voltage (%) @param GR_hv1: @param GX_hv1: @return:
leakage_impedance: Series impedance magnetizing_impedance: Shunt impedance
GridCal.Engine.IO.matpower_bus_definitions module¶
-
GridCal.Engine.IO.matpower_bus_definitions.
bustypes
(bus, gen, storage, Sbus, storage_dispatch_mode=<StorageDispatchMode.no_dispatch: (0, )>)¶ Builds index lists of each type of bus (C{REF}, C{PV}, C{PQ}).
Generators with “out-of-service” status are treated as L{PQ} buses with zero generation (regardless of C{Pg}/C{Qg} values in gen). Expects C{bus} and C{gen} have been converted to use internal consecutive bus numbering.
@param bus: bus data @param gen: generator data @return: index lists of each bus type
@author: Ray Zimmerman (PSERC Cornell)
GridCal.Engine.IO.matpower_gen_definitions module¶
-
GridCal.Engine.IO.matpower_gen_definitions.
gen_headers
= ['bus', 'Pg', 'Qg', 'Qmax', 'Qmin', 'Vg', 'mBase', 'status', 'Pmax', 'Pmin', 'Pc1', 'Pc2', 'Qc1min', 'Qc1max', 'Qc2min', 'Qc2max', 'ramp_agc', 'ramp_10', 'ramp_30', 'ramp_q', 'apf', 'MU_PMAX', 'MU_PMIN', 'MU_QMAX', 'MU_QMIN', 'Dispatchable', 'Fix_power']¶ Defines constants for named column indices to gencost matrix.
Some examples of usage, after defining the constants using the line above, are:
start = gencost[3, STARTUP] # get startup cost of generator 4 gencost[2, [MODEL, NCOST:COST+2]] = [POLYNOMIAL, 2, 30, 0] # set the cost of generator 2 to a linear function COST = 30 * Pg
The index, name and meaning of each column of the gencost matrix is given below:
- columns 1-5
- C{MODEL} cost model, 1 - piecewise linear, 2 - polynomial
- C{STARTUP} startup cost in US dollars
- C{SHUTDOWN} shutdown cost in US dollars
4. C{NCOST} number of cost coefficients to follow for polynomial cost function, or number of data points for piecewise linear 5. C{COST} 1st column of cost parameters cost data defining total cost function For polynomial cost (highest order coeff first):
e.g. cn, ..., c1, c0
where the polynomial is C{c0 + c1*P + … + cn*P^n} For piecewise linear cost:
x0, y0, x1, y1, x2, y2, ...
where C{x0 < x1 < x2 < …} and the points C{(x0,y0), (x1,y1), (x2,y2), …} are the end- and break-points of the total cost function.
- additional constants, used to assign/compare values in the C{MODEL} column
- C{PW_LINEAR} piecewise linear generator cost model
- C{POLYNOMIAL} polynomial generator cost model
@author: Ray Zimmerman (PSERC Cornell) @author: Richard Lincoln
GridCal.Engine.IO.matpower_parser module¶
# This file is part of GridCal. # # GridCal is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # GridCal is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GridCal. If not, see <http://www.gnu.org/licenses/>.
-
GridCal.Engine.IO.matpower_parser.
find_between
(s, first, last)¶ Find sting between two sub-strings Args:
s: Main string first: first sub-string last: second sub-stringExample find_between(‘[Hello]’, ‘[‘, ‘]’) -> returns ‘Hello’ Returns:
String between the first and second sub-strings, if any was found otherwise returns an empty string
-
GridCal.Engine.IO.matpower_parser.
interpret_data_v1
(circuit, data)¶ Pass the loaded table-like data to the structures @param data: Data dictionary @return:
-
GridCal.Engine.IO.matpower_parser.
parse_matpower_file
(filename, export=False)¶ - Args:
- filename: export:
Returns:
-
GridCal.Engine.IO.matpower_parser.
parse_matpower_file_old
(filename, export=False)¶ Converts a MatPower file to GridCal basic dictionary @param filename: @return:
-
GridCal.Engine.IO.matpower_parser.
txt2mat
(txt, line_splitter=';', col_splitter='\t', to_float=True)¶ - Args:
- txt: line_splitter: col_splitter:
Returns:
GridCal.Engine.IO.matpower_storage_definitions module¶
GridCal.Engine.IO.psse_parser module¶
-
class
GridCal.Engine.IO.psse_parser.
PSSeArea
(data, version, logger: list)¶ Bases:
object
-
class
GridCal.Engine.IO.psse_parser.
PSSeBranch
(data, version, logger: list)¶ Bases:
object
-
get_object
(psse_bus_dict, logger: list)¶ Return GridCal branch object Args:
psse_bus_dict: Dictionary that relates PSSe bus indices with GridCal Bus objects- Returns:
- Gridcal Branch object
-
-
class
GridCal.Engine.IO.psse_parser.
PSSeBus
(data, version, logger: list)¶ Bases:
object
-
class
GridCal.Engine.IO.psse_parser.
PSSeGenerator
(data, version, logger: list)¶ Bases:
object
-
get_object
(logger: list)¶ Return GridCal Load object Returns:
Gridcal Load object
-
-
class
GridCal.Engine.IO.psse_parser.
PSSeGrid
(data)¶ Bases:
object
-
BASFRQ
= None¶ Case Identification Data Bus Data Load Data Fixed Bus Shunt Data Generator Data Non-Transformer Branch Data Transformer Data Area Interchange Data Two-Terminal DC Transmission Line Data Voltage Source Converter (VSC) DC Transmission Line Data Transformer Impedance Correction Tables Multi-Terminal DC Transmission Line Data Multi-Section Line Grouping Data Zone Data Interarea Transfer Data Owner Data FACTS Device Data Switched Shunt Data GNE Device Data Induction Machine Data Q Record
-
IC
= None¶ Case Identification Data Bus Data Load Data Fixed Bus Shunt Data Generator Data Non-Transformer Branch Data Transformer Data Area Interchange Data Two-Terminal DC Transmission Line Data Voltage Source Converter (VSC) DC Transmission Line Data Transformer Impedance Correction Tables Multi-Terminal DC Transmission Line Data Multi-Section Line Grouping Data Zone Data Interarea Transfer Data Owner Data FACTS Device Data Switched Shunt Data GNE Device Data Induction Machine Data Q Record
-
NXFRAT
= None¶ Case Identification Data Bus Data Load Data Fixed Bus Shunt Data Generator Data Non-Transformer Branch Data Transformer Data Area Interchange Data Two-Terminal DC Transmission Line Data Voltage Source Converter (VSC) DC Transmission Line Data Transformer Impedance Correction Tables Multi-Terminal DC Transmission Line Data Multi-Section Line Grouping Data Zone Data Interarea Transfer Data Owner Data FACTS Device Data Switched Shunt Data GNE Device Data Induction Machine Data Q Record
-
REV
= None¶ Case Identification Data Bus Data Load Data Fixed Bus Shunt Data Generator Data Non-Transformer Branch Data Transformer Data Area Interchange Data Two-Terminal DC Transmission Line Data Voltage Source Converter (VSC) DC Transmission Line Data Transformer Impedance Correction Tables Multi-Terminal DC Transmission Line Data Multi-Section Line Grouping Data Zone Data Interarea Transfer Data Owner Data FACTS Device Data Switched Shunt Data GNE Device Data Induction Machine Data Q Record
-
SBASE
= None¶ Case Identification Data Bus Data Load Data Fixed Bus Shunt Data Generator Data Non-Transformer Branch Data Transformer Data Area Interchange Data Two-Terminal DC Transmission Line Data Voltage Source Converter (VSC) DC Transmission Line Data Transformer Impedance Correction Tables Multi-Terminal DC Transmission Line Data Multi-Section Line Grouping Data Zone Data Interarea Transfer Data Owner Data FACTS Device Data Switched Shunt Data GNE Device Data Induction Machine Data Q Record
-
XFRRAT
= None¶ Case Identification Data Bus Data Load Data Fixed Bus Shunt Data Generator Data Non-Transformer Branch Data Transformer Data Area Interchange Data Two-Terminal DC Transmission Line Data Voltage Source Converter (VSC) DC Transmission Line Data Transformer Impedance Correction Tables Multi-Terminal DC Transmission Line Data Multi-Section Line Grouping Data Zone Data Interarea Transfer Data Owner Data FACTS Device Data Switched Shunt Data GNE Device Data Induction Machine Data Q Record
-
get_circuit
(logger: list)¶ Return GridCal circuit Returns:
-
-
class
GridCal.Engine.IO.psse_parser.
PSSeInductionMachine
(data, version, logger: list)¶ Bases:
object
-
get_object
(logger: list)¶ Return GridCal Load object Returns:
Gridcal Load object
-
-
class
GridCal.Engine.IO.psse_parser.
PSSeLoad
(data, version, logger: list)¶ Bases:
object
-
get_object
(bus: GridCal.Engine.Devices.bus.Bus, logger: list)¶ Return GridCal Load object Returns:
Gridcal Load object
-
-
class
GridCal.Engine.IO.psse_parser.
PSSeParser
(file_name)¶ Bases:
object
-
parse_psse
() -> (<class 'GridCal.Engine.Core.multi_circuit.MultiCircuit'>, typing.List[typing.AnyStr])¶ - Parser implemented according to:
- POM section 4.1.1 Power Flow Raw Data File Contents (v.29)
- POM section 5.2.1 (v.33)
- POM section 5.2.1 (v.32)
Returns: MultiCircuit, List[str]
-
read_and_split
()¶ Read the text file and split it into sections :return:
-
-
class
GridCal.Engine.IO.psse_parser.
PSSeShunt
(data, version, logger: list)¶ Bases:
object
-
get_object
(bus: GridCal.Engine.Devices.bus.Bus, logger: list)¶ Return GridCal Load object Returns:
Gridcal Load object
-
-
class
GridCal.Engine.IO.psse_parser.
PSSeTransformer
(data, version, logger: list)¶ Bases:
object
-
NOMV2
= None¶ I,J,K,CKT,CW,CZ,CM,MAG1,MAG2,NMETR,’NAME’,STAT,O1,F1,…,O4,F4 R1-2,X1-2,SBASE1-2,R2-3,X2-3,SBASE2-3,R3-1,X3-1,SBASE3-1,VMSTAR,ANSTAR
WINDV1,NOMV1,ANG1,RATA1,RATB1,RATC1,COD,CONT,RMA,RMI,VMA,VMI,NTP,TAB,CR,CX
WINDV2,NOMV2,ANG2,RATA2,RATB2,RATC2
WINDV3,NOMV3,ANG3,RATA3,RATB3,RATC3
-
WINDV2
= None¶ I,J,K,CKT,CW,CZ,CM,MAG1,MAG2,NMETR,’NAME’,STAT,O1,F1,…,O4,F4 R1-2,X1-2,SBASE1-2,R2-3,X2-3,SBASE2-3,R3-1,X3-1,SBASE3-1,VMSTAR,ANSTAR
WINDV1,NOMV1,ANG1,RATA1,RATB1,RATC1,COD,CONT,RMA,RMI,VMA,VMI,NTP,TAB,CR,CX
WINDV2,NOMV2,ANG2,RATA2,RATB2,RATC2
WINDV3,NOMV3,ANG3,RATA3,RATB3,RATC3
-
get_object
(psse_bus_dict, logger: list)¶ Return GridCal branch object Args:
psse_bus_dict: Dictionary that relates PSSe bus indices with GridCal Bus objects- Returns:
- Gridcal Branch object
-
windings
= None¶ I,J,K,CKT,CW,CZ,CM,MAG1,MAG2,NMETR,’NAME’,STAT,O1,F1,…,O4,F4,VECGRP R1-2,X1-2,SBASE1-2,R2-3,X2-3,SBASE2-3,R3-1,X3-1,SBASE3-1,VMSTAR,ANSTAR WINDV1,NOMV1,ANG1,RATA1,RATB1,RATC1,COD1,CONT1,RMA1,RMI1,VMA1,VMI1,NTP1,TAB1,CR1,CX1,CNXA1 WINDV2,NOMV2,ANG2,RATA2,RATB2,RATC2,COD2,CONT2,RMA2,RMI2,VMA2,VMI2,NTP2,TAB2,CR2,CX2,CNXA2 WINDV3,NOMV3,ANG3,RATA3,RATB3,RATC3,COD3,CONT3,RMA3,RMI3,VMA3,VMI3,NTP3,TAB3,CR3,CX3,CNXA3
-
-
class
GridCal.Engine.IO.psse_parser.
PSSeTwoTerminalDCLine
(data, version, logger: list)¶ Bases:
object
-
get_object
(psse_bus_dict, logger: list)¶ GEt equivalent object :param psse_bus_dict: :param logger: :return:
-
-
class
GridCal.Engine.IO.psse_parser.
PSSeVscDCLine
(data, version, logger: list)¶ Bases:
object
-
get_object
(psse_bus_dict, logger: list)¶ GEt equivalent object :param psse_bus_dict: :param logger: :return:
-
-
class
GridCal.Engine.IO.psse_parser.
PSSeZone
(data, version, logger: list)¶ Bases:
object
-
GridCal.Engine.IO.psse_parser.
interpret_line
(line, splitter=', ')¶ Split text into arguments and parse each of them to an appropriate format (int, float or string) Args:
line: splitter:Returns: list of arguments
-
GridCal.Engine.IO.psse_parser.
process_raw_file
(root_folder, destination_folder, fname)¶ process a .raw file :param root_folder: folder :param fname: file name (in the folder) :return: nothing
GridCal.Engine.IO.sqlite_interface module¶
-
GridCal.Engine.IO.sqlite_interface.
open_sqlite
(file_path)¶
-
GridCal.Engine.IO.sqlite_interface.
save_sqlite
(circuit: GridCal.Engine.Core.multi_circuit.MultiCircuit, file_path)¶ Save the circuit information in excel format :param circuit: MultiCircuit instance :param file_path: path to the excel file :return: logger with information
GridCal.Engine.IO.zip_interface module¶
-
GridCal.Engine.IO.zip_interface.
open_data_frames_from_zip
(file_name_zip, text_func=None, progress_func=None)¶ Open the csv files from a zip file :param file_name_zip: name of the zip file :param text_func: pointer to function that prints the names :param progress_func: pointer to function that prints the progress 0~100 :return: list of DataFrames
-
GridCal.Engine.IO.zip_interface.
save_data_frames_to_zip
(dfs: Dict[str, pandas.core.frame.DataFrame], filename_zip='file.zip', text_func=None, progress_func=None)¶ Save a list of DataFrames to a zip file without saving to disk the csv files :param dfs: dictionary of pandas dataFrames {name: DataFrame} :param filename_zip: file name where to save all :param text_func: pointer to function that prints the names :param progress_func: pointer to function that prints the progress 0~100