Commit d6def9f3 authored by Jan Dinkelbach's avatar Jan Dinkelbach
Browse files

change pf and se example to new cimpy data structure

parent f08da0f2
......@@ -9,18 +9,22 @@ from pathlib import Path
logging.basicConfig(filename='CIGRE.log', level=logging.INFO, filemode='w')
cim_dir = Path('.') / 'sample_data' / 'CIGRE-MV-NoTap'
cim_files = cim_dir.glob('*.xml')
cim_list = []
for file in cim_files:
cim_list.append(str(file.absolute()))
print(cim_list)
this_file_folder = Path(__file__).resolve().parent
xml_path = this_file_folder / "sample_data" / "CIGRE-MV-NoTap"
xml_files = [xml_path / "Rootnet_FULL_NE_06J16h_DI.xml",
xml_path / "Rootnet_FULL_NE_06J16h_EQ.xml",
xml_path / "Rootnet_FULL_NE_06J16h_SV.xml",
xml_path / "Rootnet_FULL_NE_06J16h_TP.xml"]
xml_files_abs = []
for file in xml_files:
xml_files_abs.append(os.path.abspath(file))
# read cim files and create new network.Systen object
res, _, _ = cimpy.cim_import(cim_list, "cgmes_v2_4_15")
res = cimpy.cim_import(xml_files_abs, "cgmes_v2_4_15")
system = network.System()
base_apparent_power = 25 # MW
system.load_cim_data(res, base_apparent_power)
system.load_cim_data(res['topology'], base_apparent_power)
# Execute power flow analysis
results_pf, num_iter = nv_powerflow.solve(system)
......
......@@ -12,13 +12,10 @@ from pyvolt import results
import cimpy
import os
this_file_path = Path(__file__)
this_file_path.parent
#os.chdir(os.path.dirname(__file__))
logging.basicConfig(filename='CIGRE.log', level=logging.INFO, filemode='w')
xml_path = this_file_path.parent / "sample_data" / "CIGRE-MV-NoTap"
this_file_folder = Path(__file__).resolve().parent
xml_path = this_file_folder / "sample_data" / "CIGRE-MV-NoTap"
xml_files = [xml_path / "Rootnet_FULL_NE_06J16h_DI.xml",
xml_path / "Rootnet_FULL_NE_06J16h_EQ.xml",
xml_path / "Rootnet_FULL_NE_06J16h_SV.xml",
......@@ -32,7 +29,7 @@ for file in xml_files:
res = cimpy.cim_import(xml_files_abs, "cgmes_v2_4_15")
system = network.System()
base_apparent_power = 25 # MW
system.load_cim_data(res, base_apparent_power)
system.load_cim_data(res['topology'], base_apparent_power)
# Execute power flow analysis
results_pf, num_iter_cim = nv_powerflow.solve(system)
......
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