oemof / DHNx

District heating system optimisation and simulation models
MIT License
27 stars 12 forks source link

Implement workaround for oemof.solph 0.5.1 compatibility #134

Open jnettels opened 11 months ago

jnettels commented 11 months ago

Version 0.5.1 of oemof.solph introduced the (experimental) feature of supporting multi-period investments: https://oemof-solph.readthedocs.io/en/stable/changelog.html#v0-5-1-august-31st-2023

The update changes the way certain objects with a time index are referenced, since the index now consists of a (periods, timesteps) tuple. This breaks the DHNx code in a couple of places.

Add a period=0 to lines where the time index is called, in a try-except statement that retains compatibility with oemof.solph 0.5.0

Fixes #133.