Recompile rules

This commit is contained in:
Thomas Krijnen
2023-02-03 22:22:40 +01:00
parent 66d0627035
commit c4b77c2a07
11 changed files with 540 additions and 518 deletions
@@ -44,7 +44,9 @@ class express_set(set):
__radd__ = __add__
def __repr__(self):
return repr(set(self))
def __getitem__(self, k):
# @todo this is obviously not stable, but should be good enough?
return list(self)[k]
def typeof(inst):
if not inst:
@@ -11575,7 +11577,7 @@ class IfcAdvancedBrep_HasAdvancedFaces:
def __call__(self):
assert ((sizeof([afs for afs in self.Outer.CfsFaces if not 'ifc4x3_rc4.ifcadvancedface' in typeof(afs)])) == 0) is not False
assert ((sizeof([afs for afs in self.Outer.CfsFaces if not ('ifc4x3_rc4.ifcadvancedface' in typeof(afs))])) == 0) is not False
@@ -11590,7 +11592,7 @@ class IfcAdvancedBrepWithVoids_VoidsHaveAdvancedFaces:
def __call__(self):
voids = self.Voids
assert ((sizeof([vsh for vsh in voids if (sizeof([afs for afs in vsh.CfsFaces if not 'ifc4x3_rc4.ifcadvancedface' in typeof(afs)])) == 0])) == 0) is not False
assert ((sizeof([vsh for vsh in voids if (sizeof([afs for afs in vsh.CfsFaces if not ('ifc4x3_rc4.ifcadvancedface' in typeof(afs))])) == 0])) == 0) is not False
@@ -11619,7 +11621,7 @@ class IfcAdvancedFace_RequiresEdgeCurve:
def __call__(self):
assert ((sizeof([elpfbnds for elpfbnds in [bnds for bnds in self.Bounds if 'ifc4x3_rc4.ifcedgeloop' in typeof(bnds.Bound)] if not (sizeof([oe for oe in elpfbnds.Bound.EdgeList if not 'ifc4x3_rc4.ifcedgecurve' in typeof(oe.EdgeElement)])) == 0])) == 0) is not False
assert ((sizeof([elpfbnds for elpfbnds in [bnds for bnds in self.Bounds if 'ifc4x3_rc4.ifcedgeloop' in typeof(bnds.Bound)] if not ((sizeof([oe for oe in elpfbnds.Bound.EdgeList if not ('ifc4x3_rc4.ifcedgecurve' in typeof(oe.EdgeElement))])) == 0)])) == 0) is not False
@@ -11633,7 +11635,7 @@ class IfcAdvancedFace_ApplicableEdgeCurves:
def __call__(self):
assert ((sizeof([elpfbnds for elpfbnds in [bnds for bnds in self.Bounds if 'ifc4x3_rc4.ifcedgeloop' in typeof(bnds.Bound)] if not (sizeof([oe for oe in elpfbnds.Bound.EdgeList if not (sizeof(['ifc4x3_rc4.ifcline','ifc4x3_rc4.ifcconic','ifc4x3_rc4.ifcpolyline','ifc4x3_rc4.ifcbsplinecurve'] * typeof(oe.EdgeElement.EdgeGeometry))) == 1])) == 0])) == 0) is not False
assert ((sizeof([elpfbnds for elpfbnds in [bnds for bnds in self.Bounds if 'ifc4x3_rc4.ifcedgeloop' in typeof(bnds.Bound)] if not ((sizeof([oe for oe in elpfbnds.Bound.EdgeList if not ((sizeof(['ifc4x3_rc4.ifcline','ifc4x3_rc4.ifcconic','ifc4x3_rc4.ifcpolyline','ifc4x3_rc4.ifcbsplinecurve'] * typeof(oe.EdgeElement.EdgeGeometry))) == 1)])) == 0)])) == 0) is not False
@@ -11896,7 +11898,7 @@ class IfcArbitraryClosedProfileDef_WR2:
def __call__(self):
outercurve = self.OuterCurve
assert (not 'ifc4x3_rc4.ifcline' in typeof(outercurve)) is not False
assert (not ('ifc4x3_rc4.ifcline' in typeof(outercurve))) is not False
@@ -11910,7 +11912,7 @@ class IfcArbitraryClosedProfileDef_WR3:
def __call__(self):
outercurve = self.OuterCurve
assert (not 'ifc4x3_rc4.ifcoffsetcurve2d' in typeof(outercurve)) is not False
assert (not ('ifc4x3_rc4.ifcoffsetcurve2d' in typeof(outercurve))) is not False
@@ -12267,7 +12269,7 @@ class IfcAxis2Placement3D_AxisAndRefDirProvision:
axis = self.Axis
refdirection = self.RefDirection
assert (not exists(axis) ^ exists(refdirection)) is not False
assert (not (exists(axis) ^ exists(refdirection))) is not False
@@ -12743,7 +12745,7 @@ class IfcBooleanResult_FirstOperandClosed:
def __call__(self):
firstoperand = self.FirstOperand
assert ((not 'ifc4x3_rc4.ifctessellatedfaceset' in typeof(firstoperand)) or (exists(firstoperand.Closed) and firstoperand.Closed)) is not False
assert ((not ('ifc4x3_rc4.ifctessellatedfaceset' in typeof(firstoperand))) or (exists(firstoperand.Closed) and firstoperand.Closed)) is not False
@@ -12757,7 +12759,7 @@ class IfcBooleanResult_SecondOperandClosed:
def __call__(self):
secondoperand = self.SecondOperand
assert ((not 'ifc4x3_rc4.ifctessellatedfaceset' in typeof(secondoperand)) or (exists(secondoperand.Closed) and secondoperand.Closed)) is not False
assert ((not ('ifc4x3_rc4.ifctessellatedfaceset' in typeof(secondoperand))) or (exists(secondoperand.Closed) and secondoperand.Closed)) is not False
@@ -12826,7 +12828,7 @@ class IfcBoxedHalfSpace_UnboundedSurface:
def __call__(self):
assert (not 'ifc4x3_rc4.ifccurveboundedplane' in typeof(self.BaseSurface)) is not False
assert (not ('ifc4x3_rc4.ifccurveboundedplane' in typeof(self.BaseSurface))) is not False
@@ -15102,7 +15104,7 @@ class IfcDoorLiningProperties_WR31:
liningdepth = self.LiningDepth
liningthickness = self.LiningThickness
assert (not exists(liningdepth) and (not exists(liningthickness))) is not False
assert (not (exists(liningdepth) and (not exists(liningthickness)))) is not False
@@ -15117,7 +15119,7 @@ class IfcDoorLiningProperties_WR32:
thresholddepth = self.ThresholdDepth
thresholdthickness = self.ThresholdThickness
assert (not exists(thresholddepth) and (not exists(thresholdthickness))) is not False
assert (not (exists(thresholddepth) and (not exists(thresholdthickness)))) is not False
@@ -16771,7 +16773,7 @@ class IfcGeometricRepresentationSubContext_ParentNoSub:
def __call__(self):
parentcontext = self.ParentContext
assert (not 'ifc4x3_rc4.ifcgeometricrepresentationsubcontext' in typeof(parentcontext)) is not False
assert (not ('ifc4x3_rc4.ifcgeometricrepresentationsubcontext' in typeof(parentcontext))) is not False
@@ -17577,7 +17579,7 @@ class IfcMaterialDefinitionRepresentation_OnlyStyledRepresentations:
def __call__(self):
representations = self.Representations
assert ((sizeof([temp for temp in representations if not 'ifc4x3_rc4.ifcstyledrepresentation' in typeof(temp)])) == 0) is not False
assert ((sizeof([temp for temp in representations if not ('ifc4x3_rc4.ifcstyledrepresentation' in typeof(temp))])) == 0) is not False
@@ -18051,7 +18053,7 @@ class IfcOccupant_WR31:
def __call__(self):
predefinedtype = self.PredefinedType
assert ((not predefinedtype == IfcOccupantTypeEnum.USERDEFINED) or exists(self.ObjectType)) is not False
assert ((not (predefinedtype == IfcOccupantTypeEnum.USERDEFINED)) or exists(self.ObjectType)) is not False
@@ -18174,7 +18176,7 @@ class IfcOrientedEdge_EdgeElementNotOriented:
def __call__(self):
edgeelement = self.EdgeElement
assert (not 'ifc4x3_rc4.ifcorientededge' in typeof(edgeelement)) is not False
assert (not ('ifc4x3_rc4.ifcorientededge' in typeof(edgeelement))) is not False
@@ -18986,7 +18988,7 @@ class IfcProductDefinitionShape_OnlyShapeModel:
def __call__(self):
representations = self.Representations
assert ((sizeof([temp for temp in representations if not 'ifc4x3_rc4.ifcshapemodel' in typeof(temp)])) == 0) is not False
assert ((sizeof([temp for temp in representations if not ('ifc4x3_rc4.ifcshapemodel' in typeof(temp))])) == 0) is not False
@@ -19176,7 +19178,7 @@ class IfcPropertyEnumeration_WR01:
def __call__(self):
assert ((sizeof([temp for temp in self.EnumerationValues if not (typeof(self.EnumerationValues[1 - 1])) == typeof(temp)])) == 0) is not False
assert ((sizeof([temp for temp in self.EnumerationValues if not ((typeof(self.EnumerationValues[1 - 1])) == typeof(temp))])) == 0) is not False
@@ -19191,7 +19193,7 @@ class IfcPropertyListValue_WR31:
def __call__(self):
assert ((sizeof([temp for temp in self.ListValues if not (typeof(self.ListValues[1 - 1])) == typeof(temp)])) == 0) is not False
assert ((sizeof([temp for temp in self.ListValues if not ((typeof(self.ListValues[1 - 1])) == typeof(temp))])) == 0) is not False
@@ -19981,7 +19983,7 @@ class IfcRectangularTrimmedSurface_UsenseCompatible:
u2 = self.U2
usense = self.Usense
assert ((('ifc4x3_rc4.ifcelementarysurface' in typeof(basissurface)) and (not 'ifc4x3_rc4.ifcplane' in typeof(basissurface))) or ('ifc4x3_rc4.ifcsurfaceofrevolution' in typeof(basissurface)) or (usense == (u2 > u1))) is not False
assert ((('ifc4x3_rc4.ifcelementarysurface' in typeof(basissurface)) and (not ('ifc4x3_rc4.ifcplane' in typeof(basissurface)))) or ('ifc4x3_rc4.ifcsurfaceofrevolution' in typeof(basissurface)) or (usense == (u2 > u1))) is not False
@@ -20550,7 +20552,7 @@ class IfcRelReferencedInSpatialStructure_AllowedRelatedElements:
def __call__(self):
relatedelements = self.RelatedElements
assert ((sizeof([temp for temp in relatedelements if ('ifc4x3_rc4.ifcspatialstructureelement' in typeof(temp)) and (not 'ifc4x3_rc4.ifcspace' in typeof(temp))])) == 0) is not False
assert ((sizeof([temp for temp in relatedelements if ('ifc4x3_rc4.ifcspatialstructureelement' in typeof(temp)) and (not ('ifc4x3_rc4.ifcspace' in typeof(temp)))])) == 0) is not False
@@ -20600,7 +20602,7 @@ class IfcRelSpaceBoundary_CorrectPhysOrVirt:
relatedbuildingelement = self.RelatedBuildingElement
physicalorvirtualboundary = self.PhysicalOrVirtualBoundary
assert (((physicalorvirtualboundary == IfcPhysicalOrVirtualEnum.Physical) and (not 'ifc4x3_rc4.ifcvirtualelement' in typeof(relatedbuildingelement))) or ((physicalorvirtualboundary == IfcPhysicalOrVirtualEnum.Virtual) and (('ifc4x3_rc4.ifcvirtualelement' in typeof(relatedbuildingelement)) or ('ifc4x3_rc4.ifcopeningelement' in typeof(relatedbuildingelement)))) or (physicalorvirtualboundary == IfcPhysicalOrVirtualEnum.NotDefined)) is not False
assert (((physicalorvirtualboundary == IfcPhysicalOrVirtualEnum.Physical) and (not ('ifc4x3_rc4.ifcvirtualelement' in typeof(relatedbuildingelement)))) or ((physicalorvirtualboundary == IfcPhysicalOrVirtualEnum.Virtual) and (('ifc4x3_rc4.ifcvirtualelement' in typeof(relatedbuildingelement)) or ('ifc4x3_rc4.ifcopeningelement' in typeof(relatedbuildingelement)))) or (physicalorvirtualboundary == IfcPhysicalOrVirtualEnum.NotDefined)) is not False
@@ -21164,7 +21166,7 @@ class IfcShapeRepresentation_NoTopologicalItem:
def __call__(self):
items = self.Items
assert ((sizeof([temp for temp in items if ('ifc4x3_rc4.ifctopologicalrepresentationitem' in typeof(temp)) and (not (sizeof(['ifc4x3_rc4.ifcvertexpoint','ifc4x3_rc4.ifcedgecurve','ifc4x3_rc4.ifcfacesurface'] * typeof(temp))) == 1)])) == 0) is not False
assert ((sizeof([temp for temp in items if ('ifc4x3_rc4.ifctopologicalrepresentationitem' in typeof(temp)) and (not ((sizeof(['ifc4x3_rc4.ifcvertexpoint','ifc4x3_rc4.ifcedgecurve','ifc4x3_rc4.ifcfacesurface'] * typeof(temp))) == 1))])) == 0) is not False
@@ -22153,7 +22155,7 @@ class IfcStyledItem_ApplicableItem:
def __call__(self):
item = self.Item
assert (not 'ifc4x3_rc4.ifcstyleditem' in typeof(item)) is not False
assert (not ('ifc4x3_rc4.ifcstyleditem' in typeof(item))) is not False
@@ -22168,7 +22170,7 @@ class IfcStyledRepresentation_OnlyStyledItems:
def __call__(self):
assert ((sizeof([temp for temp in self.Items if not 'ifc4x3_rc4.ifcstyleditem' in typeof(temp)])) == 0) is not False
assert ((sizeof([temp for temp in self.Items if not ('ifc4x3_rc4.ifcstyleditem' in typeof(temp))])) == 0) is not False
@@ -22238,7 +22240,7 @@ class IfcSurfaceCurve_CurveIsNotPcurve:
def __call__(self):
curve3d = self.Curve3D
assert (not 'ifc4x3_rc4.ifcpcurve' in typeof(curve3d)) is not False
assert (not ('ifc4x3_rc4.ifcpcurve' in typeof(curve3d))) is not False
@@ -23000,7 +23002,7 @@ class IfcTextLiteralWithExtent_WR31:
def __call__(self):
extent = self.Extent
assert (not 'ifc4x3_rc4.ifcplanarbox' in typeof(extent)) is not False
assert (not ('ifc4x3_rc4.ifcplanarbox' in typeof(extent))) is not False
@@ -23069,7 +23071,7 @@ class IfcTopologyRepresentation_WR21:
def __call__(self):
assert ((sizeof([temp for temp in self.Items if not 'ifc4x3_rc4.ifctopologicalrepresentationitem' in typeof(temp)])) == 0) is not False
assert ((sizeof([temp for temp in self.Items if not ('ifc4x3_rc4.ifctopologicalrepresentationitem' in typeof(temp))])) == 0) is not False
@@ -23314,7 +23316,7 @@ class IfcTrimmedCurve_NoTrimOfBoundedCurves:
def __call__(self):
basiscurve = self.BasisCurve
assert (not 'ifc4x3_rc4.ifcboundedcurve' in typeof(basiscurve)) is not False
assert (not ('ifc4x3_rc4.ifcboundedcurve' in typeof(basiscurve))) is not False
@@ -23405,7 +23407,7 @@ class IfcTypeProduct_ApplicableOccurrence:
def __call__(self):
assert ((not exists(lambda: self.Types[1 - 1])) or ((sizeof([temp for temp in self.Types[1 - 1].RelatedObjects if not 'ifc4x3_rc4.ifcproduct' in typeof(temp)])) == 0)) is not False
assert ((not (exists(lambda: self.Types[1 - 1]))) or ((sizeof([temp for temp in self.Types[1 - 1].RelatedObjects if not ('ifc4x3_rc4.ifcproduct' in typeof(temp))])) == 0)) is not False
@@ -23909,7 +23911,7 @@ class IfcWindowLiningProperties_WR31:
liningdepth = self.LiningDepth
liningthickness = self.LiningThickness
assert (not exists(liningdepth) and (not exists(liningthickness))) is not False
assert (not (exists(liningdepth) and (not exists(liningthickness)))) is not False
@@ -23924,7 +23926,7 @@ class IfcWindowLiningProperties_WR32:
firsttransomoffset = self.FirstTransomOffset
secondtransomoffset = self.SecondTransomOffset
assert (not (not exists(firsttransomoffset)) and exists(secondtransomoffset)) is not False
assert (not ((not exists(firsttransomoffset)) and exists(secondtransomoffset))) is not False
@@ -23939,7 +23941,7 @@ class IfcWindowLiningProperties_WR33:
firstmullionoffset = self.FirstMullionOffset
secondmullionoffset = self.SecondMullionOffset
assert (not (not exists(firstmullionoffset)) and exists(secondmullionoffset)) is not False
assert (not ((not exists(firstmullionoffset)) and exists(secondmullionoffset))) is not False
@@ -24071,7 +24073,7 @@ class IfcZone_WR1:
def __call__(self):
assert ((sizeof(self.IsGroupedBy) == 0) or ((sizeof([temp for temp in self.IsGroupedBy[1 - 1].RelatedObjects if not ('ifc4x3_rc4.ifczone' in typeof(temp)) or ('ifc4x3_rc4.ifcspace' in typeof(temp)) or ('ifc4x3_rc4.ifcspatialzone' in typeof(temp))])) == 0)) is not False
assert ((sizeof(self.IsGroupedBy) == 0) or ((sizeof([temp for temp in self.IsGroupedBy[1 - 1].RelatedObjects if not (('ifc4x3_rc4.ifczone' in typeof(temp)) or ('ifc4x3_rc4.ifcspace' in typeof(temp)) or ('ifc4x3_rc4.ifcspatialzone' in typeof(temp)))])) == 0)) is not False
@@ -24087,7 +24089,7 @@ class IfcRepresentationContextSameWCS:
if sizeof(IfcGeometricRepresentationContext) > 1:
for i in range(2, hiindex(IfcGeometricRepresentationContext) + 1):
if (IfcGeometricRepresentationContext[1 - 1].WorldCoordinateSystem) != (IfcGeometricRepresentationContext[i - 1].WorldCoordinateSystem):
isdifferent = (not IfcSameValidPrecision(IfcGeometricRepresentationContext[1 - 1].Precision,IfcGeometricRepresentationContext[i - 1].Precision)) or (not IfcSameAxis2Placement(IfcGeometricRepresentationContext[1 - 1].WorldCoordinateSystem,IfcGeometricRepresentationContext[i - 1].WorldCoordinateSystem,IfcGeometricRepresentationContext[1 - 1].Precision))
isdifferent = (not (IfcSameValidPrecision(IfcGeometricRepresentationContext[1 - 1].Precision,IfcGeometricRepresentationContext[i - 1].Precision))) or (not (IfcSameAxis2Placement(IfcGeometricRepresentationContext[1 - 1].WorldCoordinateSystem,IfcGeometricRepresentationContext[i - 1].WorldCoordinateSystem,IfcGeometricRepresentationContext[1 - 1].Precision)))
if isdifferent == True:
break
@@ -24407,25 +24409,25 @@ def IfcCorrectObjectAssignment(constraint, objects):
if constraint == IfcObjectTypeEnum.NOTDEFINED:
return True
elif constraint == IfcObjectTypeEnum.PRODUCT:
count = sizeof([temp for temp in objects if not 'ifc4x3_rc4.ifcproduct' in typeof(temp)])
count = sizeof([temp for temp in objects if not ('ifc4x3_rc4.ifcproduct' in typeof(temp))])
return count == 0
elif constraint == IfcObjectTypeEnum.PROCESS:
count = sizeof([temp for temp in objects if not 'ifc4x3_rc4.ifcprocess' in typeof(temp)])
count = sizeof([temp for temp in objects if not ('ifc4x3_rc4.ifcprocess' in typeof(temp))])
return count == 0
elif constraint == IfcObjectTypeEnum.CONTROL:
count = sizeof([temp for temp in objects if not 'ifc4x3_rc4.ifccontrol' in typeof(temp)])
count = sizeof([temp for temp in objects if not ('ifc4x3_rc4.ifccontrol' in typeof(temp))])
return count == 0
elif constraint == IfcObjectTypeEnum.RESOURCE:
count = sizeof([temp for temp in objects if not 'ifc4x3_rc4.ifcresource' in typeof(temp)])
count = sizeof([temp for temp in objects if not ('ifc4x3_rc4.ifcresource' in typeof(temp))])
return count == 0
elif constraint == IfcObjectTypeEnum.ACTOR:
count = sizeof([temp for temp in objects if not 'ifc4x3_rc4.ifcactor' in typeof(temp)])
count = sizeof([temp for temp in objects if not ('ifc4x3_rc4.ifcactor' in typeof(temp))])
return count == 0
elif constraint == IfcObjectTypeEnum.GROUP:
count = sizeof([temp for temp in objects if not 'ifc4x3_rc4.ifcgroup' in typeof(temp)])
count = sizeof([temp for temp in objects if not ('ifc4x3_rc4.ifcgroup' in typeof(temp))])
return count == 0
elif constraint == IfcObjectTypeEnum.PROJECT:
count = sizeof([temp for temp in objects if not 'ifc4x3_rc4.ifcproject' in typeof(temp)])
count = sizeof([temp for temp in objects if not ('ifc4x3_rc4.ifcproject' in typeof(temp))])
return count == 0
else:
return None
@@ -24437,13 +24439,13 @@ def IfcCorrectUnitAssignment(units):
monetaryunitnumber = 0
namedunitnames = express_set([])
derivedunitnames = express_set([])
namedunitnumber = sizeof([temp for temp in units if ('ifc4x3_rc4.ifcnamedunit' in typeof(temp)) and (not temp.UnitType == IfcUnitEnum.USERDEFINED)])
derivedunitnumber = sizeof([temp for temp in units if ('ifc4x3_rc4.ifcderivedunit' in typeof(temp)) and (not temp.UnitType == IfcDerivedUnitEnum.USERDEFINED)])
namedunitnumber = sizeof([temp for temp in units if ('ifc4x3_rc4.ifcnamedunit' in typeof(temp)) and (not (temp.UnitType == IfcUnitEnum.USERDEFINED))])
derivedunitnumber = sizeof([temp for temp in units if ('ifc4x3_rc4.ifcderivedunit' in typeof(temp)) and (not (temp.UnitType == IfcDerivedUnitEnum.USERDEFINED))])
monetaryunitnumber = sizeof([temp for temp in units if 'ifc4x3_rc4.ifcmonetaryunit' in typeof(temp)])
for i in range(1, sizeof(units) + 1):
if ('ifc4x3_rc4.ifcnamedunit' in (typeof(units[i - 1]))) and (not (units[i - 1].UnitType) == IfcUnitEnum.USERDEFINED):
if ('ifc4x3_rc4.ifcnamedunit' in (typeof(units[i - 1]))) and (not ((units[i - 1].UnitType) == IfcUnitEnum.USERDEFINED)):
namedunitnames = namedunitnames + (units[i - 1].UnitType)
if ('ifc4x3_rc4.ifcderivedunit' in (typeof(units[i - 1]))) and (not (units[i - 1].UnitType) == IfcDerivedUnitEnum.USERDEFINED):
if ('ifc4x3_rc4.ifcderivedunit' in (typeof(units[i - 1]))) and (not ((units[i - 1].UnitType) == IfcDerivedUnitEnum.USERDEFINED)):
derivedunitnames = derivedunitnames + (units[i - 1].UnitType)
return (sizeof(namedunitnames) == namedunitnumber) and (sizeof(derivedunitnames) == derivedunitnumber) and (monetaryunitnumber <= 1)