mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 01:41:57 +00:00
Allow IDS to audit any entity, not just IfcObjects
This commit is contained in:
@@ -177,7 +177,7 @@ class ids:
|
||||
for spec in self.specifications:
|
||||
self.ifc_applicable = 0
|
||||
self.ifc_passed = 0
|
||||
for elem in ifc_file.by_type("IfcObject"):
|
||||
for elem in ifc_file:
|
||||
apply, comply = spec(elem, logger)
|
||||
if apply:
|
||||
self.ifc_applicable += 1
|
||||
@@ -211,7 +211,7 @@ class specification:
|
||||
"""Represents the XML <specification> node and its two children <applicability> and <requirements>"""
|
||||
|
||||
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.
|
||||
|
||||
|
||||
@@ -224,7 +224,7 @@ class TestIdsAuthoring(unittest.TestCase):
|
||||
assert spec.asdict() == {
|
||||
"@name": "Unnamed",
|
||||
"@use": "required",
|
||||
"@ifcVersion": "IFC2X3", # :(
|
||||
"@ifcVersion": ["IFC2X3", "IFC4"],
|
||||
"applicability": {},
|
||||
"requirements": {},
|
||||
}
|
||||
@@ -233,7 +233,7 @@ class TestIdsAuthoring(unittest.TestCase):
|
||||
spec = ids.specification(
|
||||
name="name",
|
||||
use="use",
|
||||
ifcVersion="version",
|
||||
ifcVersion="IFC4",
|
||||
identifier="identifier",
|
||||
description="description",
|
||||
instructions="instructions",
|
||||
@@ -241,7 +241,7 @@ class TestIdsAuthoring(unittest.TestCase):
|
||||
assert spec.asdict() == {
|
||||
"@name": "name",
|
||||
"@use": "use",
|
||||
"@ifcVersion": "version",
|
||||
"@ifcVersion": "IFC4",
|
||||
"@identifier": "identifier",
|
||||
"@description": "description",
|
||||
"@instructions": "instructions",
|
||||
|
||||
Reference in New Issue
Block a user