mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-20 23:36:20 +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:
|
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.
|
||||||
|
|
||||||
|
|||||||
@@ -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",
|
||||||
|
|||||||
Reference in New Issue
Block a user