Dear OEMOF users,
I sometimes run into a conspicuous error and I thought I would share the root of the problem in my case, so you can learn from it. The error comes up from your model definition:
model = Model(energysystem)
File ~\.conda\envs\energysystem\Lib\site-packages\oemof\solph\_models.py:386 in __init__
super().__init__(energysystem, **kwargs)
File ~\.conda\envs\energysystem\Lib\site-packages\oemof\solph\_models.py:162 in __init__
self._construct()
File ~\.conda\envs\energysystem\Lib\site-packages\oemof\solph\_models.py:169 in _construct
self._add_parent_block_variables()
File ~\.conda\envs\energysystem\Lib\site-packages\oemof\solph\_models.py:497 in _add_parent_block_variables
if self.flows[o, i].fix[self.TIMESTEPS.at(1)] is not None:
File ~\.conda\envs\energysystem\Lib\site-packages\pandas\core\frame.py:3893 in __getitem__
indexer = self.columns.get_loc(key)
File ~\.conda\envs\energysystem\Lib\site-packages\pandas\core\indexes\base.py:3798 in get_loc
raise KeyError(key) from err
KeyError: 0
The issue has to do with that a fix that you apply to a flow has a type or length that OEMOF does not understand, it then spits out the above. Cheers!