mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +00:00
cleanup
This commit is contained in:
@@ -202,15 +202,14 @@ class Specification:
|
||||
|
||||
elements = []
|
||||
|
||||
if self.applicability:
|
||||
for i, facet in enumerate(self.applicability):
|
||||
# Usually, we rely on an entity applicability to give us our first
|
||||
# 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
|
||||
# check everything.
|
||||
if i == 0 and not isinstance(facet, Entity):
|
||||
elements = list(ifc_file)
|
||||
elements = facet.filter(ifc_file, elements)
|
||||
for i, facet in enumerate(self.applicability):
|
||||
# Usually, we rely on an entity applicability to give us our first
|
||||
# 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
|
||||
# check everything.
|
||||
if i == 0 and not isinstance(facet, Entity):
|
||||
elements = list(ifc_file)
|
||||
elements = facet.filter(ifc_file, elements)
|
||||
|
||||
for element in elements:
|
||||
is_applicable = True
|
||||
@@ -239,7 +238,6 @@ class Specification:
|
||||
facet.status = bool(facet.failed_entities)
|
||||
|
||||
self.status = True
|
||||
# if spec is required
|
||||
if self.minOccurs != 0:
|
||||
if not self.applicable_entities:
|
||||
self.status = False
|
||||
@@ -247,11 +245,9 @@ class Specification:
|
||||
facet.status = False
|
||||
elif self.failed_entities:
|
||||
self.status = False
|
||||
# if spec is optional
|
||||
elif self.minOccurs == 0 and self.maxOccurs != 0:
|
||||
if self.failed_entities:
|
||||
self.status = False
|
||||
# if spec is prohibited
|
||||
elif self.maxOccurs == 0:
|
||||
if (len(self.applicable_entities)) > 0 and len(self.requirements) == 0:
|
||||
self.status = False
|
||||
|
||||
Reference in New Issue
Block a user