Commits (12)
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -33,7 +33,7 @@ from ..optimisation.core import OptObject
from ..time import TimeUnit
from ...energy.energy_nodes import EnergyNode
from ...actor.actor import Actor
from ...energy.units.conversion_units import ConversionUnit
from ...energy.units.energy_units import AssemblyUnit
from ..optimisation.elements import Constraint, DynamicConstraint
from ..optimisation.elements import Objective
from ..optimisation.elements import Quantity
......@@ -454,11 +454,11 @@ def check_if_unit_could_have_parent(unit):
parent_name = parent['name']
if parent_name not in attributes:
if not isinstance(unit, (ConversionUnit, Actor)):
if not isinstance(unit, (AssemblyUnit, Actor)):
warnings.warn('The unit {} seems to have as parent {} '
'which was not declared as '
'parent.'.format(unit.name, parent_name))
elif isinstance(unit, ConversionUnit):
elif isinstance(unit, AssemblyUnit):
prod_names = [prod.name for prod in unit.prod_units]
cons_name = [cons.name for cons in unit.cons_units]
if (parent_name in prod_names) or (parent_name in