pm4py / pm4py-core

Public repository for the PM4Py (Process Mining for Python) project.
https://pm4py.fit.fraunhofer.de
GNU General Public License v3.0
722 stars 286 forks source link

Is ':' in concept:name not allowed? #344

Closed treand closed 2 years ago

treand commented 2 years ago

Hello,

while working with heuristics nets I discovered that if the strings of 'concept:name' contain ':' the resulting figure will be not complete. Below a small example. I am using pm4py version '2.2.25'.

import numpy as np
from pm4py.algo.discovery.heuristics import algorithm as heuristics_miner
from pm4py.visualization.heuristics_net import visualizer as hn_visualizer

dummy = pd.DataFrame(np.array([
['A', '06/10/2021' , 'Begin gettingup' ],
['A', '06/11/2021' , 'eating'],
['A', '06/12/2021' , 'sleeping'],
['B', '06/12/2021' , 'Begin gettingup'],
['B', '06/13/2021' , 'eating'],
['B', '06/13/2021' , 'singing'],
['B', '06/14/2021' , 'sleeping'],
['C', '06/06/2021' , 'Begin gettingup'],
['C', '06/11/2021' , 'sleeping'],
['C', '06/12/2021' , 'eating'],
['D', '06/15/2021' , 'Begin yawning'],
['D', '06/16/2021' , 'eating'],
['E', '06/15/2021' , 'Begin yawning'],
['E', '06/17/2021' , 'eating'],
['E', '06/26/2021' , 'eating'],
['F', '06/11/2021' , 'Begin gettingup'],
['F', '06/15/2021' , 'sleeping']]),
columns=['case:concept:name', 'time:timestamp', 'concept:name'])

log = log_converter.apply(dummy)
heu_net = heuristics_miner.apply_heu(log)
gviz = hn_visualizer.apply(heu_net)
hn_visualizer.view(gviz)

The resulting figure:

f1

Then adding ':' to the starting activity:

dummy = pd.DataFrame(np.array([
['A', '06/10/2021' , 'Begin: gettingup' ],
['A', '06/11/2021' , 'eating'],
['A', '06/12/2021' , 'sleeping'],
['B', '06/12/2021' , 'Begin: gettingup'],
['B', '06/13/2021' , 'eating'],
['B', '06/13/2021' , 'singing'],
['B', '06/14/2021' , 'sleeping'],
['C', '06/06/2021' , 'Begin: gettingup'],
['C', '06/11/2021' , 'sleeping'],
['C', '06/12/2021' , 'eating'],
['D', '06/15/2021' , 'Begin: yawning'],
['D', '06/16/2021' , 'eating'],
['E', '06/15/2021' , 'Begin: yawning'],
['E', '06/17/2021' , 'eating'],
['E', '06/26/2021' , 'eating'],
['F', '06/11/2021' , 'Begin: gettingup'],
['F', '06/15/2021' , 'sleeping']]),
columns=['case:concept:name', 'time:timestamp', 'concept:name'])

log = log_converter.apply(dummy)
heu_net = heuristics_miner.apply_heu(log)
gviz = hn_visualizer.apply(heu_net)
hn_visualizer.view(gviz)

And the resulting figure:

f2

Thanks in advance for your help :)

Javert899 commented 2 years ago

Dear treand,

Thanks for signaling the problem. I can anticipate the problem is in the visualizer (pydotplus) that we use for heuristics net. It does not like the : very much in the node names. We identified a solution for it and come back to you when it will be released.

fit-alessandro-berti commented 2 years ago

Dear treand, the issue has been resolved in pm4py 2.2.26

Thanks for the collaboration and good luck for your projects!

treand commented 2 years ago

Thank you for the quick fix!