I work with oemof and want to receive dual variables for 3 busses. Since a while I got a warning:
16:51:06-WARNING-Reassigning the non-component attribute rc
on block (model).Model with a new Component
with type <class ‘pyomo.core.base.suffix.Suffix’>.
This is usually indicative of a modelling error.
To avoid this warning, explicitly delete the attribute:
The model can be solved. But I don’t know why this warning appears. Besides I just have one time in the Code, when I create it.
and later I use 3 functions to store the duals:
def get_el_prices_from_duals(om, datetime_index):
el_prices_list =  constr = [c for c in om.component_objects(po.Constraint, active = True) if c.name == "Bus.balance"] # duals for el el_prices_list = [om.dual[constr[index]] for index in constr if index.label == "b_el"] el_prices = pd.DataFrame(data= el_prices_list, index= datetime_index, columns = ["electricity price"]) return el_prices
Has anybody an idea?
It’s not solved by deleting like proposed.
Thank you !
Best regards, C.