mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +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":
|
||||
is_prohibited = not is_prohibited
|
||||
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:
|
||||
total_variables = len(template) - len(template.replace("{", ""))
|
||||
|
||||
Reference in New Issue
Block a user