Skip to content

Commit

Permalink
Merge pull request #479 from nicoelbert/release
Browse files Browse the repository at this point in the history
Enhancements to Timeline DFG Graph Visualization: Cleanup and Error Handling Improvement
  • Loading branch information
fit-alessandro-berti authored Apr 10, 2024
2 parents c86a335 + 1751c02 commit 66979d1
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pm4py/visualization/dfg/variants/timeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
from pm4py.util import xes_constants as xes
from pm4py.visualization.common.utils import *
from pm4py.util import exec_utils
from pm4py.statistics.sojourn_time.log import get as soj_time_get
from enum import Enum
from pm4py.util import constants
from typing import Optional, Dict, Any, Tuple, no_type_check_decorator
Expand Down Expand Up @@ -262,13 +261,15 @@ def graphviz_visualization(activities_count, dfg, dfg_time : Dict, image_format=
s.attr(rank='same')
s.node(hash_time)
for values in time_act_dict[hash_time]:
s.node(dd[values][0])
s.node(dd[values][0])
try:
s.node(dd[values][1])
except:
warnings.warn(dd[values])

except IndexError:
warnings.warn(f"Data alignment issue: '{values}' does not have a corresponding timestamp or second element. Ensure each activity is properly matched with a timestamp.")
except Exception as e:
warnings.warn(f"Unexpected error for '{values}': {e}")


viz.subgraph(s)

viz.attr(overlap='true')
Expand Down

0 comments on commit 66979d1

Please sign in to comment.