Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postprocessing of esys fails #19

Open
nesnoj opened this issue Jun 5, 2024 · 0 comments
Open

Postprocessing of esys fails #19

nesnoj opened this issue Jun 5, 2024 · 0 comments
Labels
bug 🐞 Something isn't working

Comments

@nesnoj
Copy link
Member

nesnoj commented Jun 5, 2024

(HEAD: 5604829, oemof-solph version 0.5.2.dev1)

When running snakemake -j1 postprocessed_esys_appdata optimization is successful but postprocessing fails at this point:

es.results = processing.results(m)

since timeindex differs here:

(Pdb) result_index
DatetimeIndex(['2019-01-01 00:00:00', '2019-01-01 01:00:00',
               '2019-01-01 02:00:00'],
              dtype='datetime64[ns]', freq='H')
(Pdb) df_dict[k]
variable_name  flow
timestep           
0               0.0
1               0.0
2               0.0
3               NaN

Full traceback:

Optimal objective 0 - 0 iterations time 0.002, Presolve 0.00
Total time (CPU seconds):       0.00   (Wallclock seconds):       0.01

INFO - Optimization successful...
INFO - Solved the model. Elapsed time: 0:00:00.063417
INFO - Model solved. Collecting results.
Traceback (most recent call last):
  File "/darth/vader/miniconda3/envs/apipe_py310/lib/python3.10/site-packages/oemof/solph/processing.py", line 162, in set_result_index
    df_dict[k].index = result_index
  File "/darth/vader/.local/lib/python3.10/site-packages/pandas/core/generic.py", line 6218, in __setattr__
    return object.__setattr__(self, name, value)
  File "properties.pyx", line 69, in pandas._libs.properties.AxisProperty.__set__
  File "/darth/vader/.local/lib/python3.10/site-packages/pandas/core/generic.py", line 767, in _set_axis
    self._mgr.set_axis(axis, labels)
  File "/darth/vader/.local/lib/python3.10/site-packages/pandas/core/internals/managers.py", line 227, in set_axis
    self._validate_set_axis(axis, new_labels)
  File "/darth/vader/.local/lib/python3.10/site-packages/pandas/core/internals/base.py", line 85, in _validate_set_axis
    raise ValueError(
ValueError: Length mismatch: Expected axis has 5 elements, new values have 3 elements

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/darth/vader/miniconda3/envs/apipe_py310/lib/python3.10/site-packages/oemof/solph/processing.py", line 166, in set_result_index
    df_dict[k].index = result_index
  File "/darth/vader/.local/lib/python3.10/site-packages/pandas/core/generic.py", line 6218, in __setattr__
    return object.__setattr__(self, name, value)
  File "properties.pyx", line 69, in pandas._libs.properties.AxisProperty.__set__
  File "/darth/vader/.local/lib/python3.10/site-packages/pandas/core/generic.py", line 767, in _set_axis
    self._mgr.set_axis(axis, labels)
  File "/darth/vader/.local/lib/python3.10/site-packages/pandas/core/internals/managers.py", line 227, in set_axis
    self._validate_set_axis(axis, new_labels)
  File "/darth/vader/.local/lib/python3.10/site-packages/pandas/core/internals/base.py", line 85, in _validate_set_axis
    raise ValueError(
ValueError: Length mismatch: Expected axis has 4 elements, new values have 3 elements

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/darth/vader/dummy/path/apipe/apipe/esys/scripts/optimize.py", line 326, in <module>
    es.results = processing.results(m)
  File "/darth/vader/miniconda3/envs/apipe_py310/lib/python3.10/site-packages/oemof/solph/processing.py", line 254, in results
    result = _extract_standard_model_result(
  File "/darth/vader/miniconda3/envs/apipe_py310/lib/python3.10/site-packages/oemof/solph/processing.py", line 345, in _extract_standard_model_result
    set_result_index(df_dict, k, result_index)
  File "/darth/vader/miniconda3/envs/apipe_py310/lib/python3.10/site-packages/oemof/solph/processing.py", line 173, in set_result_index
    str(e) + msg.format(k[0].label, k[1].label)
AttributeError: 'NoneType' object has no attribute 'label'
@nesnoj nesnoj added the bug 🐞 Something isn't working label Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant