importCIGREMV.py 868 Bytes
Newer Older
1
2
3
import logging
import os
import cimpy
4
5


6
logging.basicConfig(filename='importCIGREMV.log', level=logging.INFO, filemode='w')
7
8
9
10
11
12
13
14
15
16
17

print(os.getcwd())
xml_files = [r"..\sampledata\CIGRE_MV\CIGRE_MV_Rudion_With_LoadFLow_Results\Rootnet_FULL_NE_24J13h_EQ.xml",
             r"..\sampledata\CIGRE_MV\CIGRE_MV_Rudion_With_LoadFLow_Results\Rootnet_FULL_NE_24J13h_SV.xml",
             r"..\sampledata\CIGRE_MV\CIGRE_MV_Rudion_With_LoadFLow_Results\Rootnet_FULL_NE_24J13h_TP.xml", ]

xml_files_abs = []
for file in xml_files:
    xml_files_abs.append(os.path.abspath(file))

# res = cimpy.cimread(xml_files)
18
import_result = cimpy.cim_import(xml_files_abs, "cgmes_v2_4_15")
19
20
print("\n\n")
results = ["ACLineSegment", "PowerTransformer", "EnergyConsumer"]
21
for key, value in import_result['topology'].items():
22
23
    if value.__class__.__name__ in results:
        print(value.__str__())