ntnuiotenergy / OpenEMPIRE

Stochastic linear program for investments in the European power system
https://openempire.readthedocs.io/en/latest/
MIT License
16 stars 15 forks source link

Index problem with Pyomo #19

Open LotharBrixius opened 9 months ago

LotharBrixius commented 9 months ago

8): 68422.0, ('France', 719, 'scenario5', 8): 67613.0, ('France', 720, 'scenario5', 8): 69987.0} failed: RuntimeError: Failed to set value for param=sloadRaw, index=('Germany', 1, 'scenario1', 4), value=57195.1825. source error message="Index '('Germany', 1, 'scenario1', 4)' is not valid for indexed component 'sloadRaw'" Traceback (most recent call last):

File ~\anaconda3\lib\site-packages\pyomo\core\base\param.py:808 in construct self._setitem_when_not_present(self._validate_index(key), val)

File ~\anaconda3\lib\site-packages\pyomo\core\base\indexed_component.py:874 in _validate_index raise KeyError(

KeyError: "Index '('Germany', 1, 'scenario1', 4)' is not valid for indexed component 'sloadRaw'"

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File ~\anaconda3\lib\site-packages\spyder_kernels\py3compat.py:356 in compat_exec exec(code, globals, locals)

File c:\users\lothar\documents\github\openempire\run.py:122 run_empire(name = name,

File ~\Documents\GitHub\OpenEMPIRE\Empire.py:755 in run_empire instance = model.create_instance(data) #, report_timing=True)

File ~\anaconda3\lib\site-packages\pyomo\core\base\PyomoModel.py:734 in create_instance instance.load(data, namespaces=_namespaces, profile_memory=profile_memory)

File ~\anaconda3\lib\site-packages\pyomo\core\base\PyomoModel.py:771 in load self._load_model_data(dp, namespaces, profile_memory=profile_memory)

File ~\anaconda3\lib\site-packages\pyomo\core\base\PyomoModel.py:823 in _load_model_data self._initialize_component(

File ~\anaconda3\lib\site-packages\pyomo\core\base\PyomoModel.py:871 in _initialize_component declaration.construct(data)

File ~\anaconda3\lib\site-packages\pyomo\core\base\param.py:811 in construct raise RuntimeError(

RuntimeError: Failed to set value for param=sloadRaw, index=('Germany', 1, 'scenario1', 4), value=57195.1825. source error message="Index '('Germany', 1, 'scenario1', 4)' is not valid for indexed component 'sloadRaw'"