oemof / oemof-solph

A model generator for energy system modelling and optimisation (LP/MILP).
https://oemof.org
MIT License
297 stars 126 forks source link

v0.4.x TypeError on Transformer init with basic example #1048

Closed wo0lien closed 6 months ago

wo0lien commented 7 months ago

Describe the bug Implementing a Transformer on 0.4.x ( tested on 0.4.4 and 0.4.5) raises a TypeError: __init__() got an unexpected keyword argument 'conversion_factors'

To Reproduce Code :

from oemof import solph

print(solph.__version__)

bgas = solph.Bus(label="natural_gas")
bel = solph.Bus(label="electricity")

tr = solph.Transformer(
        label="pp_gas",
        inputs={bgas: solph.Flow()},
        outputs={bel: solph.Flow(nominal_value=10e10, variable_costs=50)},
        conversion_factors={bel: 0.58, bgas: 0.6},
)

Desktop (please complete the following information):

p-snft commented 7 months ago

Hi @wo0lien, thanks for bringing this up. Version v0.4 of solph requires v0.4 of network, bus it does not define an upper bound for the version. You can pip install oemof.network==0.4.0 to workaround this problem.

wo0lien commented 6 months ago

Thank you for the reply. That works adding the oemof.network==0.4.0 to the requirements. Hope this thread is going to help anyone willing to work with this version.