Commit b437ccc6 authored by Philipp Reuber's avatar Philipp Reuber
Browse files

fix documentation

parent 42362a17
Pipeline #250282 passed with stages
in 1 minute and 42 seconds
import logging
import os
import cimpy
logging.basicConfig(filename='Convert_to_Bus_Branch.log', level=logging.INFO, filemode='w')
xml_files = [r"..\sampledata\Sample_Grid_Switches\Node-Breaker\20191030T0924Z_XX_YYY_DL_.xml",
r"..\sampledata\Sample_Grid_Switches\Node-Breaker\20191030T0924Z_XX_YYY_GL_.xml",
r"..\sampledata\Sample_Grid_Switches\Node-Breaker\20191030T0924Z_XX_YYY_SSH_.xml",
r"..\sampledata\Sample_Grid_Switches\Node-Breaker\20191030T0924Z_XX_YYY_SV_.xml",
r"..\sampledata\Sample_Grid_Switches\Node-Breaker\20191030T0924Z_XX_YYY_TP_.xml",
r"..\sampledata\Sample_Grid_Switches\Node-Breaker\20191030T0924Z_YYY_EQ_.xml",]
xml_files_abs = []
for file in xml_files:
xml_files_abs.append(os.path.abspath(file))
def convert_bus_branch_example():
logging.basicConfig(filename='Convert_to_Bus_Branch.log', level=logging.INFO, filemode='w')
xml_files = [r"..\sampledata\Sample_Grid_Switches\Node-Breaker\20191030T0924Z_XX_YYY_DL_.xml",
r"..\sampledata\Sample_Grid_Switches\Node-Breaker\20191030T0924Z_XX_YYY_GL_.xml",
r"..\sampledata\Sample_Grid_Switches\Node-Breaker\20191030T0924Z_XX_YYY_SSH_.xml",
r"..\sampledata\Sample_Grid_Switches\Node-Breaker\20191030T0924Z_XX_YYY_SV_.xml",
r"..\sampledata\Sample_Grid_Switches\Node-Breaker\20191030T0924Z_XX_YYY_TP_.xml",
r"..\sampledata\Sample_Grid_Switches\Node-Breaker\20191030T0924Z_YYY_EQ_.xml",]
# res = cimpy.cimread(xml_files)
res, namespaces = cimpy.cim_import(xml_files_abs, "cgmes_v2_4_15")
xml_files_abs = []
for file in xml_files:
xml_files_abs.append(os.path.abspath(file))
bus_branch = cimpy.utils.node_breaker_to_bus_branch(res)
# dicts = cimpy.get_class_attributes_dict(res)
cimpy.cim_export(bus_branch, namespaces, 'Bus_Branch_Converted', 'cgmes_v2_4_15')
\ No newline at end of file
# res = cimpy.cimread(xml_files)
res, namespaces = cimpy.cim_import(xml_files_abs, "cgmes_v2_4_15")
bus_branch = cimpy.utils.node_breaker_to_bus_branch(res)
# dicts = cimpy.get_class_attributes_dict(res)
cimpy.cim_export(bus_branch, namespaces, 'Bus_Branch_Converted', 'cgmes_v2_4_15')
\ No newline at end of file
......@@ -27,5 +27,5 @@ Contact
:hidden:
Install
Started
Start
Versions
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment