Error without a cause

Dear community,

Fairly often, when I add components, change values of a component, or edit other incremental things in my model, I get the generic message (bear with me, it’s quite long):

  File ~\.conda\envs\energysystem\Lib\site-packages\oemof\solph\processing.py:161 in set_result_index
    df_dict[k].index = result_index

  File ~\.conda\envs\energysystem\Lib\site-packages\pandas\core\generic.py:6218 in __setattr__
    return object.__setattr__(self, name, value)

  File properties.pyx:69 in pandas._libs.properties.AxisProperty.__set__

  File ~\.conda\envs\energysystem\Lib\site-packages\pandas\core\generic.py:767 in _set_axis
    self._mgr.set_axis(axis, labels)

  File ~\.conda\envs\energysystem\Lib\site-packages\pandas\core\internals\managers.py:227 in set_axis
    self._validate_set_axis(axis, new_labels)

  File ~\.conda\envs\energysystem\Lib\site-packages\pandas\core\internals\base.py:85 in _validate_set_axis
    raise ValueError(

ValueError: Length mismatch: Expected axis has 2 elements, new values have 100 elements


During handling of the above exception, another exception occurred:

Traceback (most recent call last):

  File ~\.conda\envs\energysystem\Lib\site-packages\oemof\solph\processing.py:165 in set_result_index
    df_dict[k].index = result_index

  File ~\.conda\envs\energysystem\Lib\site-packages\pandas\core\generic.py:6218 in __setattr__
    return object.__setattr__(self, name, value)

  File properties.pyx:69 in pandas._libs.properties.AxisProperty.__set__

  File ~\.conda\envs\energysystem\Lib\site-packages\pandas\core\generic.py:767 in _set_axis
    self._mgr.set_axis(axis, labels)

  File ~\.conda\envs\energysystem\Lib\site-packages\pandas\core\internals\managers.py:227 in set_axis
    self._validate_set_axis(axis, new_labels)

  File ~\.conda\envs\energysystem\Lib\site-packages\pandas\core\internals\base.py:85 in _validate_set_axis
    raise ValueError(

ValueError: Length mismatch: Expected axis has 1 elements, new values have 100 elements


During handling of the above exception, another exception occurred:

Traceback (most recent call last):

  File ~\.conda\envs\energysystem\Lib\site-packages\spyder_kernels\py3compat.py:356 in compat_exec
    exec(code, globals, locals)

  File c:\users\kaasjagerta\onedrive - tno\documents\thesis\models\functions_farm_energy_system\0130_of_test_withinput.py:367
    main()

  File c:\users\kaasjagerta\onedrive - tno\documents\thesis\models\functions_farm_energy_system\0130_of_test_withinput.py:246 in main
    energysystem.results["main"] = processing.results(model)

  File ~\.conda\envs\energysystem\Lib\site-packages\oemof\solph\processing.py:253 in results
    result = _extract_standard_model_result(

  File ~\.conda\envs\energysystem\Lib\site-packages\oemof\solph\processing.py:344 in _extract_standard_model_result
    set_result_index(df_dict, k, result_index)

  File ~\.conda\envs\energysystem\Lib\site-packages\oemof\solph\processing.py:172 in set_result_index
    str(e) + msg.format(k[0].label, k[1].label)

AttributeError: 'NoneType' object has no attribute 'label'

Any suggestions are welcome.

Hello @TimKaasjager,

thank you for bringing this up. It is tough to answer without much context.

I think, this forum might not be the right place for this. In case it really is “without cause”, i.e. it might be a software issue, it should be raised and resolved in oemof.solph rightaways. I suggest that you open a bug report issue in oemof.solph: Issues · oemof/oemof-solph · GitHub.

Would you be so kind and describe when exactly it did happen and what you changed in your model in that bug report?

Also, it would be very helpful if you provided information on the package versions you are using in the bug report. Also other python dependencies besides oemof.solph might be interesting.

Best regards,
Johannes

1 Like

Thanks for your reply, I have issued it!

For the reader: the Github issue documents what went wrong: Unclear error · Issue #1045 · oemof/oemof-solph · GitHub

1 Like