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

fix path and cim import in se example

parent db6095ba
......@@ -2,6 +2,7 @@
# The state estimation is performed based on the results using the nv_powerflow implementation
import logging
from pathlib import Path
import numpy as np
from pyvolt import network
from pyvolt import nv_powerflow
......@@ -11,22 +12,24 @@ from pyvolt import results
import cimpy
import os
os.chdir(os.path.dirname(__file__))
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 = r".\sample_data\CIGRE-MV-NoTap"
xml_files = [xml_path + r"\Rootnet_FULL_NE_06J16h_DI.xml",
xml_path + r"\Rootnet_FULL_NE_06J16h_EQ.xml",
xml_path + r"\Rootnet_FULL_NE_06J16h_SV.xml",
xml_path + r"\Rootnet_FULL_NE_06J16h_TP.xml"]
xml_path = this_file_path.parent / "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(xml_files_abs, "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)
......
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