diff --git a/src/ifcopenshell-python/ifcopenshell/express/rules/IFC2X3.py b/src/ifcopenshell-python/ifcopenshell/express/rules/IFC2X3.py index bdcf863e48..da801d204f 100644 --- a/src/ifcopenshell-python/ifcopenshell/express/rules/IFC2X3.py +++ b/src/ifcopenshell-python/ifcopenshell/express/rules/IFC2X3.py @@ -44,10 +44,10 @@ unknown = 'UNKNOWN' def usedin(inst, ref_name): if inst is None: return [] - (_, __, attr) = ref_name.split('.') + _, __, attr = ref_name.split('.') def filter(): - for (ref, attr_idx) in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True): + for ref, attr_idx in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True): if ref.wrapped_data.get_attribute_names()[attr_idx].lower() == attr: yield ref return list(filter()) @@ -4618,7 +4618,7 @@ class IfcConstructionMaterialResource_WR2: @staticmethod def __call__(self): - assert (not exists(lambda : express_getitem(express_getattr(self, 'ResourceOf', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or express_getattr(express_getitem(express_getattr(self, 'ResourceOf', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjectsType', INDETERMINATE) == express_getattr(IfcObjectTypeEnum, 'PRODUCT', INDETERMINATE)) is not False + assert (not exists(lambda: express_getitem(express_getattr(self, 'ResourceOf', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or express_getattr(express_getitem(express_getattr(self, 'ResourceOf', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjectsType', INDETERMINATE) == express_getattr(IfcObjectTypeEnum, 'PRODUCT', INDETERMINATE)) is not False class IfcConstructionProductResource_WR1: SCOPE = 'entity' @@ -4636,7 +4636,7 @@ class IfcConstructionProductResource_WR2: @staticmethod def __call__(self): - assert (not exists(lambda : express_getitem(express_getattr(self, 'ResourceOf', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or express_getattr(express_getitem(express_getattr(self, 'ResourceOf', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjectsType', INDETERMINATE) == express_getattr(IfcObjectTypeEnum, 'PRODUCT', INDETERMINATE)) is not False + assert (not exists(lambda: express_getitem(express_getattr(self, 'ResourceOf', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or express_getattr(express_getitem(express_getattr(self, 'ResourceOf', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjectsType', INDETERMINATE) == express_getattr(IfcObjectTypeEnum, 'PRODUCT', INDETERMINATE)) is not False class IfcCooledBeamType_WR1: SCOPE = 'entity' @@ -4876,7 +4876,7 @@ class IfcDocumentReference_WR1: def __call__(self): name = express_getattr(self, 'Name', INDETERMINATE) referencetodocument = express_getattr(self, 'ReferenceToDocument', INDETERMINATE) - assert exists(name) ^ exists(lambda : express_getitem(referencetodocument, 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) is not False + assert exists(name) ^ exists(lambda: express_getitem(referencetodocument, 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) is not False class IfcDoorLiningProperties_WR31: SCOPE = 'entity' @@ -4929,7 +4929,7 @@ class IfcDoorLiningProperties_WR35: @staticmethod def __call__(self): - assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and 'ifc2x3.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE))) is not False + assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and 'ifc2x3.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE))) is not False class IfcDoorPanelProperties_WR31: SCOPE = 'entity' @@ -4938,7 +4938,7 @@ class IfcDoorPanelProperties_WR31: @staticmethod def __call__(self): - assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and 'ifc2x3.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE))) is not False + assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and 'ifc2x3.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE))) is not False class IfcDraughtingPreDefinedColour_WR31: SCOPE = 'entity' @@ -7195,7 +7195,7 @@ class IfcTypeProduct_WR41: @staticmethod def __call__(self): - assert (not exists(lambda : express_getitem(express_getattr(self, 'ObjectTypeOf', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'ObjectTypeOf', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc2x3.ifcproduct' in typeof(temp)]) == 0) is not False + assert (not exists(lambda: express_getitem(express_getattr(self, 'ObjectTypeOf', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'ObjectTypeOf', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc2x3.ifcproduct' in typeof(temp)]) == 0) is not False class IfcUShapeProfileDef_WR21: SCOPE = 'entity' @@ -7331,7 +7331,7 @@ class IfcWindowLiningProperties_WR34: @staticmethod def __call__(self): - assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and 'ifc2x3.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE))) is not False + assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and 'ifc2x3.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE))) is not False class IfcWorkControl_WR1: SCOPE = 'entity' diff --git a/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4.py b/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4.py index 7b931af2e9..169b72f531 100644 --- a/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4.py +++ b/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4.py @@ -44,10 +44,10 @@ unknown = 'UNKNOWN' def usedin(inst, ref_name): if inst is None: return [] - (_, __, attr) = ref_name.split('.') + _, __, attr = ref_name.split('.') def filter(): - for (ref, attr_idx) in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True): + for ref, attr_idx in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True): if ref.wrapped_data.get_attribute_names()[attr_idx].lower() == attr: yield ref return list(filter()) @@ -6565,7 +6565,7 @@ class IfcDoorLiningProperties_WR35: @staticmethod def __call__(self): - assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False + assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False class IfcDoorPanelProperties_ApplicableToType: SCOPE = 'entity' @@ -6574,7 +6574,7 @@ class IfcDoorPanelProperties_ApplicableToType: @staticmethod def __call__(self): - assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False + assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False class IfcDoorType_CorrectPredefinedType: SCOPE = 'entity' @@ -10952,7 +10952,7 @@ class IfcTypeProduct_ApplicableOccurrence: @staticmethod def __call__(self): - assert (not exists(lambda : express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc4.ifcproduct' in typeof(temp)]) == 0) is not False + assert (not exists(lambda: express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc4.ifcproduct' in typeof(temp)]) == 0) is not False class IfcUShapeProfileDef_ValidFlangeThickness: SCOPE = 'entity' @@ -11258,7 +11258,7 @@ class IfcWindowLiningProperties_WR34: @staticmethod def __call__(self): - assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False + assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False class IfcWindowPanelProperties_ApplicableToType: SCOPE = 'entity' @@ -11267,7 +11267,7 @@ class IfcWindowPanelProperties_ApplicableToType: @staticmethod def __call__(self): - assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False + assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False class IfcWindowType_CorrectPredefinedType: SCOPE = 'entity' diff --git a/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X1.py b/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X1.py index b07e9a2234..a73d67d7e0 100644 --- a/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X1.py +++ b/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X1.py @@ -44,10 +44,10 @@ unknown = 'UNKNOWN' def usedin(inst, ref_name): if inst is None: return [] - (_, __, attr) = ref_name.split('.') + _, __, attr = ref_name.split('.') def filter(): - for (ref, attr_idx) in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True): + for ref, attr_idx in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True): if ref.wrapped_data.get_attribute_names()[attr_idx].lower() == attr: yield ref return list(filter()) @@ -6656,7 +6656,7 @@ class IfcDoorLiningProperties_WR35: @staticmethod def __call__(self): - assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x1.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x1.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False + assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x1.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x1.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False class IfcDoorPanelProperties_ApplicableToType: SCOPE = 'entity' @@ -6665,7 +6665,7 @@ class IfcDoorPanelProperties_ApplicableToType: @staticmethod def __call__(self): - assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x1.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x1.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False + assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x1.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x1.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False class IfcDoorType_CorrectPredefinedType: SCOPE = 'entity' @@ -11103,7 +11103,7 @@ class IfcTypeProduct_ApplicableOccurrence: @staticmethod def __call__(self): - assert (not exists(lambda : express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc4x1.ifcproduct' in typeof(temp)]) == 0) is not False + assert (not exists(lambda: express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc4x1.ifcproduct' in typeof(temp)]) == 0) is not False class IfcUShapeProfileDef_ValidFlangeThickness: SCOPE = 'entity' @@ -11409,7 +11409,7 @@ class IfcWindowLiningProperties_WR34: @staticmethod def __call__(self): - assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x1.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x1.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False + assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x1.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x1.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False class IfcWindowPanelProperties_ApplicableToType: SCOPE = 'entity' @@ -11418,7 +11418,7 @@ class IfcWindowPanelProperties_ApplicableToType: @staticmethod def __call__(self): - assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x1.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x1.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False + assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x1.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x1.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False class IfcWindowType_CorrectPredefinedType: SCOPE = 'entity' diff --git a/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X2.py b/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X2.py index 07f6a261e7..7b8c8513f0 100644 --- a/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X2.py +++ b/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X2.py @@ -44,10 +44,10 @@ unknown = 'UNKNOWN' def usedin(inst, ref_name): if inst is None: return [] - (_, __, attr) = ref_name.split('.') + _, __, attr = ref_name.split('.') def filter(): - for (ref, attr_idx) in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True): + for ref, attr_idx in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True): if ref.wrapped_data.get_attribute_names()[attr_idx].lower() == attr: yield ref return list(filter()) @@ -6877,7 +6877,7 @@ class IfcDoorLiningProperties_WR35: @staticmethod def __call__(self): - assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x2.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x2.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False + assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x2.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x2.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False class IfcDoorPanelProperties_ApplicableToType: SCOPE = 'entity' @@ -6886,7 +6886,7 @@ class IfcDoorPanelProperties_ApplicableToType: @staticmethod def __call__(self): - assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x2.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x2.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False + assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x2.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x2.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False class IfcDoorType_CorrectPredefinedType: SCOPE = 'entity' @@ -11365,7 +11365,7 @@ class IfcTypeProduct_ApplicableOccurrence: @staticmethod def __call__(self): - assert (not exists(lambda : express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc4x2.ifcproduct' in typeof(temp)]) == 0) is not False + assert (not exists(lambda: express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc4x2.ifcproduct' in typeof(temp)]) == 0) is not False class IfcUShapeProfileDef_ValidFlangeThickness: SCOPE = 'entity' @@ -11701,7 +11701,7 @@ class IfcWindowLiningProperties_WR34: @staticmethod def __call__(self): - assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x2.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x2.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False + assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x2.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x2.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False class IfcWindowPanelProperties_ApplicableToType: SCOPE = 'entity' @@ -11710,7 +11710,7 @@ class IfcWindowPanelProperties_ApplicableToType: @staticmethod def __call__(self): - assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x2.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x2.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False + assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x2.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x2.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False class IfcWindowType_CorrectPredefinedType: SCOPE = 'entity' diff --git a/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X3_ADD2.py b/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X3_ADD2.py index 1645ddf8f5..9b2f43bc34 100644 --- a/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X3_ADD2.py +++ b/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X3_ADD2.py @@ -44,10 +44,10 @@ unknown = 'UNKNOWN' def usedin(inst, ref_name): if inst is None: return [] - (_, __, attr) = ref_name.split('.') + _, __, attr = ref_name.split('.') def filter(): - for (ref, attr_idx) in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True): + for ref, attr_idx in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True): if ref.wrapped_data.get_attribute_names()[attr_idx].lower() == attr: yield ref return list(filter()) @@ -7650,7 +7650,7 @@ class IfcDoorLiningProperties_WR35: @staticmethod def __call__(self): - assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and 'ifc4x3_add2.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE))) is not False + assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and 'ifc4x3_add2.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE))) is not False class IfcDoorPanelProperties_ApplicableToType: SCOPE = 'entity' @@ -7659,7 +7659,7 @@ class IfcDoorPanelProperties_ApplicableToType: @staticmethod def __call__(self): - assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and 'ifc4x3_add2.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE))) is not False + assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and 'ifc4x3_add2.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE))) is not False class IfcDoorType_CorrectPredefinedType: SCOPE = 'entity' @@ -12698,7 +12698,7 @@ class IfcTypeProduct_ApplicableOccurrence: @staticmethod def __call__(self): - assert (not exists(lambda : express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc4x3_add2.ifcproduct' in typeof(temp)]) == 0) is not False + assert (not exists(lambda: express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc4x3_add2.ifcproduct' in typeof(temp)]) == 0) is not False class IfcUShapeProfileDef_ValidFlangeThickness: SCOPE = 'entity' @@ -13075,7 +13075,7 @@ class IfcWindowLiningProperties_WR34: @staticmethod def __call__(self): - assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and 'ifc4x3_add2.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE))) is not False + assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and 'ifc4x3_add2.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE))) is not False class IfcWindowPanelProperties_ApplicableToType: SCOPE = 'entity' @@ -13084,7 +13084,7 @@ class IfcWindowPanelProperties_ApplicableToType: @staticmethod def __call__(self): - assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and 'ifc4x3_add2.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE))) is not False + assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and 'ifc4x3_add2.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE))) is not False class IfcWindowType_CorrectPredefinedType: SCOPE = 'entity' diff --git a/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X3_RC1.py b/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X3_RC1.py index ae0ee5bce1..0c029cf61b 100644 --- a/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X3_RC1.py +++ b/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X3_RC1.py @@ -44,10 +44,10 @@ unknown = 'UNKNOWN' def usedin(inst, ref_name): if inst is None: return [] - (_, __, attr) = ref_name.split('.') + _, __, attr = ref_name.split('.') def filter(): - for (ref, attr_idx) in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True): + for ref, attr_idx in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True): if ref.wrapped_data.get_attribute_names()[attr_idx].lower() == attr: yield ref return list(filter()) @@ -7549,7 +7549,7 @@ class IfcDoorLiningProperties_WR35: @staticmethod def __call__(self): - assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc1.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc1.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False + assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc1.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc1.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False class IfcDoorPanelProperties_ApplicableToType: SCOPE = 'entity' @@ -7558,7 +7558,7 @@ class IfcDoorPanelProperties_ApplicableToType: @staticmethod def __call__(self): - assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc1.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc1.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False + assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc1.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc1.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False class IfcDoorType_CorrectPredefinedType: SCOPE = 'entity' @@ -12384,7 +12384,7 @@ class IfcTypeProduct_ApplicableOccurrence: @staticmethod def __call__(self): - assert (not exists(lambda : express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc4x3_rc1.ifcproduct' in typeof(temp)]) == 0) is not False + assert (not exists(lambda: express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc4x3_rc1.ifcproduct' in typeof(temp)]) == 0) is not False class IfcUShapeProfileDef_ValidFlangeThickness: SCOPE = 'entity' @@ -12720,7 +12720,7 @@ class IfcWindowLiningProperties_WR34: @staticmethod def __call__(self): - assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc1.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc1.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False + assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc1.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc1.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False class IfcWindowPanelProperties_ApplicableToType: SCOPE = 'entity' @@ -12729,7 +12729,7 @@ class IfcWindowPanelProperties_ApplicableToType: @staticmethod def __call__(self): - assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc1.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc1.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False + assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc1.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc1.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False class IfcWindowType_CorrectPredefinedType: SCOPE = 'entity' diff --git a/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X3_RC2.py b/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X3_RC2.py index 36329b4af0..c24f900294 100644 --- a/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X3_RC2.py +++ b/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X3_RC2.py @@ -44,10 +44,10 @@ unknown = 'UNKNOWN' def usedin(inst, ref_name): if inst is None: return [] - (_, __, attr) = ref_name.split('.') + _, __, attr = ref_name.split('.') def filter(): - for (ref, attr_idx) in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True): + for ref, attr_idx in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True): if ref.wrapped_data.get_attribute_names()[attr_idx].lower() == attr: yield ref return list(filter()) @@ -7637,7 +7637,7 @@ class IfcDoorLiningProperties_WR35: @staticmethod def __call__(self): - assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc2.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc2.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False + assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc2.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc2.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False class IfcDoorPanelProperties_ApplicableToType: SCOPE = 'entity' @@ -7646,7 +7646,7 @@ class IfcDoorPanelProperties_ApplicableToType: @staticmethod def __call__(self): - assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc2.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc2.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False + assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc2.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc2.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False class IfcDoorType_CorrectPredefinedType: SCOPE = 'entity' @@ -12479,7 +12479,7 @@ class IfcTypeProduct_ApplicableOccurrence: @staticmethod def __call__(self): - assert (not exists(lambda : express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc4x3_rc2.ifcproduct' in typeof(temp)]) == 0) is not False + assert (not exists(lambda: express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc4x3_rc2.ifcproduct' in typeof(temp)]) == 0) is not False class IfcUShapeProfileDef_ValidFlangeThickness: SCOPE = 'entity' @@ -12815,7 +12815,7 @@ class IfcWindowLiningProperties_WR34: @staticmethod def __call__(self): - assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc2.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc2.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False + assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc2.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc2.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False class IfcWindowPanelProperties_ApplicableToType: SCOPE = 'entity' @@ -12824,7 +12824,7 @@ class IfcWindowPanelProperties_ApplicableToType: @staticmethod def __call__(self): - assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc2.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc2.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False + assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc2.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc2.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False class IfcWindowType_CorrectPredefinedType: SCOPE = 'entity' diff --git a/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X3_RC3.py b/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X3_RC3.py index f04cb77e97..8ff30987bd 100644 --- a/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X3_RC3.py +++ b/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X3_RC3.py @@ -44,10 +44,10 @@ unknown = 'UNKNOWN' def usedin(inst, ref_name): if inst is None: return [] - (_, __, attr) = ref_name.split('.') + _, __, attr = ref_name.split('.') def filter(): - for (ref, attr_idx) in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True): + for ref, attr_idx in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True): if ref.wrapped_data.get_attribute_names()[attr_idx].lower() == attr: yield ref return list(filter()) @@ -246,7 +246,7 @@ notdefined = IfcAlarmTypeEnum.NOTDEFINED IfcAlignmentCantSegmentTypeEnum = enum_namespace() constantcant = IfcAlignmentCantSegmentTypeEnum.CONSTANTCANT lineartransition = IfcAlignmentCantSegmentTypeEnum.LINEARTRANSITION -helmertcurve = IfcAlignmentCantSegmentTypeEnum.HELMERTCURVE +biquadraticparabola = IfcAlignmentCantSegmentTypeEnum.BIQUADRATICPARABOLA blosscurve = IfcAlignmentCantSegmentTypeEnum.BLOSSCURVE cosinecurve = IfcAlignmentCantSegmentTypeEnum.COSINECURVE sinecurve = IfcAlignmentCantSegmentTypeEnum.SINECURVE @@ -256,7 +256,7 @@ line = IfcAlignmentHorizontalSegmentTypeEnum.LINE circulararc = IfcAlignmentHorizontalSegmentTypeEnum.CIRCULARARC clothoid = IfcAlignmentHorizontalSegmentTypeEnum.CLOTHOID cubic = IfcAlignmentHorizontalSegmentTypeEnum.CUBIC -helmertcurve = IfcAlignmentHorizontalSegmentTypeEnum.HELMERTCURVE +biquadraticparabola = IfcAlignmentHorizontalSegmentTypeEnum.BIQUADRATICPARABOLA blosscurve = IfcAlignmentHorizontalSegmentTypeEnum.BLOSSCURVE cubicspiral = IfcAlignmentHorizontalSegmentTypeEnum.CUBICSPIRAL cosinecurve = IfcAlignmentHorizontalSegmentTypeEnum.COSINECURVE @@ -802,9 +802,9 @@ soundabsorption = IfcDiscreteAccessoryTypeEnum.SOUNDABSORPTION pointmachinemountingdevice = IfcDiscreteAccessoryTypeEnum.POINTMACHINEMOUNTINGDEVICE point_machine_locking_device = IfcDiscreteAccessoryTypeEnum.POINT_MACHINE_LOCKING_DEVICE rail_mechanical_equipment = IfcDiscreteAccessoryTypeEnum.RAIL_MECHANICAL_EQUIPMENT -birdprotection = IfcDiscreteAccessoryTypeEnum.BIRDPROTECTION userdefined = IfcDiscreteAccessoryTypeEnum.USERDEFINED notdefined = IfcDiscreteAccessoryTypeEnum.NOTDEFINED +birdprotection = IfcDiscreteAccessoryTypeEnum.BIRDPROTECTION IfcDistributionBoardTypeEnum = enum_namespace() switchboard = IfcDistributionBoardTypeEnum.SWITCHBOARD consumerunit = IfcDistributionBoardTypeEnum.CONSUMERUNIT @@ -1418,7 +1418,7 @@ logicalnotor = IfcLogicalOperatorEnum.LOGICALNOTOR IfcMarineFacilityTypeEnum = enum_namespace() canal = IfcMarineFacilityTypeEnum.CANAL waterwayshiplift = IfcMarineFacilityTypeEnum.WATERWAYSHIPLIFT -revetment = IfcMarineFacilityTypeEnum.REVETMENT +embankment = IfcMarineFacilityTypeEnum.EMBANKMENT launchrecovery = IfcMarineFacilityTypeEnum.LAUNCHRECOVERY marinedefence = IfcMarineFacilityTypeEnum.MARINEDEFENCE hydrolift = IfcMarineFacilityTypeEnum.HYDROLIFT @@ -1587,11 +1587,6 @@ dataoutlet = IfcOutletTypeEnum.DATAOUTLET telephoneoutlet = IfcOutletTypeEnum.TELEPHONEOUTLET userdefined = IfcOutletTypeEnum.USERDEFINED notdefined = IfcOutletTypeEnum.NOTDEFINED -IfcPavementTypeEnum = enum_namespace() -flexible = IfcPavementTypeEnum.FLEXIBLE -rigid = IfcPavementTypeEnum.RIGID -userdefined = IfcPavementTypeEnum.USERDEFINED -notdefined = IfcPavementTypeEnum.NOTDEFINED IfcPerformanceHistoryTypeEnum = enum_namespace() userdefined = IfcPerformanceHistoryTypeEnum.USERDEFINED notdefined = IfcPerformanceHistoryTypeEnum.NOTDEFINED @@ -2073,7 +2068,6 @@ parking = IfcSpaceTypeEnum.PARKING gfa = IfcSpaceTypeEnum.GFA internal = IfcSpaceTypeEnum.INTERNAL external = IfcSpaceTypeEnum.EXTERNAL -berth = IfcSpaceTypeEnum.BERTH userdefined = IfcSpaceTypeEnum.USERDEFINED notdefined = IfcSpaceTypeEnum.NOTDEFINED IfcSpatialZoneTypeEnum = enum_namespace() @@ -3126,9 +3120,6 @@ def IfcDirection(*args, **kwargs): def IfcDirectrixCurveSweptAreaSolid(*args, **kwargs): return ifcopenshell.create_entity('IfcDirectrixCurveSweptAreaSolid', 'IFC4X3_RC3', *args, **kwargs) -def IfcDirectrixDerivedReferenceSweptAreaSolid(*args, **kwargs): - return ifcopenshell.create_entity('IfcDirectrixDerivedReferenceSweptAreaSolid', 'IFC4X3_RC3', *args, **kwargs) - def IfcDirectrixDistanceSweptAreaSolid(*args, **kwargs): return ifcopenshell.create_entity('IfcDirectrixDistanceSweptAreaSolid', 'IFC4X3_RC3', *args, **kwargs) @@ -7670,7 +7661,7 @@ class IfcDoorLiningProperties_WR35: @staticmethod def __call__(self): - assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc3.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc3.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False + assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc3.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc3.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False class IfcDoorPanelProperties_ApplicableToType: SCOPE = 'entity' @@ -7679,7 +7670,7 @@ class IfcDoorPanelProperties_ApplicableToType: @staticmethod def __call__(self): - assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc3.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc3.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False + assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc3.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc3.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False class IfcDoorType_CorrectPredefinedType: SCOPE = 'entity' @@ -8276,7 +8267,7 @@ class IfcFacilityPart_CorrectPredefinedType: @staticmethod def __call__(self): predefinedtype = express_getattr(self, 'PredefinedType', INDETERMINATE) - assert ((predefinedtype != express_getattr(IfcBridgePartTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype != express_getattr(IfcRailwayPartTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype != express_getattr(IfcRoadPartTypeEnum, 'USERDEFINED', INDETERMINATE) or (predefinedtype != express_getattr(IfcMarinePartTypeEnum, 'USERDEFINED', INDETERMINATE)) or (predefinedtype != express_getattr(IfcFacilityPartCommonTypeEnum, 'USERDEFINED', INDETERMINATE))) or ((predefinedtype == express_getattr(IfcBridgePartTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype == express_getattr(IfcRailwayPartTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype == express_getattr(IfcRoadPartTypeEnum, 'USERDEFINED', INDETERMINATE) or (predefinedtype == express_getattr(IfcMarinePartTypeEnum, 'USERDEFINED', INDETERMINATE)) or (predefinedtype == express_getattr(IfcFacilityPartCommonTypeEnum, 'USERDEFINED', INDETERMINATE))) and exists(express_getattr(self, 'ObjectType', INDETERMINATE)))) is not False + assert (not exists(predefinedtype) or (predefinedtype != express_getattr(IfcBridgePartTypeEnum, 'USERDEFINED', INDETERMINATE) and predefinedtype != express_getattr(IfcRailwayPartTypeEnum, 'USERDEFINED', INDETERMINATE) and (predefinedtype != express_getattr(IfcRoadPartTypeEnum, 'USERDEFINED', INDETERMINATE)) and (predefinedtype != express_getattr(IfcMarinePartTypeEnum, 'USERDEFINED', INDETERMINATE)) and (predefinedtype != express_getattr(IfcFacilityPartCommonTypeEnum, 'USERDEFINED', INDETERMINATE))) or ((predefinedtype == express_getattr(IfcBridgePartTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype == express_getattr(IfcRailwayPartTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype == express_getattr(IfcRoadPartTypeEnum, 'USERDEFINED', INDETERMINATE) or (predefinedtype == express_getattr(IfcMarinePartTypeEnum, 'USERDEFINED', INDETERMINATE)) or (predefinedtype == express_getattr(IfcFacilityPartCommonTypeEnum, 'USERDEFINED', INDETERMINATE))) and exists(express_getattr(self, 'ObjectType', INDETERMINATE)))) is not False class IfcFan_CorrectPredefinedType: SCOPE = 'entity' @@ -8834,7 +8825,7 @@ class IfcImpactProtectionDevice_CorrectPredefinedType: @staticmethod def __call__(self): predefinedtype = express_getattr(self, 'PredefinedType', INDETERMINATE) - assert (not exists(predefinedtype) or (predefinedtype != express_getattr(IfcImpactProtectionDeviceTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype != express_getattr(IfcVibrationDamperTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype != express_getattr(IfcVibrationIsolatorTypeEnum, 'USERDEFINED', INDETERMINATE)) or ((predefinedtype == express_getattr(IfcImpactProtectionDeviceTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype == express_getattr(IfcVibrationDamperTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype == express_getattr(IfcVibrationIsolatorTypeEnum, 'USERDEFINED', INDETERMINATE)) and exists(express_getattr(self, 'ObjectType', INDETERMINATE)))) is not False + assert (not exists(predefinedtype) or (predefinedtype != express_getattr(IfcImpactProtectionDeviceTypeEnum, 'USERDEFINED', INDETERMINATE) and predefinedtype != express_getattr(IfcVibrationDamperTypeEnum, 'USERDEFINED', INDETERMINATE) and (predefinedtype != express_getattr(IfcVibrationIsolatorTypeEnum, 'USERDEFINED', INDETERMINATE))) or ((predefinedtype == express_getattr(IfcImpactProtectionDeviceTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype == express_getattr(IfcVibrationDamperTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype == express_getattr(IfcVibrationIsolatorTypeEnum, 'USERDEFINED', INDETERMINATE)) and exists(express_getattr(self, 'ObjectType', INDETERMINATE)))) is not False class IfcImpactProtectionDevice_CorrectTypeAssigned: SCOPE = 'entity' @@ -8854,7 +8845,7 @@ class IfcImpactProtectionDeviceType_CorrectPredefinedType: @staticmethod def __call__(self): predefinedtype = express_getattr(self, 'PredefinedType', INDETERMINATE) - assert ((predefinedtype != express_getattr(IfcImpactProtectionDeviceTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype != express_getattr(IfcVibrationDamperTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype != express_getattr(IfcVibrationIsolatorTypeEnum, 'USERDEFINED', INDETERMINATE)) or ((predefinedtype == express_getattr(IfcImpactProtectionDeviceTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype == express_getattr(IfcVibrationDamperTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype == express_getattr(IfcVibrationIsolatorTypeEnum, 'USERDEFINED', INDETERMINATE)) and exists(express_getattr(self, 'ObjectType', INDETERMINATE)))) is not False + assert (predefinedtype != express_getattr(IfcImpactProtectionDeviceTypeEnum, 'USERDEFINED', INDETERMINATE) and predefinedtype != express_getattr(IfcVibrationDamperTypeEnum, 'USERDEFINED', INDETERMINATE) and (predefinedtype != express_getattr(IfcVibrationIsolatorTypeEnum, 'USERDEFINED', INDETERMINATE)) or ((predefinedtype == express_getattr(IfcImpactProtectionDeviceTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype == express_getattr(IfcVibrationDamperTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype == express_getattr(IfcVibrationIsolatorTypeEnum, 'USERDEFINED', INDETERMINATE)) and exists(express_getattr(self, 'ObjectType', INDETERMINATE)))) is not False class IfcIndexedPolyCurve_Consecutive: SCOPE = 'entity' @@ -9523,36 +9514,6 @@ class IfcPath_IsContinuous: def __call__(self): assert IfcPathHeadToTail(self) is not False -class IfcPavement_CorrectPredefinedType: - SCOPE = 'entity' - TYPE_NAME = 'IfcPavement' - RULE_NAME = 'CorrectPredefinedType' - - @staticmethod - def __call__(self): - predefinedtype = express_getattr(self, 'PredefinedType', INDETERMINATE) - assert (not exists(predefinedtype) or predefinedtype != express_getattr(IfcPavementTypeEnum, 'USERDEFINED', INDETERMINATE) or (predefinedtype == express_getattr(IfcPavementTypeEnum, 'USERDEFINED', INDETERMINATE) and exists(express_getattr(self, 'ObjectType', INDETERMINATE)))) is not False - -class IfcPavement_CorrectTypeAssigned: - SCOPE = 'entity' - TYPE_NAME = 'IfcPavement' - RULE_NAME = 'CorrectTypeAssigned' - - @staticmethod - def __call__(self): - istypedby = express_getattr(self, 'IsTypedBy', INDETERMINATE) - assert (sizeof(istypedby) == 0 or 'ifc4x3_rc3.ifcpavementtype' in typeof(express_getattr(express_getitem(express_getattr(self, 'IsTypedBy', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatingType', INDETERMINATE))) is not False - -class IfcPavementType_CorrectPredefinedType: - SCOPE = 'entity' - TYPE_NAME = 'IfcPavementType' - RULE_NAME = 'CorrectPredefinedType' - - @staticmethod - def __call__(self): - predefinedtype = express_getattr(self, 'PredefinedType', INDETERMINATE) - assert (predefinedtype != express_getattr(IfcPavementTypeEnum, 'USERDEFINED', INDETERMINATE) or (predefinedtype == express_getattr(IfcPavementTypeEnum, 'USERDEFINED', INDETERMINATE) and exists(express_getattr(self, 'ElementType', INDETERMINATE)))) is not False - class IfcPcurve_DimIs2D: SCOPE = 'entity' TYPE_NAME = 'IfcPcurve' @@ -9844,29 +9805,6 @@ class IfcPolyline_SameDim: points = express_getattr(self, 'Points', INDETERMINATE) assert (sizeof([temp for temp in points if express_getattr(temp, 'Dim', INDETERMINATE) != express_getattr(express_getitem(points, 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'Dim', INDETERMINATE)]) == 0) is not False -class IfcPolynomialCurve_ValidCoefficients: - SCOPE = 'entity' - TYPE_NAME = 'IfcPolynomialCurve' - RULE_NAME = 'ValidCoefficients' - - @staticmethod - def __call__(self): - coefficientsx = express_getattr(self, 'CoefficientsX', INDETERMINATE) - coefficientsy = express_getattr(self, 'CoefficientsY', INDETERMINATE) - coefficientsz = express_getattr(self, 'CoefficientsZ', INDETERMINATE) - assert (exists(coefficientsx) and exists(coefficientsy) or (exists(coefficientsx) and exists(coefficientsz)) or (exists(coefficientsy) and exists(coefficientsz)) or (exists(coefficientsx) and exists(coefficientsy) and exists(coefficientsz))) is not False - -class IfcPolynomialCurve_CorrectPositionDim: - SCOPE = 'entity' - TYPE_NAME = 'IfcPolynomialCurve' - RULE_NAME = 'CorrectPositionDim' - - @staticmethod - def __call__(self): - position = express_getattr(self, 'Position', INDETERMINATE) - coefficientsz = express_getattr(self, 'CoefficientsZ', INDETERMINATE) - assert (express_getattr(position, 'Dim', INDETERMINATE) == 2 and (not exists(coefficientsz)) or express_getattr(position, 'Dim', INDETERMINATE) == 3) is not False - class IfcPositioningElement_HasPlacement: SCOPE = 'entity' TYPE_NAME = 'IfcPositioningElement' @@ -11154,7 +11092,7 @@ class IfcSectionedSolidHorizontal_NoLongitudinalOffsets: @staticmethod def __call__(self): crosssectionpositions = express_getattr(self, 'CrossSectionPositions', INDETERMINATE) - assert (sizeof([temp for temp in crosssectionpositions if exists(express_getattr(express_getattr(temp, 'Location', INDETERMINATE), 'OffsetLongitudinal', INDETERMINATE))]) == 0) is not False + assert (sizeof([temp for temp in crosssectionpositions if exists(express_getattr(temp, 'OffsetLongitudinal', INDETERMINATE))]) == 0) is not False class IfcSectionedSpine_CorrespondingSectionPositions: SCOPE = 'entity' @@ -12514,7 +12452,7 @@ class IfcTransportElement_CorrectPredefinedType: @staticmethod def __call__(self): predefinedtype = express_getattr(self, 'PredefinedType', INDETERMINATE) - assert (not exists(predefinedtype) or (predefinedtype != express_getattr(IfcTransportElementFixedTypeEnum, 'USERDEFINED', INDETERMINATE) and predefinedtype != express_getattr(IfcTransportElementNonFixedTypeEnum, 'USERDEFINED', INDETERMINATE)) or ((predefinedtype == express_getattr(IfcTransportElementFixedTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype == express_getattr(IfcTransportElementNonFixedTypeEnum, 'USERDEFINED', INDETERMINATE)) and exists(express_getattr(self, 'ElementType', INDETERMINATE)))) is not False + assert (not exists(predefinedtype) or (predefinedtype != express_getattr(IfcTransportElementFixedTypeEnum, 'USERDEFINED', INDETERMINATE) and predefinedtype != express_getattr(IfcTransportElementNonFixedTypeEnum, 'USERDEFINED', INDETERMINATE)) or ((predefinedtype == express_getattr(IfcTransportElementFixedTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype == express_getattr(IfcTransportElementNonFixedTypeEnum, 'USERDEFINED', INDETERMINATE)) and exists(express_getattr(self, 'ObjectType', INDETERMINATE)))) is not False class IfcTransportElement_CorrectTypeAssigned: SCOPE = 'entity' @@ -12534,7 +12472,7 @@ class IfcTransportElementType_CorrectPredefinedType: @staticmethod def __call__(self): predefinedtype = express_getattr(self, 'PredefinedType', INDETERMINATE) - assert (predefinedtype != express_getattr(IfcTransportElementFixedTypeEnum, 'USERDEFINED', INDETERMINATE) and predefinedtype != express_getattr(IfcTransportElementNonFixedTypeEnum, 'USERDEFINED', INDETERMINATE) or (predefinedtype == express_getattr(IfcTransportElementFixedTypeEnum, 'USERDEFINED', INDETERMINATE) or (predefinedtype == express_getattr(IfcTransportElementNonFixedTypeEnum, 'USERDEFINED', INDETERMINATE) and exists(express_getattr(self, 'ElementType', INDETERMINATE))))) is not False + assert (predefinedtype != express_getattr(IfcTransportElementFixedTypeEnum, 'USERDEFINED', INDETERMINATE) and predefinedtype != express_getattr(IfcTransportElementNonFixedTypeEnum, 'USERDEFINED', INDETERMINATE) or ((predefinedtype == express_getattr(IfcTransportElementFixedTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype == express_getattr(IfcTransportElementNonFixedTypeEnum, 'USERDEFINED', INDETERMINATE)) and exists(express_getattr(self, 'ElementType', INDETERMINATE)))) is not False def calc_IfcTriangulatedFaceSet_NumberOfTriangles(self): coordindex = express_getattr(self, 'CoordIndex', INDETERMINATE) @@ -12635,7 +12573,7 @@ class IfcTypeProduct_ApplicableOccurrence: @staticmethod def __call__(self): - assert (not exists(lambda : express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc4x3_rc3.ifcproduct' in typeof(temp)]) == 0) is not False + assert (not exists(lambda: express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc4x3_rc3.ifcproduct' in typeof(temp)]) == 0) is not False class IfcUShapeProfileDef_ValidFlangeThickness: SCOPE = 'entity' @@ -12991,7 +12929,7 @@ class IfcWindowLiningProperties_WR34: @staticmethod def __call__(self): - assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc3.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc3.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False + assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc3.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc3.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False class IfcWindowPanelProperties_ApplicableToType: SCOPE = 'entity' @@ -13000,7 +12938,7 @@ class IfcWindowPanelProperties_ApplicableToType: @staticmethod def __call__(self): - assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc3.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc3.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False + assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc3.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc3.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False class IfcWindowType_CorrectPredefinedType: SCOPE = 'entity' @@ -13440,8 +13378,6 @@ def IfcCurveDim(curve): if 'ifc4x3_rc3.ifccurvesegment2d' in typeof(curve): return 2 if 'ifc4x3_rc3.ifcpolynomialcurve' in typeof(curve): - if not exists(express_getattr(curve, 'CoefficientsZ', INDETERMINATE)) and express_getattr(express_getattr(curve, 'Position', INDETERMINATE), 'Dim', INDETERMINATE) == 2: - return 2 return 3 if 'ifc4x3_rc3.ifcpcurve' in typeof(curve): return 3 diff --git a/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X3_RC4.py b/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X3_RC4.py index 89afa919b8..2606cbcbc7 100644 --- a/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X3_RC4.py +++ b/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X3_RC4.py @@ -44,10 +44,10 @@ unknown = 'UNKNOWN' def usedin(inst, ref_name): if inst is None: return [] - (_, __, attr) = ref_name.split('.') + _, __, attr = ref_name.split('.') def filter(): - for (ref, attr_idx) in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True): + for ref, attr_idx in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True): if ref.wrapped_data.get_attribute_names()[attr_idx].lower() == attr: yield ref return list(filter()) @@ -7686,7 +7686,7 @@ class IfcDoorLiningProperties_WR35: @staticmethod def __call__(self): - assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc4.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc4.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False + assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc4.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc4.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False class IfcDoorPanelProperties_ApplicableToType: SCOPE = 'entity' @@ -7695,7 +7695,7 @@ class IfcDoorPanelProperties_ApplicableToType: @staticmethod def __call__(self): - assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc4.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc4.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False + assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc4.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc4.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False class IfcDoorType_CorrectPredefinedType: SCOPE = 'entity' @@ -12651,7 +12651,7 @@ class IfcTypeProduct_ApplicableOccurrence: @staticmethod def __call__(self): - assert (not exists(lambda : express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc4x3_rc4.ifcproduct' in typeof(temp)]) == 0) is not False + assert (not exists(lambda: express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc4x3_rc4.ifcproduct' in typeof(temp)]) == 0) is not False class IfcUShapeProfileDef_ValidFlangeThickness: SCOPE = 'entity' @@ -13007,7 +13007,7 @@ class IfcWindowLiningProperties_WR34: @staticmethod def __call__(self): - assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc4.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc4.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False + assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc4.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc4.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False class IfcWindowPanelProperties_ApplicableToType: SCOPE = 'entity' @@ -13016,7 +13016,7 @@ class IfcWindowPanelProperties_ApplicableToType: @staticmethod def __call__(self): - assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc4.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc4.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False + assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc4.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc4.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False class IfcWindowType_CorrectPredefinedType: SCOPE = 'entity' diff --git a/src/ifcopenshell-python/scripts/compile-exp-rules.py b/src/ifcopenshell-python/scripts/compile-exp-rules.py new file mode 100755 index 0000000000..a0ad16d3cd --- /dev/null +++ b/src/ifcopenshell-python/scripts/compile-exp-rules.py @@ -0,0 +1,109 @@ +#!/usr/bin/env python3 +"""Download and compile ifcopenshell.express rules for all available schemas. + +Missing schemas that are known to be available on GitHub are downloaded first. + +Usage: + python compile-exp-rules.py # print this message + python compile-exp-rules.py --check # download schemas and report which are present + python compile-exp-rules.py --compile # implies --check, then compile rules for them +""" + +import argparse +import subprocess +import sys +import urllib.request +from pathlib import Path +from typing import NamedTuple + +EXPRESS_DIR = Path(__file__).parent.parent / "ifcopenshell" / "express" + +GITHUB_RAW_URL = ( + "https://raw.githubusercontent.com/buildingSMART/IFC4.x-development/refs/heads/ifc4.3-main/reference_schemas" +) + +# buildingSMART's website blocks automated/scripted downloads, so these have to be fetched manually. +BUILDINGSMART_SCHEMAS_URL = "https://technical.buildingsmart.org/standards/ifc/ifc-schema-specifications/" + + +class ExpFile(NamedTuple): + name: str + available_on_github: bool + required: bool + + +SCHEMA_TO_EXP_FILENAME = { + # Main schemas. + "IFC2X3": ExpFile("IFC2X3_TC1", True, True), + "IFC4": ExpFile("IFC4_ADD2_TC1", True, True), + # IFC4X3_ADD2 is available from https://technical.buildingsmart.org/standards/ifc/ifc-schema-specifications/ + "IFC4X3_ADD2": ExpFile("IFC4X3_ADD2", False, True), + # Withdrawn schemas. + "IFC4X1": ExpFile("IFC4x1", True, True), + "IFC4X2": ExpFile("IFC4x2", True, True), + # Retired schemas. + "IFC4X3_RC1": ExpFile("IFC4x3_RC1", True, True), + "IFC4X3_RC2": ExpFile("IFC4x3_RC2", True, True), + "IFC4X3_RC3": ExpFile("IFC4x3_RC3", True, True), + "IFC4X3_RC4": ExpFile("IFC4x3_RC4", True, True), + ## Couldn't find them anywhere, so I guess their .py will be missing updates. + "IFC4X3": ExpFile("IFC4X3", False, False), + "IFC4X3_ADD1": ExpFile("IFC4X3_ADD1", False, False), + "IFC4X3_TC1": ExpFile("IFC4X3_TC1", False, False), +} + + +def download_schema(exp_filename: str, exp_path: Path) -> None: + url = f"{GITHUB_RAW_URL}/{exp_filename}.exp" + print(f"Downloading '{url}'...") + with urllib.request.urlopen(url) as response: + exp_path.write_bytes(response.read()) + + +def resolve_exp_paths() -> dict[str, Path]: + exp_paths: dict[str, Path] = {} + for schema_name, exp_file in SCHEMA_TO_EXP_FILENAME.items(): + exp_path = EXPRESS_DIR / f"{exp_file.name}.exp" + if not exp_path.exists(): + if not exp_file.available_on_github: + if exp_file.required: + raise FileNotFoundError( + f"{schema_name}: '{exp_path}' not found and not available on GitHub. " + f"Download it from {BUILDINGSMART_SCHEMAS_URL} and save it to '{EXPRESS_DIR}'." + ) + print(f"Skipping {schema_name}: '{exp_path}' not found and not available on GitHub.") + continue + download_schema(exp_file.name, exp_path) + print(f"{schema_name}: present ({exp_path})") + exp_paths[schema_name] = exp_path + return exp_paths + + +def compile_schema(schema_name: str, exp_path: Path) -> None: + print(f"Compiling rules for {schema_name} from '{exp_path.name}'...") + subprocess.run( + [sys.executable, "-m", "rule_compiler", str(exp_path)], + cwd=EXPRESS_DIR, + check=True, + ) + + +def main() -> None: + parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) + parser.add_argument("--check", action="store_true", help="download schemas and report which are present") + parser.add_argument("--compile", action="store_true", help="implies --check, then compile rules for them") + args = parser.parse_args() + + if not args.check and not args.compile: + print(__doc__) + return + + exp_paths = resolve_exp_paths() + + if args.compile: + for schema_name, exp_path in exp_paths.items(): + compile_schema(schema_name, exp_path) + + +if __name__ == "__main__": + main()