mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-12 14:33:28 +00:00
cleanup
This commit is contained in:
@@ -202,15 +202,14 @@ class Specification:
|
|||||||
|
|
||||||
elements = []
|
elements = []
|
||||||
|
|
||||||
if self.applicability:
|
for i, facet in enumerate(self.applicability):
|
||||||
for i, facet in enumerate(self.applicability):
|
# Usually, we rely on an entity applicability to give us our first
|
||||||
# Usually, we rely on an entity applicability to give us our first
|
# shortlist of elements, as it's the most efficient way to filter
|
||||||
# shortlist of elements, as it's the most efficient way to filter
|
# elements. If this does not exist, then we have no choice but to
|
||||||
# elements. If this does not exist, then we have no choice but to
|
# check everything.
|
||||||
# check everything.
|
if i == 0 and not isinstance(facet, Entity):
|
||||||
if i == 0 and not isinstance(facet, Entity):
|
elements = list(ifc_file)
|
||||||
elements = list(ifc_file)
|
elements = facet.filter(ifc_file, elements)
|
||||||
elements = facet.filter(ifc_file, elements)
|
|
||||||
|
|
||||||
for element in elements:
|
for element in elements:
|
||||||
is_applicable = True
|
is_applicable = True
|
||||||
@@ -239,7 +238,6 @@ class Specification:
|
|||||||
facet.status = bool(facet.failed_entities)
|
facet.status = bool(facet.failed_entities)
|
||||||
|
|
||||||
self.status = True
|
self.status = True
|
||||||
# if spec is required
|
|
||||||
if self.minOccurs != 0:
|
if self.minOccurs != 0:
|
||||||
if not self.applicable_entities:
|
if not self.applicable_entities:
|
||||||
self.status = False
|
self.status = False
|
||||||
@@ -247,11 +245,9 @@ class Specification:
|
|||||||
facet.status = False
|
facet.status = False
|
||||||
elif self.failed_entities:
|
elif self.failed_entities:
|
||||||
self.status = False
|
self.status = False
|
||||||
# if spec is optional
|
|
||||||
elif self.minOccurs == 0 and self.maxOccurs != 0:
|
elif self.minOccurs == 0 and self.maxOccurs != 0:
|
||||||
if self.failed_entities:
|
if self.failed_entities:
|
||||||
self.status = False
|
self.status = False
|
||||||
# if spec is prohibited
|
|
||||||
elif self.maxOccurs == 0:
|
elif self.maxOccurs == 0:
|
||||||
if (len(self.applicable_entities)) > 0 and len(self.requirements) == 0:
|
if (len(self.applicable_entities)) > 0 and len(self.requirements) == 0:
|
||||||
self.status = False
|
self.status = False
|
||||||
|
|||||||
Reference in New Issue
Block a user