Skip to content

Commit b0b386e

Browse files
authored
Merge pull request #83 from OleSeifert/frontend-integration
2 parents da62d86 + 04169a6 commit b0b386e

3 files changed

Lines changed: 153 additions & 96 deletions

File tree

backend/conformance_checking/declarative_constraints.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
import pandas as pd # type: ignore
1111
import pm4py # type: ignore
12-
from pm4py.algo.conformance.declare import algorithm as decl_conf # type: ignore
12+
from pm4py.algo.conformance.declare import algorithm as dc # type: ignore
1313

1414
# **************** Type Aliases ****************
1515

@@ -184,9 +184,11 @@ def rule_specific_violation_summary(
184184
A, B = rule_key # type: ignore
185185
else:
186186
A, B = rule_key, None # type: ignore
187-
diagnostics = decl_conf.apply(log, {rule_name: {(A, B): rule_info}}) # type: ignore
188-
violated = [
189-
d for d in diagnostics if d["dev_fitness"] < self.fitness_score
187+
diagnostics = dc.apply(log, {rule_name: {(A, B): rule_info}}) # type: ignore
188+
violated = [ # type: ignore
189+
d
190+
for d in diagnostics
191+
if d["dev_fitness"] <= self.fitness_score # type: ignore
190192
] # type: ignore
191193
violation_count = len(violated) # type: ignore
192194

@@ -195,7 +197,7 @@ def rule_specific_violation_summary(
195197
table_headers = [
196198
"First Activity",
197199
"Second Activity",
198-
"# Violations",
200+
"# Conforming Rules",
199201
]
200202
graph_nodes.append(A) # type: ignore
201203
graph_nodes.append(B) # type: ignore
@@ -204,7 +206,7 @@ def rule_specific_violation_summary(
204206
)
205207
table_rows.append([A, B, str(violation_count)]) # type: ignore
206208
else:
207-
table_headers = ["Activity", "# Violations"]
209+
table_headers = ["Activity", "# Conforming Rules"]
208210
table_rows.append([A, str(violation_count)]) # type: ignore
209211
graph_nodes = [{"id": node} for node in list(set(list(graph_nodes)))] # type: ignore
210212

0 commit comments

Comments
 (0)