[Python] pypsa to powerfactory converter

Discussão em 'Python' iniciado por Stack, Julho 10, 2025.

  1. Stack

    Stack Membro Participativo

    im trying to converter a grid model network from pypsa to powerfactory and when i run the code converter.create_project(auto_gen_types=True, sym_av_mode='constv') i got the following error:KeyError Traceback (most recent call last) File c:\Users\elid_ra.conda\envs\env_desys\Lib\site-packages\pandas\core\indexes\base.py:3812, in Index.get_loc(self, key) 3811 try: -> 3812 return self._engine.get_loc(casted_key) 3813 except KeyError as err:

    File pandas/_libs/index.pyx:167, in pandas._libs.index.IndexEngine.get_loc()

    File pandas/_libs/index.pyx:196, in pandas._libs.index.IndexEngine.get_loc()

    File pandas/_libs/hashtable_class_helper.pxi:7088, in pandas._libs.hashtable.PyObjectHashTable.get_item()

    File pandas/_libs/hashtable_class_helper.pxi:7096, in pandas._libs.hashtable.PyObjectHashTable.get_item()

    KeyError: '11830 AC'

    The above exception was the direct cause of the following exception:

    KeyError Traceback (most recent call last) Cell In[18], line 1 ----> 1 converter.create_project(auto_gen_types=True, sym_av_mode='constv')

    File h:\PYPFconvert\pypfconvert\pypfconvert\pypsa2pf.py:327, in Pypsa2Pf.create_project(self, timestamp, bus_prefix, gen_prefix, gen_type_prefix, load_prefix, shunt_prefix, line_prefix, line_type_prefix, trf_prefix, trf_type_prefix, cha_prefix, sc_prefix, vsc_prefix, storage_prefix, store_prefix, dclink_prefix, dclink_type_prefix, gen_type, link_prefix, auto_gen_types, gen_match_types, sym_av_mode, use_results_as_setpoints, show) 325 # create topology ... 3822 # InvalidIndexError. Otherwise we fall through and re-raise 3823 # the TypeError. 3824 self._check_indexing_error(key)

    KeyError: '11830 AC' how can solve the problem?

    Continue reading...

Compartilhe esta Página