openego / powerd-data

GNU Affero General Public License v3.0
1 stars 0 forks source link

power_plants.insert-hydro-biomass fails in SH run #61

Closed ulfmueller closed 1 year ago

ulfmueller commented 1 year ago
ERROR - "None of [Index(['SchleswigHolstein', 'SchleswigHolstein', 'SchleswigHolstein',\n       'SchleswigHolstein', 'SchleswigHolstein', 'SchleswigHolstein',\n       'SchleswigHolstein', 'SchleswigHolstein', 'SchleswigHolstein',\n       'SchleswigHolstein',\n       ...\n       'SchleswigHolstein', 'SchleswigHolstein', 'SchleswigHolstein',\n       'SchleswigHolstein', 'SchleswigHolstein', 'SchleswigHolstein',\n       'SchleswigHolstein', 'SchleswigHolstein', 'SchleswigHolstein',\n       'SchleswigHolstein'],\n      dtype='object', name='state', length=1322)] are in the [index]"
Traceback (most recent call last):
  File "/home/powerd/sh-powerd-data/venv/lib/python3.8/site-packages/airflow/models/taskinstance.py", line 984, in _run_raw_task
    result = task_copy.execute(context=context)
  File "/home/powerd/sh-powerd-data/powerd-data/src/egon/data/datasets/__init__.py", line 200, in skip_task
    result = super(type(task), task).execute(*xs, **ks)
  File "/home/powerd/sh-powerd-data/venv/lib/python3.8/site-packages/airflow/operators/python_operator.py", line 113, in execute
    return_value = self.execute_callable()
  File "/home/powerd/sh-powerd-data/venv/lib/python3.8/site-packages/airflow/operators/python_operator.py", line 118, in execute_callable
    return self.python_callable(*self.op_args, **self.op_kwargs)
  File "/home/powerd/sh-powerd-data/powerd-data/src/egon/data/datasets/power_plants/__init__.py", line 605, in insert_hydro_biomass
    insert_biomass_plants(scenario)
  File "/home/powerd/sh-powerd-data/powerd-data/src/egon/data/datasets/power_plants/__init__.py", line 294, in insert_biomass_plants
    mastr_loc = scale_prox2now(mastr_loc, target, level=level)
  File "/home/powerd/sh-powerd-data/powerd-data/src/egon/data/datasets/power_plants/__init__.py", line 143, in scale_prox2now
    .mul(target[df.Bundesland.values].values)
  File "/home/powerd/sh-powerd-data/venv/lib/python3.8/site-packages/pandas/core/series.py", line 966, in __getitem__
    return self._get_with(key)
  File "/home/powerd/sh-powerd-data/venv/lib/python3.8/site-packages/pandas/core/series.py", line 1006, in _get_with
    return self.loc[key]
  File "/home/powerd/sh-powerd-data/venv/lib/python3.8/site-packages/pandas/core/indexing.py", line 931, in __getitem__
    return self._getitem_axis(maybe_callable, axis=axis)
  File "/home/powerd/sh-powerd-data/venv/lib/python3.8/site-packages/pandas/core/indexing.py", line 1153, in _getitem_axis
    return self._getitem_iterable(key, axis=axis)
  File "/home/powerd/sh-powerd-data/venv/lib/python3.8/site-packages/pandas/core/indexing.py", line 1093, in _getitem_iterable
    keyarr, indexer = self._get_listlike_indexer(key, axis)
  File "/home/powerd/sh-powerd-data/venv/lib/python3.8/site-packages/pandas/core/indexing.py", line 1314, in _get_listlike_indexer
    self._validate_read_indexer(keyarr, indexer, axis)
  File "/home/powerd/sh-powerd-data/venv/lib/python3.8/site-packages/pandas/core/indexing.py", line 1374, in _validate_read_indexer
    raise KeyError(f"None of [{key}] are in the [{axis_name}]")

@CarlosEpia does this ring a bell? any ideas?

CarlosEpia commented 1 year ago

@ulfmueller this task only includes data for the eGon2035 scenario. Right now we can just mark it as successful and continue with the other tasks. I will take a deeper look to find the problem, but I think it is just related to a hard-coded scenario name.

ClaraBuettner commented 1 year ago

The same problem occurs for all power_plant tasks related to future power plants. I guess these tasks should be only executed if "eGon2035" or "eGon100RE" is in the CLI list of scenario names.