mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-20 15:08:51 +00:00
ifctester - indicate optionality in report message
Previously for both cardinality optional/required ifctester would show same results. E.g. <ids:property dataType="IFCBOOLEAN" cardinality="required"> <ids:property dataType="IFCBOOLEAN" cardinality="optional"> Were resulting in something like LoadBearing data shall be true and in the dataset Pset_WallCommon LoadBearing data shall be true and in the dataset Pset_WallCommon Now it will result in LoadBearing data shall be true and in the dataset Pset_WallCommon LoadBearing data may be true and in the dataset Pset_WallCommon
This commit is contained in:
@@ -133,6 +133,10 @@ class Facet:
|
|||||||
if requirement.cardinality == "prohibited":
|
if requirement.cardinality == "prohibited":
|
||||||
is_prohibited = not is_prohibited
|
is_prohibited = not is_prohibited
|
||||||
templates = self.prohibited_templates if is_prohibited else self.requirement_templates
|
templates = self.prohibited_templates if is_prohibited else self.requirement_templates
|
||||||
|
if requirement.cardinality == "optional":
|
||||||
|
templates = [
|
||||||
|
t.replace("shall", "may").replace("Shall", "May").replace("must", "may") for t in templates
|
||||||
|
]
|
||||||
|
|
||||||
for template in templates:
|
for template in templates:
|
||||||
total_variables = len(template) - len(template.replace("{", ""))
|
total_variables = len(template) - len(template.replace("{", ""))
|
||||||
|
|||||||
Reference in New Issue
Block a user