No attribute _external_constraint_list in EnergyNode
Summary
When running a simple use case (LNCMI notebook), the following error occurs :
AttributeError Traceback (most recent call last)
D:\00 - Eco-SESA\02 - Outils\OMEGAlpes\omegalpes_examples\notebooks\python_scripts\NB_LNCMI.py in updateData(click)
292 lncmi_case(elec2heat_ratio=ELEC_TO_HEAT_RATIO, capacity=CAPA_STORAGE,
293 cop_hp=COP,pmax_elec_hp=P_MAX_HP,
--> 294 storage_soc_0=SOC_0_STORAGE, pmin_recovery=PMIN_RECOVERY)
295
296 display(runPlotButton)
D:\00 - Eco-SESA\02 - Outils\OMEGAlpes\omegalpes_examples\notebooks\python_scripts\NB_LNCMI.py in lncmi_case(elec2heat_ratio, capacity, cop_hp, pmax_elec_hp, storage_soc_0, pmin_recovery)
172 heat_node_lncmi.export_min = \
173 ExtDynConstraint(name='pmin_recovery', exp_t=pmin_rec_cst_exp,
--> 174 t_range='for t in time.I', parent=heat_node_lncmi)
175 # OBJECTIVE CREATION
176 # Minimizing the part of the heat load covered by the heat production plant
d:\00 - eco-sesa\02 - outils\omegalpes\dev_omegalpes\omegalpes\general\optimisation\elements.py in __init__(self, exp_t, t_range, name, active, description, parent)
646 ExternalConstraint.__init__(self, exp='', name=name,
647 description=description,
--> 648 active=active, parent=parent)
649 DynamicConstraint.__init__(self, exp_t=exp_t, t_range=t_range,
650 name=name,
d:\00 - eco-sesa\02 - outils\omegalpes\dev_omegalpes\omegalpes\general\optimisation\elements.py in __init__(self, exp, name, description, active, parent)
600 warnings.warn(deprecated_msg, DeprecationWarning)
601
--> 602 self._add_ext_cst_list()
603
604 def _add_ext_cst_list(self):
d:\00 - eco-sesa\02 - outils\omegalpes\dev_omegalpes\omegalpes\general\optimisation\elements.py in _add_ext_cst_list(self)
604 def _add_ext_cst_list(self):
605 if self.parent:
--> 606 if self not in self.parent._external_constraints_list:
607 self.parent._external_constraints_list.append(self)
608 else:
AttributeError: 'EnergyNode' object has no attribute '_external_constraints_list'
Steps to reproduce
Run the Notebook LNCMI in examples/notebooks
How to fix it?
Inspect the last commits in elements to check the previous version of OMEGAlpes with which it was working properly to understand the bug.