if self.compartments:
                for part in parts:
                    compartment = self.compartments.get(part.compartment, None)
                    if not compartment:
                        raise ValueError('Compartment "{}" must be defined'.format(part.compartment))