mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-24 20:50:02 +00:00
Don't fail on empty ReferencedSource in IfcTester
This commit is contained in:
@@ -54,7 +54,7 @@ def get_references(element: ifcopenshell.entity_instance, should_inherit=True) -
|
|||||||
def get_classification(reference: ifcopenshell.entity_instance) -> ifcopenshell.entity_instance:
|
def get_classification(reference: ifcopenshell.entity_instance) -> ifcopenshell.entity_instance:
|
||||||
if reference.is_a("IfcClassification"):
|
if reference.is_a("IfcClassification"):
|
||||||
return reference
|
return reference
|
||||||
return get_classification(reference.ReferencedSource)
|
return get_classification(reference.ReferencedSource) if reference.ReferencedSource is not None else None
|
||||||
|
|
||||||
|
|
||||||
def get_inherited_references(reference: Optional[ifcopenshell.entity_instance]) -> list[ifcopenshell.entity_instance]:
|
def get_inherited_references(reference: Optional[ifcopenshell.entity_instance]) -> list[ifcopenshell.entity_instance]:
|
||||||
|
|||||||
@@ -416,7 +416,8 @@ class Classification(Facet):
|
|||||||
reason = {"type": "VALUE", "actual": values}
|
reason = {"type": "VALUE", "actual": values}
|
||||||
|
|
||||||
if is_pass:
|
if is_pass:
|
||||||
systems = [ifcopenshell.util.classification.get_classification(r).Name for r in references]
|
classifications = filter(None, (ifcopenshell.util.classification.get_classification(r) for r in references))
|
||||||
|
systems = [r.Name for r in classifications]
|
||||||
is_pass = any([self.system == s for s in systems])
|
is_pass = any([self.system == s for s in systems])
|
||||||
if not is_pass:
|
if not is_pass:
|
||||||
reason = {"type": "SYSTEM", "actual": systems}
|
reason = {"type": "SYSTEM", "actual": systems}
|
||||||
|
|||||||
Reference in New Issue
Block a user