sogno-platform / cimpy

Import and export CGMES / CIM IEC-61970 files in the XML/RDF format
https://sogno.energy/cimpy/
Apache License 2.0
53 stars 19 forks source link

about cim_import #38

Open zhizhuaa opened 1 month ago

zhizhuaa commented 1 month ago

import logging import cimpy from pathlib import Path

logging.basicConfig(filename='importCIGREMV.log', level=logging.INFO, filemode='w')

example = Path('.').resolve() sample_folder = example

sample_files = sample_folder.glob('*.xml')

xml_files = [] for file in sample_folder.glob('*.xml'): xml_files.append(str(file.absolute()))

import_result = cimpy.cim_import(xml_files, "cgmes_v2_4_15")

An error occurred when executing to import_result = cimpy.cim_import(xml_files, "cgmes_v2_4_15")

import_result = cimpy.cim_import(xml_files, "cgmes_v2_4_15") File "D:\anaconda3\envs\neuralforecast\lib\site-packages\cimpy\cimimport.py", line 61, in cim_import import_result, logger_grouped = _set_attributes(import_result, xml_files, namespace_rdf, base, logger_grouped) File "D:\anaconda3\envs\neuralforecast\lib\site-packages\cimpy\cimimport.py", line 280, in _set_attributes if uuid2[0] == "#": # reference IndexError: string index out of range

stv0g commented 1 month ago

Can you provide the loaded CGMES files for debugging?