Allow IDS to audit any entity, not just IfcObjects

This commit is contained in:
Dion Moult
2022-05-10 22:13:28 +10:00
parent 4326a74c64
commit a78d6f42e5
2 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -177,7 +177,7 @@ class ids:
for spec in self.specifications: for spec in self.specifications:
self.ifc_applicable = 0 self.ifc_applicable = 0
self.ifc_passed = 0 self.ifc_passed = 0
for elem in ifc_file.by_type("IfcObject"): for elem in ifc_file:
apply, comply = spec(elem, logger) apply, comply = spec(elem, logger)
if apply: if apply:
self.ifc_applicable += 1 self.ifc_applicable += 1
@@ -211,7 +211,7 @@ class specification:
"""Represents the XML <specification> node and its two children <applicability> and <requirements>""" """Represents the XML <specification> node and its two children <applicability> and <requirements>"""
def __init__( def __init__(
self, name="Unnamed", use="required", ifcVersion="IFC2X3", identifier=None, description=None, instructions=None self, name="Unnamed", use="required", ifcVersion=["IFC2X3", "IFC4"], identifier=None, description=None, instructions=None
): ):
"""Create a specification to be added in ids. """Create a specification to be added in ids.
+3 -3
View File
@@ -224,7 +224,7 @@ class TestIdsAuthoring(unittest.TestCase):
assert spec.asdict() == { assert spec.asdict() == {
"@name": "Unnamed", "@name": "Unnamed",
"@use": "required", "@use": "required",
"@ifcVersion": "IFC2X3", # :( "@ifcVersion": ["IFC2X3", "IFC4"],
"applicability": {}, "applicability": {},
"requirements": {}, "requirements": {},
} }
@@ -233,7 +233,7 @@ class TestIdsAuthoring(unittest.TestCase):
spec = ids.specification( spec = ids.specification(
name="name", name="name",
use="use", use="use",
ifcVersion="version", ifcVersion="IFC4",
identifier="identifier", identifier="identifier",
description="description", description="description",
instructions="instructions", instructions="instructions",
@@ -241,7 +241,7 @@ class TestIdsAuthoring(unittest.TestCase):
assert spec.asdict() == { assert spec.asdict() == {
"@name": "name", "@name": "name",
"@use": "use", "@use": "use",
"@ifcVersion": "version", "@ifcVersion": "IFC4",
"@identifier": "identifier", "@identifier": "identifier",
"@description": "description", "@description": "description",
"@instructions": "instructions", "@instructions": "instructions",