oemof / DHNx

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

network.optimize_investment(invest_options=invest_opt) #136

Closed BishalMan closed 1 month ago

BishalMan commented 11 months ago

Hi all, I am here with the issue related to the optimization. I tried to run the examples provided, and got the KeyError like this: 'Index \'("<dhnx.optimization.oemof_heatpipe.HeatPipeline: Label(tag1=\'infrastructure\', tag2=\'heat\', tag3=\'pipe-typ-A\', tag4=\'forks-2-forks-3\')>", "<oemof.solph.buses._bus.Bus: Label(tag1=\'infrastructure\', tag2=\'heat\', tag3=\'bus\', tag4=\'forks-3\')>")\' is not valid for indexed component \'InvestmentFlowBlock.invest\'' In every optimization examples where network.optimize_investment(invest_options=invest_opt) commad is to be run, I am getting the same kind of error. Can anyone check if these examples (introduction.py,minimal_network.py,invest_with_existing.py,..) are still running or suggest me some ideas if one encountered similar issue before? It would be super helpful. Thanks! image

Regards, Bishal

joroeder commented 10 months ago

Dear Bishal, thank you for your issue. At the moment due to the latest oemof-solph major release, DHNx needs to be updated and released as well. In the meanwhile, please try to use the dev branch or install an oemf-solph version < 0.5, so 4.5 for example.

okocak95 commented 9 months ago

Hi @joroeder

when i execute network.optimize_investment(invest_options=invest_opt)

i get the following error: TypeError: Node.init() got an unexpected keyword argument 'heat_loss_factor'

Does this also has something to do with the latest update of oemof-solph?

Best regards, Orcun

p-snft commented 1 month ago

It's been a while, but I hope the answer still helps: This was due to an update of oemof.network (and rather sloppy handling of keyword arguments here at DHNx). It should be fixed in the dev branch of DHNx.