IfcTester now includes percentages per requirement

This commit is contained in:
Dion Moult
2023-09-19 09:03:41 +10:00
parent 145f601a2e
commit 7e10d520f4
+5 -2
View File
@@ -211,16 +211,19 @@ class Json(Reporter):
requirements = []
for requirement in specification.requirements:
total_fail = len(requirement.failed_entities)
total_pass = total_applicable - total_fail
percent_pass = math.floor((total_pass / total_applicable) * 100) if total_applicable else "N/A"
total_checks += total_applicable
total_checks_pass += total_applicable - total_fail
total_checks_pass += total_pass
requirements.append(
{
"description": requirement.to_string("requirement"),
"status": requirement.status,
"failed_entities": self.report_failed_entities(requirement),
"total_applicable": total_applicable,
"total_pass": total_applicable - total_fail,
"total_pass": total_pass,
"total_fail": total_fail,
"percent_pass": percent_pass,
}
)
total_applicable_pass = total_applicable - len(specification.failed_entities)