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:
@@ -11455,7 +11457,7 @@ class IfcAdvancedBrep_HasAdvancedFaces:
def __call__(self):
assert ((sizeof([afs for afs in self.Outer.CfsFaces if not 'ifc4x3_tc1.ifcadvancedface' in typeof(afs)])) == 0) is not False
assert ((sizeof([afs for afs in self.Outer.CfsFaces if not ('ifc4x3_tc1.ifcadvancedface' in typeof(afs))])) == 0) is not False
@@ -11470,7 +11472,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_tc1.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_tc1.ifcadvancedface' in typeof(afs))])) == 0])) == 0) is not False
@@ -11485,7 +11487,7 @@ class IfcAdvancedFace_ApplicableEdgeCurves:
def __call__(self):
assert ((sizeof([elpfbnds for elpfbnds in [bnds for bnds in self.Bounds if 'ifc4x3_tc1.ifcedgeloop' in typeof(bnds.Bound)] if not (sizeof([oe for oe in elpfbnds.Bound.EdgeList if not (sizeof(['ifc4x3_tc1.ifcline','ifc4x3_tc1.ifcconic','ifc4x3_tc1.ifcpolyline','ifc4x3_tc1.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_tc1.ifcedgeloop' in typeof(bnds.Bound)] if not ((sizeof([oe for oe in elpfbnds.Bound.EdgeList if not ((sizeof(['ifc4x3_tc1.ifcline','ifc4x3_tc1.ifcconic','ifc4x3_tc1.ifcpolyline','ifc4x3_tc1.ifcbsplinecurve'] * typeof(oe.EdgeElement.EdgeGeometry))) == 1)])) == 0)])) == 0) is not False
@@ -11513,7 +11515,7 @@ class IfcAdvancedFace_RequiresEdgeCurve:
def __call__(self):
assert ((sizeof([elpfbnds for elpfbnds in [bnds for bnds in self.Bounds if 'ifc4x3_tc1.ifcedgeloop' in typeof(bnds.Bound)] if not (sizeof([oe for oe in elpfbnds.Bound.EdgeList if not 'ifc4x3_tc1.ifcedgecurve' in typeof(oe.EdgeElement)])) == 0])) == 0) is not False
assert ((sizeof([elpfbnds for elpfbnds in [bnds for bnds in self.Bounds if 'ifc4x3_tc1.ifcedgeloop' in typeof(bnds.Bound)] if not ((sizeof([oe for oe in elpfbnds.Bound.EdgeList if not ('ifc4x3_tc1.ifcedgecurve' in typeof(oe.EdgeElement))])) == 0)])) == 0) is not False
@@ -11776,7 +11778,7 @@ class IfcArbitraryClosedProfileDef_WR2:
def __call__(self):
outercurve = self.OuterCurve
assert (not 'ifc4x3_tc1.ifcline' in typeof(outercurve)) is not False
assert (not ('ifc4x3_tc1.ifcline' in typeof(outercurve))) is not False
@@ -11790,7 +11792,7 @@ class IfcArbitraryClosedProfileDef_WR3:
def __call__(self):
outercurve = self.OuterCurve
assert (not 'ifc4x3_tc1.ifcoffsetcurve2d' in typeof(outercurve)) is not False
assert (not ('ifc4x3_tc1.ifcoffsetcurve2d' in typeof(outercurve))) is not False
@@ -12090,7 +12092,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
@@ -12593,7 +12595,7 @@ class IfcBooleanResult_FirstOperandClosed:
def __call__(self):
firstoperand = self.FirstOperand
assert ((not 'ifc4x3_tc1.ifctessellatedfaceset' in typeof(firstoperand)) or (exists(firstoperand.Closed) and firstoperand.Closed)) is not False
assert ((not ('ifc4x3_tc1.ifctessellatedfaceset' in typeof(firstoperand))) or (exists(firstoperand.Closed) and firstoperand.Closed)) is not False
@@ -12622,7 +12624,7 @@ class IfcBooleanResult_SecondOperandClosed:
def __call__(self):
secondoperand = self.SecondOperand
assert ((not 'ifc4x3_tc1.ifctessellatedfaceset' in typeof(secondoperand)) or (exists(secondoperand.Closed) and secondoperand.Closed)) is not False
assert ((not ('ifc4x3_tc1.ifctessellatedfaceset' in typeof(secondoperand))) or (exists(secondoperand.Closed) and secondoperand.Closed)) is not False
@@ -12691,7 +12693,7 @@ class IfcBoxedHalfSpace_UnboundedSurface:
def __call__(self):
assert (not 'ifc4x3_tc1.ifccurveboundedplane' in typeof(self.BaseSurface)) is not False
assert (not ('ifc4x3_tc1.ifccurveboundedplane' in typeof(self.BaseSurface))) is not False
@@ -14946,7 +14948,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
@@ -14961,7 +14963,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
@@ -16626,7 +16628,7 @@ class IfcGeometricRepresentationSubContext_ParentNoSub:
def __call__(self):
parentcontext = self.ParentContext
assert (not 'ifc4x3_tc1.ifcgeometricrepresentationsubcontext' in typeof(parentcontext)) is not False
assert (not ('ifc4x3_tc1.ifcgeometricrepresentationsubcontext' in typeof(parentcontext))) is not False
@@ -17481,7 +17483,7 @@ class IfcMaterialDefinitionRepresentation_OnlyStyledRepresentations:
def __call__(self):
representations = self.Representations
assert ((sizeof([temp for temp in representations if not 'ifc4x3_tc1.ifcstyledrepresentation' in typeof(temp)])) == 0) is not False
assert ((sizeof([temp for temp in representations if not ('ifc4x3_tc1.ifcstyledrepresentation' in typeof(temp))])) == 0) is not False
@@ -17940,7 +17942,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
@@ -18060,7 +18062,7 @@ class IfcOrientedEdge_EdgeElementNotOriented:
def __call__(self):
edgeelement = self.EdgeElement
assert (not 'ifc4x3_tc1.ifcorientededge' in typeof(edgeelement)) is not False
assert (not ('ifc4x3_tc1.ifcorientededge' in typeof(edgeelement))) is not False
@@ -18844,7 +18846,7 @@ class IfcProductDefinitionShape_OnlyShapeModel:
def __call__(self):
representations = self.Representations
assert ((sizeof([temp for temp in representations if not 'ifc4x3_tc1.ifcshapemodel' in typeof(temp)])) == 0) is not False
assert ((sizeof([temp for temp in representations if not ('ifc4x3_tc1.ifcshapemodel' in typeof(temp))])) == 0) is not False
@@ -19034,7 +19036,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
@@ -19049,7 +19051,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
@@ -19827,7 +19829,7 @@ class IfcRectangularTrimmedSurface_UsenseCompatible:
u2 = self.U2
usense = self.Usense
assert ((('ifc4x3_tc1.ifcelementarysurface' in typeof(basissurface)) and (not 'ifc4x3_tc1.ifcplane' in typeof(basissurface))) or ('ifc4x3_tc1.ifcsurfaceofrevolution' in typeof(basissurface)) or (usense == (u2 > u1))) is not False
assert ((('ifc4x3_tc1.ifcelementarysurface' in typeof(basissurface)) and (not ('ifc4x3_tc1.ifcplane' in typeof(basissurface)))) or ('ifc4x3_tc1.ifcsurfaceofrevolution' in typeof(basissurface)) or (usense == (u2 > u1))) is not False
@@ -20398,7 +20400,7 @@ class IfcRelReferencedInSpatialStructure_AllowedRelatedElements:
def __call__(self):
relatedelements = self.RelatedElements
assert ((sizeof([temp for temp in relatedelements if ('ifc4x3_tc1.ifcspatialstructureelement' in typeof(temp)) and (not 'ifc4x3_tc1.ifcspace' in typeof(temp))])) == 0) is not False
assert ((sizeof([temp for temp in relatedelements if ('ifc4x3_tc1.ifcspatialstructureelement' in typeof(temp)) and (not ('ifc4x3_tc1.ifcspace' in typeof(temp)))])) == 0) is not False
@@ -20448,7 +20450,7 @@ class IfcRelSpaceBoundary_CorrectPhysOrVirt:
relatedbuildingelement = self.RelatedBuildingElement
physicalorvirtualboundary = self.PhysicalOrVirtualBoundary
assert (((physicalorvirtualboundary == IfcPhysicalOrVirtualEnum.Physical) and (not 'ifc4x3_tc1.ifcvirtualelement' in typeof(relatedbuildingelement))) or ((physicalorvirtualboundary == IfcPhysicalOrVirtualEnum.Virtual) and (('ifc4x3_tc1.ifcvirtualelement' in typeof(relatedbuildingelement)) or ('ifc4x3_tc1.ifcopeningelement' in typeof(relatedbuildingelement)))) or (physicalorvirtualboundary == IfcPhysicalOrVirtualEnum.NotDefined)) is not False
assert (((physicalorvirtualboundary == IfcPhysicalOrVirtualEnum.Physical) and (not ('ifc4x3_tc1.ifcvirtualelement' in typeof(relatedbuildingelement)))) or ((physicalorvirtualboundary == IfcPhysicalOrVirtualEnum.Virtual) and (('ifc4x3_tc1.ifcvirtualelement' in typeof(relatedbuildingelement)) or ('ifc4x3_tc1.ifcopeningelement' in typeof(relatedbuildingelement)))) or (physicalorvirtualboundary == IfcPhysicalOrVirtualEnum.NotDefined)) is not False
@@ -21143,7 +21145,7 @@ class IfcShapeRepresentation_NoTopologicalItem:
def __call__(self):
items = self.Items
assert ((sizeof([temp for temp in items if ('ifc4x3_tc1.ifctopologicalrepresentationitem' in typeof(temp)) and (not (sizeof(['ifc4x3_tc1.ifcvertexpoint','ifc4x3_tc1.ifcedgecurve','ifc4x3_tc1.ifcfacesurface'] * typeof(temp))) == 1)])) == 0) is not False
assert ((sizeof([temp for temp in items if ('ifc4x3_tc1.ifctopologicalrepresentationitem' in typeof(temp)) and (not ((sizeof(['ifc4x3_tc1.ifcvertexpoint','ifc4x3_tc1.ifcedgecurve','ifc4x3_tc1.ifcfacesurface'] * typeof(temp))) == 1))])) == 0) is not False
@@ -22043,7 +22045,7 @@ class IfcStyledItem_ApplicableItem:
def __call__(self):
item = self.Item
assert (not 'ifc4x3_tc1.ifcstyleditem' in typeof(item)) is not False
assert (not ('ifc4x3_tc1.ifcstyleditem' in typeof(item))) is not False
@@ -22058,7 +22060,7 @@ class IfcStyledRepresentation_OnlyStyledItems:
def __call__(self):
assert ((sizeof([temp for temp in self.Items if not 'ifc4x3_tc1.ifcstyleditem' in typeof(temp)])) == 0) is not False
assert ((sizeof([temp for temp in self.Items if not ('ifc4x3_tc1.ifcstyleditem' in typeof(temp))])) == 0) is not False
@@ -22128,7 +22130,7 @@ class IfcSurfaceCurve_CurveIsNotPcurve:
def __call__(self):
curve3d = self.Curve3D
assert (not 'ifc4x3_tc1.ifcpcurve' in typeof(curve3d)) is not False
assert (not ('ifc4x3_tc1.ifcpcurve' in typeof(curve3d))) is not False
@@ -22890,7 +22892,7 @@ class IfcTextLiteralWithExtent_WR31:
def __call__(self):
extent = self.Extent
assert (not 'ifc4x3_tc1.ifcplanarbox' in typeof(extent)) is not False
assert (not ('ifc4x3_tc1.ifcplanarbox' in typeof(extent))) is not False
@@ -22965,7 +22967,7 @@ class IfcTopologyRepresentation_WR21:
def __call__(self):
assert ((sizeof([temp for temp in self.Items if not 'ifc4x3_tc1.ifctopologicalrepresentationitem' in typeof(temp)])) == 0) is not False
assert ((sizeof([temp for temp in self.Items if not ('ifc4x3_tc1.ifctopologicalrepresentationitem' in typeof(temp))])) == 0) is not False
@@ -23188,7 +23190,7 @@ class IfcTrimmedCurve_NoTrimOfBoundedCurves:
def __call__(self):
basiscurve = self.BasisCurve
assert (not 'ifc4x3_tc1.ifcboundedcurve' in typeof(basiscurve)) is not False
assert (not ('ifc4x3_tc1.ifcboundedcurve' in typeof(basiscurve))) is not False
@@ -23307,7 +23309,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_tc1.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_tc1.ifcproduct' in typeof(temp))])) == 0)) is not False
@@ -23832,7 +23834,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
@@ -23847,7 +23849,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
@@ -23862,7 +23864,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
@@ -23988,7 +23990,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_tc1.ifczone' in typeof(temp)) or ('ifc4x3_tc1.ifcspace' in typeof(temp)) or ('ifc4x3_tc1.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_tc1.ifczone' in typeof(temp)) or ('ifc4x3_tc1.ifcspace' in typeof(temp)) or ('ifc4x3_tc1.ifcspatialzone' in typeof(temp)))])) == 0)) is not False
@@ -24004,7 +24006,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
@@ -24323,13 +24325,13 @@ def IfcCorrectUnitAssignment(units):
monetaryunitnumber = 0
namedunitnames = express_set([])
derivedunitnames = express_set([])
namedunitnumber = sizeof([temp for temp in units if ('ifc4x3_tc1.ifcnamedunit' in typeof(temp)) and (not temp.UnitType == IfcUnitEnum.USERDEFINED)])
derivedunitnumber = sizeof([temp for temp in units if ('ifc4x3_tc1.ifcderivedunit' in typeof(temp)) and (not temp.UnitType == IfcDerivedUnitEnum.USERDEFINED)])
namedunitnumber = sizeof([temp for temp in units if ('ifc4x3_tc1.ifcnamedunit' in typeof(temp)) and (not (temp.UnitType == IfcUnitEnum.USERDEFINED))])
derivedunitnumber = sizeof([temp for temp in units if ('ifc4x3_tc1.ifcderivedunit' in typeof(temp)) and (not (temp.UnitType == IfcDerivedUnitEnum.USERDEFINED))])
monetaryunitnumber = sizeof([temp for temp in units if 'ifc4x3_tc1.ifcmonetaryunit' in typeof(temp)])
for i in range(1, sizeof(units) + 1):
if ('ifc4x3_tc1.ifcnamedunit' in (typeof(units[i - 1]))) and (not (units[i - 1].UnitType) == IfcUnitEnum.USERDEFINED):
if ('ifc4x3_tc1.ifcnamedunit' in (typeof(units[i - 1]))) and (not ((units[i - 1].UnitType) == IfcUnitEnum.USERDEFINED)):
namedunitnames = namedunitnames + (units[i - 1].UnitType)
if ('ifc4x3_tc1.ifcderivedunit' in (typeof(units[i - 1]))) and (not (units[i - 1].UnitType) == IfcDerivedUnitEnum.USERDEFINED):
if ('ifc4x3_tc1.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)