From a7dc86f7fd821b5dd229ff404b5afa3b5ad919b4 Mon Sep 17 00:00:00 2001 From: Alessandro Berti Date: Tue, 26 Sep 2023 11:20:18 +0200 Subject: [PATCH 01/27] feat(pm4py): disable IM fallthroughs in the simplified interface --- pm4py/discovery.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/pm4py/discovery.py b/pm4py/discovery.py index 8fb1e8dd7..037a305f8 100644 --- a/pm4py/discovery.py +++ b/pm4py/discovery.py @@ -275,7 +275,7 @@ def discover_petri_net_alpha_plus(log: Union[EventLog, pd.DataFrame], activity_k return alpha_miner.apply(log, variant=alpha_miner.Variants.ALPHA_VERSION_PLUS, parameters=get_properties(log, activity_key=activity_key, timestamp_key=timestamp_key, case_id_key=case_id_key)) -def discover_petri_net_inductive(log: Union[EventLog, pd.DataFrame, DFG], multi_processing: bool = constants.ENABLE_MULTIPROCESSING_DEFAULT, noise_threshold: float = 0.0, activity_key: str = "concept:name", timestamp_key: str = "time:timestamp", case_id_key: str = "case:concept:name") -> Tuple[ +def discover_petri_net_inductive(log: Union[EventLog, pd.DataFrame, DFG], multi_processing: bool = constants.ENABLE_MULTIPROCESSING_DEFAULT, noise_threshold: float = 0.0, activity_key: str = "concept:name", timestamp_key: str = "time:timestamp", case_id_key: str = "case:concept:name", disable_fallthroughs: bool = False) -> Tuple[ PetriNet, Marking, Marking]: """ Discovers a Petri net using the inductive miner algorithm. @@ -290,6 +290,7 @@ def discover_petri_net_inductive(log: Union[EventLog, pd.DataFrame, DFG], multi_ :param activity_key: attribute to be used for the activity :param timestamp_key: attribute to be used for the timestamp :param case_id_key: attribute to be used as case identifier + :param disable_fallthroughs: disable the Inductive Miner fall-throughs :rtype: ``Tuple[PetriNet, Marking, Marking]`` .. code-block:: python3 @@ -308,7 +309,7 @@ def discover_petri_net_inductive(log: Union[EventLog, pd.DataFrame, DFG], multi_ log, activity_key=activity_key, timestamp_key=timestamp_key, case_id_key=case_id_key) pt = discover_process_tree_inductive( - log, noise_threshold, multi_processing=multi_processing, activity_key=activity_key, timestamp_key=timestamp_key, case_id_key=case_id_key) + log, noise_threshold, multi_processing=multi_processing, activity_key=activity_key, timestamp_key=timestamp_key, case_id_key=case_id_key, disable_fallthroughs=disable_fallthroughs) from pm4py.convert import convert_to_petri_net return convert_to_petri_net(pt) @@ -357,7 +358,7 @@ def discover_petri_net_heuristics(log: Union[EventLog, pd.DataFrame], dependency return heuristics_miner.apply(log, parameters=parameters) -def discover_process_tree_inductive(log: Union[EventLog, pd.DataFrame, DFG], noise_threshold: float = 0.0, multi_processing: bool = constants.ENABLE_MULTIPROCESSING_DEFAULT, activity_key: str = "concept:name", timestamp_key: str = "time:timestamp", case_id_key: str = "case:concept:name") -> ProcessTree: +def discover_process_tree_inductive(log: Union[EventLog, pd.DataFrame, DFG], noise_threshold: float = 0.0, multi_processing: bool = constants.ENABLE_MULTIPROCESSING_DEFAULT, activity_key: str = "concept:name", timestamp_key: str = "time:timestamp", case_id_key: str = "case:concept:name", disable_fallthroughs: bool = False) -> ProcessTree: """ Discovers a process tree using the inductive miner algorithm @@ -371,6 +372,7 @@ def discover_process_tree_inductive(log: Union[EventLog, pd.DataFrame, DFG], noi :param multi_processing: boolean that enables/disables multiprocessing in inductive miner :param timestamp_key: attribute to be used for the timestamp :param case_id_key: attribute to be used as case identifier + :param disable_fallthroughs: disable the Inductive Miner fall-throughs :rtype: ``ProcessTree`` .. code-block:: python3 @@ -393,6 +395,7 @@ def discover_process_tree_inductive(log: Union[EventLog, pd.DataFrame, DFG], noi log, activity_key=activity_key, timestamp_key=timestamp_key, case_id_key=case_id_key) parameters["noise_threshold"] = noise_threshold parameters["multiprocessing"] = multi_processing + parameters["disable_fallthroughs"] = disable_fallthroughs variant = inductive_miner.Variants.IMf if noise_threshold > 0 else inductive_miner.Variants.IM @@ -539,7 +542,7 @@ def discover_eventually_follows_graph(log: Union[EventLog, pd.DataFrame], activi return get.apply(log, parameters=properties) -def discover_bpmn_inductive(log: Union[EventLog, pd.DataFrame, DFG], noise_threshold: float = 0.0, multi_processing: bool = constants.ENABLE_MULTIPROCESSING_DEFAULT, activity_key: str = "concept:name", timestamp_key: str = "time:timestamp", case_id_key: str = "case:concept:name") -> BPMN: +def discover_bpmn_inductive(log: Union[EventLog, pd.DataFrame, DFG], noise_threshold: float = 0.0, multi_processing: bool = constants.ENABLE_MULTIPROCESSING_DEFAULT, activity_key: str = "concept:name", timestamp_key: str = "time:timestamp", case_id_key: str = "case:concept:name", disable_fallthroughs: bool = False) -> BPMN: """ Discovers a BPMN using the Inductive Miner algorithm @@ -553,6 +556,7 @@ def discover_bpmn_inductive(log: Union[EventLog, pd.DataFrame, DFG], noise_thres :param activity_key: attribute to be used for the activity :param timestamp_key: attribute to be used for the timestamp :param case_id_key: attribute to be used as case identifier + :param disable_fallthroughs: disable the Inductive Miner fall-throughs :rtype: ``BPMN`` .. code-block:: python3 @@ -571,7 +575,7 @@ def discover_bpmn_inductive(log: Union[EventLog, pd.DataFrame, DFG], noise_thres log, activity_key=activity_key, timestamp_key=timestamp_key, case_id_key=case_id_key) pt = discover_process_tree_inductive( - log, noise_threshold, multi_processing=multi_processing, activity_key=activity_key, timestamp_key=timestamp_key, case_id_key=case_id_key) + log, noise_threshold, multi_processing=multi_processing, activity_key=activity_key, timestamp_key=timestamp_key, case_id_key=case_id_key, disable_fallthroughs=disable_fallthroughs) from pm4py.convert import convert_to_bpmn return convert_to_bpmn(pt) From e51c5e1e084a7fd7d13cb8d1381f868435762cca Mon Sep 17 00:00:00 2001 From: Alessandro Berti Date: Tue, 26 Sep 2023 12:00:18 +0200 Subject: [PATCH 02/27] fix(pm4py): fixing TBR diagnostics when the methods are called on dataframes --- .../tokenreplay/diagnostics/duration_diagnostics.py | 5 +++++ .../tokenreplay/diagnostics/root_cause_analysis.py | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/pm4py/algo/conformance/tokenreplay/diagnostics/duration_diagnostics.py b/pm4py/algo/conformance/tokenreplay/diagnostics/duration_diagnostics.py index ba58e70c4..53830dd14 100644 --- a/pm4py/algo/conformance/tokenreplay/diagnostics/duration_diagnostics.py +++ b/pm4py/algo/conformance/tokenreplay/diagnostics/duration_diagnostics.py @@ -7,6 +7,7 @@ from enum import Enum from pm4py.util import exec_utils from pm4py.util import constants +from pm4py.objects.conversion.log import converter as log_converter class Parameters(Enum): @@ -76,6 +77,8 @@ def diagnose_from_notexisting_activities(log, notexisting_activities_in_model, p if parameters is None: parameters = {} + log = log_converter.apply(log, variant=log_converter.Variants.TO_EVENT_LOG, parameters=parameters) + timestamp_key = exec_utils.get_param_value(Parameters.TIMESTAMP_KEY, parameters, xes.DEFAULT_TIMESTAMP_KEY) diagnostics = {} @@ -129,6 +132,8 @@ def diagnose_from_trans_fitness(log, trans_fitness, parameters=None): if parameters is None: parameters = {} + log = log_converter.apply(log, variant=log_converter.Variants.TO_EVENT_LOG, parameters=parameters) + timestamp_key = exec_utils.get_param_value(Parameters.TIMESTAMP_KEY, parameters, xes.DEFAULT_TIMESTAMP_KEY) diagnostics = {} diff --git a/pm4py/algo/conformance/tokenreplay/diagnostics/root_cause_analysis.py b/pm4py/algo/conformance/tokenreplay/diagnostics/root_cause_analysis.py index 64e12de4f..5b560c5dd 100644 --- a/pm4py/algo/conformance/tokenreplay/diagnostics/root_cause_analysis.py +++ b/pm4py/algo/conformance/tokenreplay/diagnostics/root_cause_analysis.py @@ -6,6 +6,7 @@ from pm4py.objects.log.obj import EventLog, Trace, Event from pm4py.objects.log.util import basic_filter from pm4py.util import exec_utils +from pm4py.objects.conversion.log import converter as log_converter class Parameters(Enum): @@ -128,6 +129,8 @@ def diagnose_from_trans_fitness(log, trans_fitness, parameters=None): if parameters is None: parameters = {} + log = log_converter.apply(log, variant=log_converter.Variants.TO_EVENT_LOG, parameters=parameters) + diagnostics = {} string_attributes = exec_utils.get_param_value(Parameters.STRING_ATTRIBUTES, parameters, []) numeric_attributes = exec_utils.get_param_value(Parameters.NUMERIC_ATTRIBUTES, parameters, []) @@ -209,6 +212,8 @@ def diagnose_from_notexisting_activities(log, notexisting_activities_in_model, p if parameters is None: parameters = {} + log = log_converter.apply(log, variant=log_converter.Variants.TO_EVENT_LOG, parameters=parameters) + diagnostics = {} string_attributes = exec_utils.get_param_value(Parameters.STRING_ATTRIBUTES, parameters, []) numeric_attributes = exec_utils.get_param_value(Parameters.NUMERIC_ATTRIBUTES, parameters, []) From d1b39bde1b14f160c0fff42bdc6b172bb0ae760e Mon Sep 17 00:00:00 2001 From: Alessandro Berti Date: Wed, 27 Sep 2023 07:42:39 +0200 Subject: [PATCH 03/27] fix(pm4py): fix Petri net serialization --- pm4py/visualization/petri_net/visualizer.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pm4py/visualization/petri_net/visualizer.py b/pm4py/visualization/petri_net/visualizer.py index 02c73314c..8cfe607d3 100644 --- a/pm4py/visualization/petri_net/visualizer.py +++ b/pm4py/visualization/petri_net/visualizer.py @@ -10,6 +10,7 @@ from pm4py.objects.log.obj import EventLog, EventStream import pandas as pd from pm4py.objects.log.util import dataframe_utils +from pm4py.visualization.common.gview import serialize, serialize_dot import graphviz From 0db9ecb81c3c56bc047ca8aa729da7f1582d48c5 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Wed, 27 Sep 2023 22:22:13 +0000 Subject: [PATCH 04/27] chore(deps): update dependency scipy to v1.11.3 --- requirements_stable.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements_stable.txt b/requirements_stable.txt index 304e3da32..5fa00df4a 100644 --- a/requirements_stable.txt +++ b/requirements_stable.txt @@ -17,7 +17,7 @@ pydotplus==2.0.2 pyparsing==3.1.1 python-dateutil==2.8.2 pytz==2023.3.post1 -scipy==1.11.2 +scipy==1.11.3 six==1.16.0 sortedcontainers==2.4.0 StringDist==1.0.9 From 0be5662529a82b5942fd1d3d2593d0e487482f1d Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 29 Sep 2023 00:21:34 +0000 Subject: [PATCH 05/27] chore(deps): update dependency cycler to v0.12.0 --- requirements_stable.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements_stable.txt b/requirements_stable.txt index 304e3da32..55343faac 100644 --- a/requirements_stable.txt +++ b/requirements_stable.txt @@ -1,6 +1,6 @@ colorama==0.4.6 contourpy==1.1.1 -cycler==0.11.0 +cycler==0.12.0 deprecation==2.1.0 fonttools==4.42.1 graphviz==0.20.1 From 232c4a67371dbd19692b8cda7396686525ff7839 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 29 Sep 2023 12:21:52 +0000 Subject: [PATCH 06/27] chore(deps): update dependency fonttools to v4.43.0 --- requirements_stable.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements_stable.txt b/requirements_stable.txt index 304e3da32..2acc9082f 100644 --- a/requirements_stable.txt +++ b/requirements_stable.txt @@ -2,7 +2,7 @@ colorama==0.4.6 contourpy==1.1.1 cycler==0.11.0 deprecation==2.1.0 -fonttools==4.42.1 +fonttools==4.43.0 graphviz==0.20.1 intervaltree==3.1.0 kiwisolver==1.4.5 From 4e268dea4c60345c745f99d08ea90b202f8e6442 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sun, 1 Oct 2023 14:27:44 +0000 Subject: [PATCH 07/27] chore(deps): update dependency packaging to v23.2 --- requirements_stable.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements_stable.txt b/requirements_stable.txt index 304e3da32..dd94637d8 100644 --- a/requirements_stable.txt +++ b/requirements_stable.txt @@ -10,7 +10,7 @@ lxml==4.9.3 matplotlib==3.8.0 networkx==3.1 numpy==1.26.0 -packaging==23.1 +packaging==23.2 pandas==2.1.1 Pillow==10.0.1 pydotplus==2.0.2 From 08c2c16d17d2cbe26224662032a298f6b0a409a9 Mon Sep 17 00:00:00 2001 From: Alessandro Berti Date: Wed, 4 Oct 2023 07:26:41 +0200 Subject: [PATCH 08/27] feat(pm4py): avoiding setup.py recreation --- setup.py | 226 +------------------------------------------------------ 1 file changed, 2 insertions(+), 224 deletions(-) diff --git a/setup.py b/setup.py index f3234b7c8..09c5caf8f 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ import runpy from os.path import dirname, join from pathlib import Path -from setuptools import setup +from setuptools import setup, find_packages # Import only the metadata of the pm4py to use in the setup. We cannot import it directly because @@ -24,229 +24,7 @@ def read_file(filename): author_email=meta['__author_email__'], py_modules=['pm4py'], include_package_data=True, - packages=['pm4py', 'pm4py.algo', 'pm4py.algo.merging', 'pm4py.algo.merging.case_relations', - 'pm4py.algo.merging.case_relations.variants', 'pm4py.algo.analysis', 'pm4py.algo.analysis.woflan', - 'pm4py.algo.analysis.woflan.graphs', 'pm4py.algo.analysis.woflan.graphs.reachability_graph', - 'pm4py.algo.analysis.woflan.graphs.minimal_coverability_graph', - 'pm4py.algo.analysis.woflan.graphs.restricted_coverability_graph', - 'pm4py.algo.analysis.woflan.place_invariants', 'pm4py.algo.analysis.woflan.not_well_handled_pairs', - 'pm4py.algo.analysis.workflow_net', 'pm4py.algo.analysis.workflow_net.variants', - 'pm4py.algo.analysis.marking_equation', 'pm4py.algo.analysis.marking_equation.variants', - 'pm4py.algo.analysis.extended_marking_equation', 'pm4py.algo.analysis.extended_marking_equation.variants', - 'pm4py.algo.querying', 'pm4py.algo.querying.llm', 'pm4py.algo.querying.llm.connectors', - 'pm4py.algo.querying.llm.abstractions', 'pm4py.algo.discovery', 'pm4py.algo.discovery.dfg', - 'pm4py.algo.discovery.dfg.utils', 'pm4py.algo.discovery.dfg.adapters', - 'pm4py.algo.discovery.dfg.adapters.pandas', 'pm4py.algo.discovery.dfg.variants', - 'pm4py.algo.discovery.ilp', 'pm4py.algo.discovery.ilp.variants', 'pm4py.algo.discovery.ocel', - 'pm4py.algo.discovery.ocel.ocpn', 'pm4py.algo.discovery.ocel.ocpn.variants', - 'pm4py.algo.discovery.ocel.ocdfg', 'pm4py.algo.discovery.ocel.ocdfg.variants', - 'pm4py.algo.discovery.ocel.saw_nets', 'pm4py.algo.discovery.ocel.saw_nets.variants', - 'pm4py.algo.discovery.ocel.interleavings', 'pm4py.algo.discovery.ocel.interleavings.utils', - 'pm4py.algo.discovery.ocel.interleavings.variants', 'pm4py.algo.discovery.ocel.link_analysis', - 'pm4py.algo.discovery.ocel.link_analysis.variants', 'pm4py.algo.discovery.powl', - 'pm4py.algo.discovery.powl.inductive', 'pm4py.algo.discovery.powl.inductive.cuts', - 'pm4py.algo.discovery.powl.inductive.variants', 'pm4py.algo.discovery.powl.inductive.variants.clustering', - 'pm4py.algo.discovery.powl.inductive.variants.brute_force', - 'pm4py.algo.discovery.powl.inductive.base_case', 'pm4py.algo.discovery.powl.inductive.fall_through', - 'pm4py.algo.discovery.alpha', 'pm4py.algo.discovery.alpha.utils', 'pm4py.algo.discovery.alpha.variants', - 'pm4py.algo.discovery.alpha.data_structures', 'pm4py.algo.discovery.causal', - 'pm4py.algo.discovery.causal.variants', 'pm4py.algo.discovery.batches', - 'pm4py.algo.discovery.batches.utils', 'pm4py.algo.discovery.batches.variants', - 'pm4py.algo.discovery.declare', 'pm4py.algo.discovery.declare.variants', 'pm4py.algo.discovery.inductive', - 'pm4py.algo.discovery.inductive.cuts', 'pm4py.algo.discovery.inductive.dtypes', - 'pm4py.algo.discovery.inductive.variants', 'pm4py.algo.discovery.inductive.base_case', - 'pm4py.algo.discovery.inductive.fall_through', 'pm4py.algo.discovery.footprints', - 'pm4py.algo.discovery.footprints.dfg', 'pm4py.algo.discovery.footprints.dfg.variants', - 'pm4py.algo.discovery.footprints.log', 'pm4py.algo.discovery.footprints.log.variants', - 'pm4py.algo.discovery.footprints.tree', 'pm4py.algo.discovery.footprints.tree.variants', - 'pm4py.algo.discovery.footprints.petri', 'pm4py.algo.discovery.footprints.petri.variants', - 'pm4py.algo.discovery.heuristics', 'pm4py.algo.discovery.heuristics.variants', - 'pm4py.algo.discovery.log_skeleton', 'pm4py.algo.discovery.log_skeleton.variants', - 'pm4py.algo.discovery.temporal_profile', 'pm4py.algo.discovery.temporal_profile.variants', - 'pm4py.algo.discovery.transition_system', 'pm4py.algo.discovery.transition_system.variants', - 'pm4py.algo.discovery.correlation_mining', 'pm4py.algo.discovery.correlation_mining.variants', - 'pm4py.algo.discovery.performance_spectrum', 'pm4py.algo.discovery.performance_spectrum.variants', - 'pm4py.algo.discovery.minimum_self_distance', 'pm4py.algo.discovery.minimum_self_distance.variants', - 'pm4py.algo.filtering', 'pm4py.algo.filtering.dfg', 'pm4py.algo.filtering.log', - 'pm4py.algo.filtering.log.ltl', 'pm4py.algo.filtering.log.cases', 'pm4py.algo.filtering.log.paths', - 'pm4py.algo.filtering.log.rework', 'pm4py.algo.filtering.log.between', - 'pm4py.algo.filtering.log.prefixes', 'pm4py.algo.filtering.log.suffixes', - 'pm4py.algo.filtering.log.variants', 'pm4py.algo.filtering.log.timestamp', - 'pm4py.algo.filtering.log.attributes', 'pm4py.algo.filtering.log.end_activities', - 'pm4py.algo.filtering.log.start_activities', 'pm4py.algo.filtering.log.attr_value_repetition', - 'pm4py.algo.filtering.ocel', 'pm4py.algo.filtering.common', 'pm4py.algo.filtering.common.timestamp', - 'pm4py.algo.filtering.common.attributes', 'pm4py.algo.filtering.common.end_activities', - 'pm4py.algo.filtering.common.start_activities', 'pm4py.algo.filtering.pandas', - 'pm4py.algo.filtering.pandas.ltl', 'pm4py.algo.filtering.pandas.cases', - 'pm4py.algo.filtering.pandas.paths', 'pm4py.algo.filtering.pandas.rework', - 'pm4py.algo.filtering.pandas.traces', 'pm4py.algo.filtering.pandas.between', - 'pm4py.algo.filtering.pandas.prefixes', 'pm4py.algo.filtering.pandas.suffixes', - 'pm4py.algo.filtering.pandas.variants', 'pm4py.algo.filtering.pandas.ends_with', - 'pm4py.algo.filtering.pandas.timestamp', 'pm4py.algo.filtering.pandas.attributes', - 'pm4py.algo.filtering.pandas.starts_with', 'pm4py.algo.filtering.pandas.end_activities', - 'pm4py.algo.filtering.pandas.start_activities', 'pm4py.algo.filtering.pandas.attr_value_repetition', - 'pm4py.algo.filtering.pandas.timestamp_case_grouping', - 'pm4py.algo.filtering.pandas.consecutive_act_case_grouping', 'pm4py.algo.reduction', - 'pm4py.algo.reduction.process_tree', 'pm4py.algo.reduction.process_tree.variants', - 'pm4py.algo.clustering', 'pm4py.algo.clustering.profiles', 'pm4py.algo.clustering.profiles.variants', - 'pm4py.algo.clustering.trace_attribute_driven', 'pm4py.algo.clustering.trace_attribute_driven.dfg', - 'pm4py.algo.clustering.trace_attribute_driven.util', - 'pm4py.algo.clustering.trace_attribute_driven.variants', - 'pm4py.algo.clustering.trace_attribute_driven.merge_log', - 'pm4py.algo.clustering.trace_attribute_driven.leven_dist', - 'pm4py.algo.clustering.trace_attribute_driven.linkage_method', 'pm4py.algo.comparison', - 'pm4py.algo.comparison.petrinet', 'pm4py.algo.connectors', 'pm4py.algo.connectors.util', - 'pm4py.algo.connectors.variants', 'pm4py.algo.evaluation', 'pm4py.algo.evaluation.precision', - 'pm4py.algo.evaluation.precision.dfg', 'pm4py.algo.evaluation.precision.variants', - 'pm4py.algo.evaluation.simplicity', 'pm4py.algo.evaluation.simplicity.variants', - 'pm4py.algo.evaluation.generalization', 'pm4py.algo.evaluation.generalization.variants', - 'pm4py.algo.evaluation.replay_fitness', 'pm4py.algo.evaluation.replay_fitness.variants', - 'pm4py.algo.evaluation.earth_mover_distance', 'pm4py.algo.evaluation.earth_mover_distance.variants', - 'pm4py.algo.simulation', 'pm4py.algo.simulation.playout', 'pm4py.algo.simulation.playout.dfg', - 'pm4py.algo.simulation.playout.dfg.variants', 'pm4py.algo.simulation.playout.petri_net', - 'pm4py.algo.simulation.playout.petri_net.variants', 'pm4py.algo.simulation.playout.process_tree', - 'pm4py.algo.simulation.playout.process_tree.variants', 'pm4py.algo.simulation.montecarlo', - 'pm4py.algo.simulation.montecarlo.utils', 'pm4py.algo.simulation.montecarlo.variants', - 'pm4py.algo.simulation.tree_generator', 'pm4py.algo.simulation.tree_generator.variants', - 'pm4py.algo.conformance', 'pm4py.algo.conformance.declare', 'pm4py.algo.conformance.declare.variants', - 'pm4py.algo.conformance.alignments', 'pm4py.algo.conformance.alignments.dfg', - 'pm4py.algo.conformance.alignments.dfg.variants', 'pm4py.algo.conformance.alignments.petri_net', - 'pm4py.algo.conformance.alignments.petri_net.utils', - 'pm4py.algo.conformance.alignments.petri_net.variants', 'pm4py.algo.conformance.alignments.decomposed', - 'pm4py.algo.conformance.alignments.decomposed.variants', 'pm4py.algo.conformance.alignments.process_tree', - 'pm4py.algo.conformance.alignments.process_tree.util', - 'pm4py.algo.conformance.alignments.process_tree.variants', - 'pm4py.algo.conformance.alignments.process_tree.variants.approximated', - 'pm4py.algo.conformance.alignments.edit_distance', - 'pm4py.algo.conformance.alignments.edit_distance.variants', 'pm4py.algo.conformance.footprints', - 'pm4py.algo.conformance.footprints.util', 'pm4py.algo.conformance.footprints.variants', - 'pm4py.algo.conformance.tokenreplay', 'pm4py.algo.conformance.tokenreplay.variants', - 'pm4py.algo.conformance.tokenreplay.diagnostics', 'pm4py.algo.conformance.log_skeleton', - 'pm4py.algo.conformance.log_skeleton.variants', 'pm4py.algo.conformance.antialignments', - 'pm4py.algo.conformance.antialignments.variants', 'pm4py.algo.conformance.multialignments', - 'pm4py.algo.conformance.multialignments.variants', 'pm4py.algo.conformance.temporal_profile', - 'pm4py.algo.conformance.temporal_profile.variants', 'pm4py.algo.anonymization', - 'pm4py.algo.anonymization.pripel', 'pm4py.algo.anonymization.pripel.util', - 'pm4py.algo.anonymization.pripel.variants', 'pm4py.algo.anonymization.trace_variant_query', - 'pm4py.algo.anonymization.trace_variant_query.util', - 'pm4py.algo.anonymization.trace_variant_query.variants', 'pm4py.algo.transformation', - 'pm4py.algo.transformation.ocel', 'pm4py.algo.transformation.ocel.graphs', - 'pm4py.algo.transformation.ocel.features', 'pm4py.algo.transformation.ocel.features.events', - 'pm4py.algo.transformation.ocel.features.objects', - 'pm4py.algo.transformation.ocel.features.events_objects', 'pm4py.algo.transformation.ocel.split_ocel', - 'pm4py.algo.transformation.ocel.split_ocel.variants', 'pm4py.algo.transformation.ocel.description', - 'pm4py.algo.transformation.ocel.description.variants', 'pm4py.algo.transformation.log_to_trie', - 'pm4py.algo.transformation.log_to_target', 'pm4py.algo.transformation.log_to_target.variants', - 'pm4py.algo.transformation.log_to_features', 'pm4py.algo.transformation.log_to_features.util', - 'pm4py.algo.transformation.log_to_features.variants', 'pm4py.algo.transformation.log_to_interval_tree', - 'pm4py.algo.transformation.log_to_interval_tree.variants', 'pm4py.algo.decision_mining', - 'pm4py.algo.organizational_mining', 'pm4py.algo.organizational_mining.sna', - 'pm4py.algo.organizational_mining.sna.variants', 'pm4py.algo.organizational_mining.sna.variants.log', - 'pm4py.algo.organizational_mining.sna.variants.pandas', 'pm4py.algo.organizational_mining.roles', - 'pm4py.algo.organizational_mining.roles.common', 'pm4py.algo.organizational_mining.roles.variants', - 'pm4py.algo.organizational_mining.network_analysis', - 'pm4py.algo.organizational_mining.network_analysis.variants', - 'pm4py.algo.organizational_mining.local_diagnostics', - 'pm4py.algo.organizational_mining.resource_profiles', - 'pm4py.algo.organizational_mining.resource_profiles.variants', 'pm4py.util', 'pm4py.util.lp', - 'pm4py.util.lp.util', 'pm4py.util.lp.variants', 'pm4py.util.dt_parsing', 'pm4py.util.dt_parsing.variants', - 'pm4py.util.compression', 'pm4py.objects', 'pm4py.objects.dfg', 'pm4py.objects.dfg.utils', - 'pm4py.objects.dfg.exporter', 'pm4py.objects.dfg.exporter.variants', 'pm4py.objects.dfg.importer', - 'pm4py.objects.dfg.importer.variants', 'pm4py.objects.dfg.filtering', 'pm4py.objects.dfg.retrieval', - 'pm4py.objects.log', 'pm4py.objects.log.util', 'pm4py.objects.log.exporter', - 'pm4py.objects.log.exporter.xes', 'pm4py.objects.log.exporter.xes.util', - 'pm4py.objects.log.exporter.xes.variants', 'pm4py.objects.log.importer', 'pm4py.objects.log.importer.xes', - 'pm4py.objects.log.importer.xes.variants', 'pm4py.objects.org', 'pm4py.objects.org.sna', - 'pm4py.objects.org.roles', 'pm4py.objects.bpmn', 'pm4py.objects.bpmn.util', 'pm4py.objects.bpmn.layout', - 'pm4py.objects.bpmn.layout.variants', 'pm4py.objects.bpmn.exporter', - 'pm4py.objects.bpmn.exporter.variants', 'pm4py.objects.bpmn.importer', - 'pm4py.objects.bpmn.importer.variants', 'pm4py.objects.ocel', 'pm4py.objects.ocel.util', - 'pm4py.objects.ocel.exporter', 'pm4py.objects.ocel.exporter.csv', - 'pm4py.objects.ocel.exporter.csv.variants', 'pm4py.objects.ocel.exporter.util', - 'pm4py.objects.ocel.exporter.sqlite', 'pm4py.objects.ocel.exporter.sqlite.variants', - 'pm4py.objects.ocel.exporter.xmlocel', 'pm4py.objects.ocel.exporter.xmlocel.variants', - 'pm4py.objects.ocel.exporter.jsonocel', 'pm4py.objects.ocel.exporter.jsonocel.variants', - 'pm4py.objects.ocel.importer', 'pm4py.objects.ocel.importer.csv', - 'pm4py.objects.ocel.importer.csv.variants', 'pm4py.objects.ocel.importer.sqlite', - 'pm4py.objects.ocel.importer.sqlite.variants', 'pm4py.objects.ocel.importer.xmlocel', - 'pm4py.objects.ocel.importer.xmlocel.variants', 'pm4py.objects.ocel.importer.jsonocel', - 'pm4py.objects.ocel.importer.jsonocel.variants', 'pm4py.objects.ocel.validation', 'pm4py.objects.powl', - 'pm4py.objects.trie', 'pm4py.objects.petri_net', 'pm4py.objects.petri_net.utils', - 'pm4py.objects.petri_net.saw_net', 'pm4py.objects.petri_net.exporter', - 'pm4py.objects.petri_net.exporter.variants', 'pm4py.objects.petri_net.importer', - 'pm4py.objects.petri_net.importer.variants', 'pm4py.objects.petri_net.stochastic', - 'pm4py.objects.petri_net.data_petri_nets', 'pm4py.objects.petri_net.inhibitor_reset', - 'pm4py.objects.conversion', 'pm4py.objects.conversion.dfg', 'pm4py.objects.conversion.dfg.variants', - 'pm4py.objects.conversion.log', 'pm4py.objects.conversion.log.variants', 'pm4py.objects.conversion.bpmn', - 'pm4py.objects.conversion.bpmn.variants', 'pm4py.objects.conversion.ocel', - 'pm4py.objects.conversion.ocel.variants', 'pm4py.objects.conversion.powl', - 'pm4py.objects.conversion.powl.variants', 'pm4py.objects.conversion.wf_net', - 'pm4py.objects.conversion.wf_net.variants', 'pm4py.objects.conversion.process_tree', - 'pm4py.objects.conversion.process_tree.variants', 'pm4py.objects.conversion.heuristics_net', - 'pm4py.objects.conversion.heuristics_net.variants', 'pm4py.objects.process_tree', - 'pm4py.objects.process_tree.utils', 'pm4py.objects.process_tree.exporter', - 'pm4py.objects.process_tree.exporter.variants', 'pm4py.objects.process_tree.importer', - 'pm4py.objects.process_tree.importer.variants', 'pm4py.objects.heuristics_net', - 'pm4py.objects.random_variables', 'pm4py.objects.random_variables.gamma', - 'pm4py.objects.random_variables.normal', 'pm4py.objects.random_variables.uniform', - 'pm4py.objects.random_variables.constant0', 'pm4py.objects.random_variables.lognormal', - 'pm4py.objects.random_variables.exponential', 'pm4py.objects.stochastic_petri', - 'pm4py.objects.transition_system', 'pm4py.streaming', 'pm4py.streaming.algo', - 'pm4py.streaming.algo.discovery', 'pm4py.streaming.algo.discovery.dfg', - 'pm4py.streaming.algo.discovery.dfg.variants', 'pm4py.streaming.algo.conformance', - 'pm4py.streaming.algo.conformance.tbr', 'pm4py.streaming.algo.conformance.tbr.variants', - 'pm4py.streaming.algo.conformance.temporal', 'pm4py.streaming.algo.conformance.temporal.variants', - 'pm4py.streaming.algo.conformance.footprints', 'pm4py.streaming.algo.conformance.footprints.variants', - 'pm4py.streaming.util', 'pm4py.streaming.util.dictio', 'pm4py.streaming.util.dictio.versions', - 'pm4py.streaming.stream', 'pm4py.streaming.importer', 'pm4py.streaming.importer.csv', - 'pm4py.streaming.importer.csv.variants', 'pm4py.streaming.importer.xes', - 'pm4py.streaming.importer.xes.variants', 'pm4py.streaming.conversion', 'pm4py.statistics', - 'pm4py.statistics.ocel', 'pm4py.statistics.util', 'pm4py.statistics.rework', - 'pm4py.statistics.rework.log', 'pm4py.statistics.rework.cases', 'pm4py.statistics.rework.cases.log', - 'pm4py.statistics.rework.cases.pandas', 'pm4py.statistics.rework.pandas', 'pm4py.statistics.traces', - 'pm4py.statistics.traces.generic', 'pm4py.statistics.traces.generic.log', - 'pm4py.statistics.traces.generic.common', 'pm4py.statistics.traces.generic.pandas', - 'pm4py.statistics.traces.cycle_time', 'pm4py.statistics.traces.cycle_time.log', - 'pm4py.statistics.traces.cycle_time.util', 'pm4py.statistics.traces.cycle_time.pandas', - 'pm4py.statistics.overlap', 'pm4py.statistics.overlap.cases', 'pm4py.statistics.overlap.cases.log', - 'pm4py.statistics.overlap.cases.pandas', 'pm4py.statistics.overlap.utils', - 'pm4py.statistics.overlap.interval_events', 'pm4py.statistics.overlap.interval_events.log', - 'pm4py.statistics.overlap.interval_events.pandas', 'pm4py.statistics.variants', - 'pm4py.statistics.variants.log', 'pm4py.statistics.variants.pandas', 'pm4py.statistics.attributes', - 'pm4py.statistics.attributes.log', 'pm4py.statistics.attributes.common', - 'pm4py.statistics.attributes.pandas', 'pm4py.statistics.passed_time', 'pm4py.statistics.passed_time.log', - 'pm4py.statistics.passed_time.log.variants', 'pm4py.statistics.passed_time.pandas', - 'pm4py.statistics.passed_time.pandas.variants', 'pm4py.statistics.sojourn_time', - 'pm4py.statistics.sojourn_time.log', 'pm4py.statistics.sojourn_time.pandas', - 'pm4py.statistics.end_activities', 'pm4py.statistics.end_activities.log', - 'pm4py.statistics.end_activities.common', 'pm4py.statistics.end_activities.pandas', - 'pm4py.statistics.start_activities', 'pm4py.statistics.start_activities.log', - 'pm4py.statistics.start_activities.common', 'pm4py.statistics.start_activities.pandas', - 'pm4py.statistics.eventually_follows', 'pm4py.statistics.eventually_follows.log', - 'pm4py.statistics.eventually_follows.uvcl', 'pm4py.statistics.eventually_follows.pandas', - 'pm4py.statistics.concurrent_activities', 'pm4py.statistics.concurrent_activities.log', - 'pm4py.statistics.concurrent_activities.pandas', 'pm4py.visualization', 'pm4py.visualization.dfg', - 'pm4py.visualization.dfg.util', 'pm4py.visualization.dfg.variants', 'pm4py.visualization.sna', - 'pm4py.visualization.sna.variants', 'pm4py.visualization.bpmn', 'pm4py.visualization.bpmn.variants', - 'pm4py.visualization.ocel', 'pm4py.visualization.ocel.ocpn', 'pm4py.visualization.ocel.ocpn.variants', - 'pm4py.visualization.ocel.ocdfg', 'pm4py.visualization.ocel.ocdfg.variants', - 'pm4py.visualization.ocel.object_graph', 'pm4py.visualization.ocel.object_graph.variants', - 'pm4py.visualization.ocel.interleavings', 'pm4py.visualization.ocel.interleavings.variants', - 'pm4py.visualization.powl', 'pm4py.visualization.powl.variants', 'pm4py.visualization.trie', - 'pm4py.visualization.trie.variants', 'pm4py.visualization.common', 'pm4py.visualization.graphs', - 'pm4py.visualization.graphs.util', 'pm4py.visualization.graphs.variants', 'pm4py.visualization.petri_net', - 'pm4py.visualization.petri_net.util', 'pm4py.visualization.petri_net.common', - 'pm4py.visualization.petri_net.variants', 'pm4py.visualization.footprints', - 'pm4py.visualization.footprints.variants', 'pm4py.visualization.align_table', - 'pm4py.visualization.align_table.variants', 'pm4py.visualization.decisiontree', - 'pm4py.visualization.decisiontree.util', 'pm4py.visualization.decisiontree.variants', - 'pm4py.visualization.dotted_chart', 'pm4py.visualization.dotted_chart.variants', - 'pm4py.visualization.process_tree', 'pm4py.visualization.process_tree.variants', - 'pm4py.visualization.heuristics_net', 'pm4py.visualization.heuristics_net.variants', - 'pm4py.visualization.network_analysis', 'pm4py.visualization.network_analysis.variants', - 'pm4py.visualization.transition_system', 'pm4py.visualization.transition_system.util', - 'pm4py.visualization.transition_system.variants', 'pm4py.visualization.performance_spectrum', - 'pm4py.visualization.performance_spectrum.variants'], + packages=[x for x in find_packages() if x.startswith("pm4py")], url='https://pm4py.fit.fraunhofer.de', license='GPL 3.0', install_requires=read_file("requirements_stable.txt").split("\n"), From 1367023b988c09393ebf2a75b34184b34d5efb34 Mon Sep 17 00:00:00 2001 From: Alessandro Berti Date: Wed, 4 Oct 2023 07:28:03 +0200 Subject: [PATCH 09/27] fix(pm4py): backporting changes to README and requirements_stable --- README.md | 2 +- requirements_stable.txt | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e76e70d8f..fcaafc8d0 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ if __name__ == "__main__": ``` ## Installation -pm4py can be installed on Python 3.8.x / 3.9.x / 3.10.x / 3.11.x / 3.12.x by invoking: +pm4py can be installed on Python 3.9.x / 3.10.x / 3.11.x / 3.12.x by invoking: *pip install -U pm4py* ## Requirements diff --git a/requirements_stable.txt b/requirements_stable.txt index 304e3da32..7c261caf5 100644 --- a/requirements_stable.txt +++ b/requirements_stable.txt @@ -1,8 +1,8 @@ colorama==0.4.6 contourpy==1.1.1 -cycler==0.11.0 +cycler==0.12.0 deprecation==2.1.0 -fonttools==4.42.1 +fonttools==4.43.0 graphviz==0.20.1 intervaltree==3.1.0 kiwisolver==1.4.5 @@ -10,14 +10,14 @@ lxml==4.9.3 matplotlib==3.8.0 networkx==3.1 numpy==1.26.0 -packaging==23.1 +packaging==23.2 pandas==2.1.1 Pillow==10.0.1 pydotplus==2.0.2 pyparsing==3.1.1 python-dateutil==2.8.2 pytz==2023.3.post1 -scipy==1.11.2 +scipy==1.11.3 six==1.16.0 sortedcontainers==2.4.0 StringDist==1.0.9 From 0c84cf10bafee6b50722b21a4838d7fd03a2aad1 Mon Sep 17 00:00:00 2001 From: Alessandro Berti Date: Wed, 4 Oct 2023 08:12:03 +0200 Subject: [PATCH 10/27] feat(pm4py): storing requirements for Python 3.8 --- .../old_python_deps/requirements_py38.txt | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 third_party/old_python_deps/requirements_py38.txt diff --git a/third_party/old_python_deps/requirements_py38.txt b/third_party/old_python_deps/requirements_py38.txt new file mode 100644 index 000000000..931beff86 --- /dev/null +++ b/third_party/old_python_deps/requirements_py38.txt @@ -0,0 +1,25 @@ +colorama==0.4.6 +contourpy==1.1.1 +cycler==0.12.0 +deprecation==2.1.0 +fonttools==4.43.0 +graphviz==0.20.1 +intervaltree==3.1.0 +kiwisolver==1.4.5 +lxml==4.9.3 +matplotlib==3.7.3 +networkx==3.1 +numpy==1.24.4 +packaging==23.2 +pandas==2.0.3 +Pillow==10.0.1 +pydotplus==2.0.2 +pyparsing==3.1.1 +python-dateutil==2.8.2 +pytz==2023.3.post1 +scipy==1.10.1 +six==1.16.0 +sortedcontainers==2.4.0 +StringDist==1.0.9 +tqdm==4.66.1 +tzdata==2023.3 From dc5fb82fd295b5559c64b479a86adfe422c893ef Mon Sep 17 00:00:00 2001 From: Alessandro Berti Date: Wed, 4 Oct 2023 08:50:41 +0200 Subject: [PATCH 11/27] feat(pm4py): optional Python 3.8 requirements --- third_party/old_python_deps/optional_py38.txt | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 third_party/old_python_deps/optional_py38.txt diff --git a/third_party/old_python_deps/optional_py38.txt b/third_party/old_python_deps/optional_py38.txt new file mode 100644 index 000000000..25aadf9b1 --- /dev/null +++ b/third_party/old_python_deps/optional_py38.txt @@ -0,0 +1,5 @@ +joblib==1.3.2 +pyarrow==13.0.0 +pyemd==1.0.0 +scikit-learn==1.3.1 +threadpoolctl==3.2.0 From ed9173f4ae9eab9bdbceaba0fb42745bbbb80868 Mon Sep 17 00:00:00 2001 From: Alessandro Berti Date: Wed, 4 Oct 2023 08:57:45 +0200 Subject: [PATCH 12/27] feat(pm4py): added optional requirements --- third_party/old_python_deps/optional_py38.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/third_party/old_python_deps/optional_py38.txt b/third_party/old_python_deps/optional_py38.txt index 25aadf9b1..447d02678 100644 --- a/third_party/old_python_deps/optional_py38.txt +++ b/third_party/old_python_deps/optional_py38.txt @@ -1,3 +1,4 @@ +cvxopt==1.3.2 joblib==1.3.2 pyarrow==13.0.0 pyemd==1.0.0 From 9b2629e67ee21132bd1c7eaa1d81253ce10bf34b Mon Sep 17 00:00:00 2001 From: Alessandro Berti Date: Thu, 5 Oct 2023 08:06:41 +0200 Subject: [PATCH 13/27] bumped version number and changelog --- CHANGELOG.md | 21 +++++++++++++++++++++ docs/source/conf.py | 2 +- pm4py/meta.py | 2 +- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 41ff4e594..61b07cfaf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,26 @@ # Changelog of pm4py +## pm4py 2.7.8 (2023.10.XX) + +### Added + +### Changed +* 634b6a5ac1b40963baa76a42a10c3c22176aaf84 + f6993293d665e2f7b69c27ce0f09d2df4e889b0b + f0240670292086cb3b6fe523b1646dcfa4c71ddc + * Refactoring OCEL import/export + +### Deprecated + +### Fixed + +### Removed + +### Other + + +--- + ## pm4py 2.7.7 (2023.09.22) diff --git a/docs/source/conf.py b/docs/source/conf.py index 4cda3853e..f8104bb03 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -26,7 +26,7 @@ # The short X.Y version version = '2.7' # The full version, including alpha/beta/rc tags -release = '2.7.7' +release = '2.7.8' # -- General configuration --------------------------------------------------- diff --git a/pm4py/meta.py b/pm4py/meta.py index af1450b94..c2e5fb70f 100644 --- a/pm4py/meta.py +++ b/pm4py/meta.py @@ -1,5 +1,5 @@ __name__ = 'pm4py' -VERSION = '2.7.7' +VERSION = '2.7.8' __version__ = VERSION __doc__ = 'Process mining for Python' __author__ = 'Fraunhofer Institute for Applied Information Technology FIT' From 109bb6eaa074ca390636e68c19b9eef106e00fdf Mon Sep 17 00:00:00 2001 From: Alessandro Berti Date: Thu, 5 Oct 2023 08:07:22 +0200 Subject: [PATCH 14/27] performed safety check --- safety_checks/20231005 | 47 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 safety_checks/20231005 diff --git a/safety_checks/20231005 b/safety_checks/20231005 new file mode 100644 index 000000000..48e2215f4 --- /dev/null +++ b/safety_checks/20231005 @@ -0,0 +1,47 @@ ++==============================================================================+ + + /$$$$$$ /$$ + /$$__ $$ | $$ + /$$$$$$$ /$$$$$$ | $$ \__//$$$$$$ /$$$$$$ /$$ /$$ + /$$_____/ |____ $$| $$$$ /$$__ $$|_ $$_/ | $$ | $$ + | $$$$$$ /$$$$$$$| $$_/ | $$$$$$$$ | $$ | $$ | $$ + \____ $$ /$$__ $$| $$ | $$_____/ | $$ /$$| $$ | $$ + /$$$$$$$/| $$$$$$$| $$ | $$$$$$$ | $$$$/| $$$$$$$ + |_______/ \_______/|__/ \_______/ \___/ \____ $$ + /$$ | $$ + | $$$$$$/ + by pyup.io \______/ + ++==============================================================================+ + + REPORT + + Safety is using PyUp's free open-source vulnerability database. This +data is 30 days old and limited. + For real-time enhanced vulnerability data, fix recommendations, severity +reporting, cybersecurity support, team and project policy management and more +sign up at https://pyup.io or email sales@pyup.io + + Safety v2.3.5 is scanning for Vulnerabilities... + Scanning dependencies in your files: + + -> requirements_stable.txt + + Using non-commercial database + Found and scanned 25 packages + Timestamp 2023-10-05 08:07:08 + 0 vulnerabilities found + 0 vulnerabilities ignored ++==============================================================================+ + + No known security vulnerabilities found. + ++==============================================================================+ + + Safety is using PyUp's free open-source vulnerability database. This +data is 30 days old and limited. + For real-time enhanced vulnerability data, fix recommendations, severity +reporting, cybersecurity support, team and project policy management and more +sign up at https://pyup.io or email sales@pyup.io + ++==============================================================================+ From ef548ef18f514ad6ad0a32a104f380b322ab72e7 Mon Sep 17 00:00:00 2001 From: Alessandro Berti Date: Thu, 5 Oct 2023 12:43:03 +0200 Subject: [PATCH 15/27] fix(pm4py): fixing test/examples execution --- examples/activities_to_alphabet.py | 2 +- examples/cost_based_dfg.py | 2 +- examples/inductive_miner_dfg.py | 2 +- examples/inductive_miner_variants.py | 2 +- tests/inductive_test.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/activities_to_alphabet.py b/examples/activities_to_alphabet.py index 561ca614d..8b801864b 100644 --- a/examples/activities_to_alphabet.py +++ b/examples/activities_to_alphabet.py @@ -4,7 +4,7 @@ def execute_script(): - dataframe = pm4py.read_xes("../tests/input_data/running-example.xes") + dataframe = pm4py.read_xes("../tests/input_data/running-example.xes", return_legacy_log_object=False) renamed_dataframe = activities_to_alphabet.apply(dataframe, parameters={constants.PARAMETER_CONSTANT_ACTIVITY_KEY: "concept:name"}) print(renamed_dataframe) diff --git a/examples/cost_based_dfg.py b/examples/cost_based_dfg.py index 30a306c81..457c46516 100644 --- a/examples/cost_based_dfg.py +++ b/examples/cost_based_dfg.py @@ -5,7 +5,7 @@ def execute_script(): - log = pm4py.read_xes(os.path.join("..", "tests", "input_data", "roadtraffic100traces.xes")) + log = pm4py.read_xes(os.path.join("..", "tests", "input_data", "roadtraffic100traces.xes"), return_legacy_log_object=False) cost_based_dfg = df_statistics.get_dfg_graph(log, measure="cost", cost_attribute="amount") gviz = dfg_visualizer.apply(cost_based_dfg, variant=dfg_visualizer.Variants.COST, parameters={"format": "svg"}) dfg_visualizer.view(gviz) diff --git a/examples/inductive_miner_dfg.py b/examples/inductive_miner_dfg.py index 40f164e3f..0928c99bb 100644 --- a/examples/inductive_miner_dfg.py +++ b/examples/inductive_miner_dfg.py @@ -4,7 +4,7 @@ def execute_script(): - log = pm4py.read_xes(os.path.join("..", "tests", "input_data", "running-example.xes")) + log = pm4py.read_xes(os.path.join("..", "tests", "input_data", "running-example.xes"), return_legacy_log_object=False) typed_dfg_1 = pm4py.discover_dfg_typed(log) # in alternative ... dfg, sa, ea = pm4py.discover_dfg(log) diff --git a/examples/inductive_miner_variants.py b/examples/inductive_miner_variants.py index 8f968abe2..86547b6e8 100644 --- a/examples/inductive_miner_variants.py +++ b/examples/inductive_miner_variants.py @@ -7,7 +7,7 @@ def execute_script(): - log = pm4py.read_xes(os.path.join("..", "tests", "input_data", "running-example.xes")) + log = pm4py.read_xes(os.path.join("..", "tests", "input_data", "running-example.xes"), return_legacy_log_object=False) variants = pm4py.get_variants(log) uvcl = UVCL() for var, occ in variants.items(): diff --git a/tests/inductive_test.py b/tests/inductive_test.py index a12b31094..82cc60873 100644 --- a/tests/inductive_test.py +++ b/tests/inductive_test.py @@ -131,7 +131,7 @@ def test_inductive_miner_new_log_dfg(self): def test_inductive_miner_new_df_dfg(self): import pm4py - log = pm4py.read_xes("input_data/running-example.xes") + log = pm4py.read_xes("input_data/running-example.xes", return_legacy_log_object=False) typed_dfg = pm4py.discover_dfg_typed(log) tree = pm4py.discover_process_tree_inductive(typed_dfg, noise_threshold=0.2) From 35f13b65a0523f889748679fbe90cf2d041e1038 Mon Sep 17 00:00:00 2001 From: Alessandro Berti Date: Thu, 5 Oct 2023 12:54:37 +0200 Subject: [PATCH 16/27] fix(pm4py): fixing XES importing warnings in obtaining the resulting pd.DataFrame --- pm4py/read.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pm4py/read.py b/pm4py/read.py index 58b75f613..a840a4ee9 100644 --- a/pm4py/read.py +++ b/pm4py/read.py @@ -62,7 +62,7 @@ def read_xes(file_path: str, variant: str = "lxml", return_legacy_log_object: bo if return_legacy_log_object: return log log = log_converter.apply(log, variant=log_converter.Variants.TO_DATA_FRAME) - log = dataframe_utils.convert_timestamp_columns_in_df(log) + log = dataframe_utils.convert_timestamp_columns_in_df(log, timest_format="ISO8601") return log From 3b482663a25c5309756f8d0905010ee422644ccd Mon Sep 17 00:00:00 2001 From: Alessandro Berti Date: Fri, 6 Oct 2023 07:30:24 +0200 Subject: [PATCH 17/27] feat(pm4py): centralized enabling/disabling of TQDM progress bar + Disabling progress bar in tests --- .../alignments/decomposed/variants/recompos_maximal.py | 2 +- pm4py/algo/conformance/alignments/petri_net/algorithm.py | 4 ++-- .../alignments/process_tree/variants/search_graph_pt.py | 2 +- pm4py/algo/conformance/tokenreplay/variants/token_replay.py | 2 +- pm4py/algo/discovery/ilp/variants/classic.py | 2 +- .../evaluation/precision/variants/align_etconformance.py | 2 +- .../evaluation/precision/variants/etconformance_token.py | 2 +- .../algo/evaluation/replay_fitness/variants/token_replay.py | 2 +- pm4py/objects/log/exporter/xes/variants/etree_xes_exp.py | 2 +- pm4py/objects/log/exporter/xes/variants/line_by_line.py | 2 +- pm4py/objects/log/importer/xes/variants/iterparse.py | 6 +++--- pm4py/objects/log/importer/xes/variants/iterparse_20.py | 6 +++--- .../log/importer/xes/variants/iterparse_mem_compressed.py | 6 +++--- pm4py/util/constants.py | 1 + 14 files changed, 21 insertions(+), 20 deletions(-) diff --git a/pm4py/algo/conformance/alignments/decomposed/variants/recompos_maximal.py b/pm4py/algo/conformance/alignments/decomposed/variants/recompos_maximal.py index b85f09ce9..430c176e2 100644 --- a/pm4py/algo/conformance/alignments/decomposed/variants/recompos_maximal.py +++ b/pm4py/algo/conformance/alignments/decomposed/variants/recompos_maximal.py @@ -159,7 +159,7 @@ def apply_log(log, list_nets, parameters=None): if parameters is None: parameters = {} - show_progress_bar = exec_utils.get_param_value(Parameters.SHOW_PROGRESS_BAR, parameters, True) + show_progress_bar = exec_utils.get_param_value(Parameters.SHOW_PROGRESS_BAR, parameters, constants.SHOW_PROGRESS_BAR) icache = exec_utils.get_param_value(Parameters.ICACHE, parameters, dict()) mcache = exec_utils.get_param_value(Parameters.MCACHE, parameters, dict()) diff --git a/pm4py/algo/conformance/alignments/petri_net/algorithm.py b/pm4py/algo/conformance/alignments/petri_net/algorithm.py index 20566f017..4c616646b 100644 --- a/pm4py/algo/conformance/alignments/petri_net/algorithm.py +++ b/pm4py/algo/conformance/alignments/petri_net/algorithm.py @@ -15,7 +15,7 @@ from typing import Optional, Dict, Any, Union, Tuple from pm4py.objects.log.obj import EventLog, EventStream, Trace from pm4py.objects.petri_net.obj import PetriNet, Marking -from pm4py.util import typing +from pm4py.util import typing, constants import pandas as pd @@ -328,7 +328,7 @@ def __get_variants_structure(log, parameters): def __get_progress_bar(num_variants, parameters): - show_progress_bar = exec_utils.get_param_value(Parameters.SHOW_PROGRESS_BAR, parameters, True) + show_progress_bar = exec_utils.get_param_value(Parameters.SHOW_PROGRESS_BAR, parameters, constants.SHOW_PROGRESS_BAR) progress = None if importlib.util.find_spec("tqdm") and show_progress_bar and num_variants > 1: from tqdm.auto import tqdm diff --git a/pm4py/algo/conformance/alignments/process_tree/variants/search_graph_pt.py b/pm4py/algo/conformance/alignments/process_tree/variants/search_graph_pt.py index 33da5200a..f36082437 100644 --- a/pm4py/algo/conformance/alignments/process_tree/variants/search_graph_pt.py +++ b/pm4py/algo/conformance/alignments/process_tree/variants/search_graph_pt.py @@ -215,7 +215,7 @@ def apply_variant(variant, tree, parameters=None): def _construct_progress_bar(progress_length, parameters): - if exec_utils.get_param_value(Parameters.SHOW_PROGRESS_BAR, parameters, True) and importlib.util.find_spec("tqdm"): + if exec_utils.get_param_value(Parameters.SHOW_PROGRESS_BAR, parameters, constants.SHOW_PROGRESS_BAR) and importlib.util.find_spec("tqdm"): if progress_length > 1: from tqdm.auto import tqdm return tqdm(total=progress_length, desc="aligning log, completed variants :: ") diff --git a/pm4py/algo/conformance/tokenreplay/variants/token_replay.py b/pm4py/algo/conformance/tokenreplay/variants/token_replay.py index 8e4817f73..6d2f71886 100644 --- a/pm4py/algo/conformance/tokenreplay/variants/token_replay.py +++ b/pm4py/algo/conformance/tokenreplay/variants/token_replay.py @@ -1102,7 +1102,7 @@ def apply(log: EventLog, net: PetriNet, initial_marking: Marking, final_marking: activity_key = exec_utils.get_param_value(Parameters.ACTIVITY_KEY, parameters, xes_util.DEFAULT_NAME_KEY) consider_activities_not_in_model_in_fitness = exec_utils.get_param_value(Parameters.CONSIDER_ACTIVITIES_NOT_IN_MODEL_IN_FITNESS, parameters, False) - show_progress_bar = exec_utils.get_param_value(Parameters.SHOW_PROGRESS_BAR, parameters, True) + show_progress_bar = exec_utils.get_param_value(Parameters.SHOW_PROGRESS_BAR, parameters, constants.SHOW_PROGRESS_BAR) case_id_key = exec_utils.get_param_value(Parameters.CASE_ID_KEY, parameters, constants.CASE_CONCEPT_NAME) if type(log) is not pd.DataFrame: diff --git a/pm4py/algo/discovery/ilp/variants/classic.py b/pm4py/algo/discovery/ilp/variants/classic.py index c7411ac46..eff0680d7 100644 --- a/pm4py/algo/discovery/ilp/variants/classic.py +++ b/pm4py/algo/discovery/ilp/variants/classic.py @@ -120,7 +120,7 @@ def apply(log0: Union[EventLog, EventStream, pd.DataFrame], parameters: Optional constants.DEFAULT_ARTIFICIAL_START_ACTIVITY) artificial_end_activity = exec_utils.get_param_value(Parameters.PARAM_ARTIFICIAL_END_ACTIVITY, parameters, constants.DEFAULT_ARTIFICIAL_END_ACTIVITY) - show_progress_bar = exec_utils.get_param_value(Parameters.SHOW_PROGRESS_BAR, parameters, True) + show_progress_bar = exec_utils.get_param_value(Parameters.SHOW_PROGRESS_BAR, parameters, constants.SHOW_PROGRESS_BAR) log0 = log_converter.apply(log0, variant=log_converter.Variants.TO_EVENT_LOG, parameters=parameters) log0 = filtering_utils.keep_one_trace_per_variant(log0, parameters=parameters) diff --git a/pm4py/algo/evaluation/precision/variants/align_etconformance.py b/pm4py/algo/evaluation/precision/variants/align_etconformance.py index a63a6c92e..7e4136697 100644 --- a/pm4py/algo/evaluation/precision/variants/align_etconformance.py +++ b/pm4py/algo/evaluation/precision/variants/align_etconformance.py @@ -196,7 +196,7 @@ def align_fake_log_stop_marking(fake_log, net, marking, final_marking, parameter if parameters is None: parameters = {} - show_progress_bar = exec_utils.get_param_value(Parameters.SHOW_PROGRESS_BAR, parameters, True) + show_progress_bar = exec_utils.get_param_value(Parameters.SHOW_PROGRESS_BAR, parameters, constants.SHOW_PROGRESS_BAR) multiprocessing = exec_utils.get_param_value(Parameters.MULTIPROCESSING, parameters, constants.ENABLE_MULTIPROCESSING_DEFAULT) progress = None diff --git a/pm4py/algo/evaluation/precision/variants/etconformance_token.py b/pm4py/algo/evaluation/precision/variants/etconformance_token.py index a43d3b1bc..1aa8c55ba 100644 --- a/pm4py/algo/evaluation/precision/variants/etconformance_token.py +++ b/pm4py/algo/evaluation/precision/variants/etconformance_token.py @@ -70,7 +70,7 @@ def apply(log: EventLog, net: PetriNet, marking: Marking, final_marking: Marking executor.Variants.TOKEN_REPLAY) activity_key = exec_utils.get_param_value(Parameters.ACTIVITY_KEY, parameters, log_lib.util.xes.DEFAULT_NAME_KEY) case_id_key = exec_utils.get_param_value(Parameters.CASE_ID_KEY, parameters, constants.CASE_CONCEPT_NAME) - show_progress_bar = exec_utils.get_param_value(Parameters.SHOW_PROGRESS_BAR, parameters, True) + show_progress_bar = exec_utils.get_param_value(Parameters.SHOW_PROGRESS_BAR, parameters, constants.SHOW_PROGRESS_BAR) # default value for precision, when no activated transitions (not even by looking at the initial marking) are found precision = 1.0 diff --git a/pm4py/algo/evaluation/replay_fitness/variants/token_replay.py b/pm4py/algo/evaluation/replay_fitness/variants/token_replay.py index 0b6196681..3b70676b2 100644 --- a/pm4py/algo/evaluation/replay_fitness/variants/token_replay.py +++ b/pm4py/algo/evaluation/replay_fitness/variants/token_replay.py @@ -87,7 +87,7 @@ def apply(log: EventLog, petri_net: PetriNet, initial_marking: Marking, final_ma token_replay_variant = exec_utils.get_param_value(Parameters.TOKEN_REPLAY_VARIANT, parameters, executor.Variants.TOKEN_REPLAY) cleaning_token_flood = exec_utils.get_param_value(Parameters.CLEANING_TOKEN_FLOOD, parameters, False) - show_progress_bar = exec_utils.get_param_value(Parameters.SHOW_PROGRESS_BAR, parameters, True) + show_progress_bar = exec_utils.get_param_value(Parameters.SHOW_PROGRESS_BAR, parameters, constants.SHOW_PROGRESS_BAR) case_id_key = exec_utils.get_param_value(Parameters.CASE_ID_KEY, parameters, constants.CASE_CONCEPT_NAME) parameters_tr = {token_replay.Parameters.ACTIVITY_KEY: activity_key, diff --git a/pm4py/objects/log/exporter/xes/variants/etree_xes_exp.py b/pm4py/objects/log/exporter/xes/variants/etree_xes_exp.py index cfb5a180b..83d9461a6 100644 --- a/pm4py/objects/log/exporter/xes/variants/etree_xes_exp.py +++ b/pm4py/objects/log/exporter/xes/variants/etree_xes_exp.py @@ -238,7 +238,7 @@ def __export_traces(log, root, parameters=None): if parameters is None: parameters = {} - show_progress_bar = exec_utils.get_param_value(Parameters.SHOW_PROGRESS_BAR, parameters, True) + show_progress_bar = exec_utils.get_param_value(Parameters.SHOW_PROGRESS_BAR, parameters, constants.SHOW_PROGRESS_BAR) progress = None if importlib.util.find_spec("tqdm") and show_progress_bar: diff --git a/pm4py/objects/log/exporter/xes/variants/line_by_line.py b/pm4py/objects/log/exporter/xes/variants/line_by_line.py index e0b842af7..214dd7629 100644 --- a/pm4py/objects/log/exporter/xes/variants/line_by_line.py +++ b/pm4py/objects/log/exporter/xes/variants/line_by_line.py @@ -195,7 +195,7 @@ def export_log_line_by_line(log, fp_obj, encoding, parameters=None): if parameters is None: parameters = {} - show_progress_bar = exec_utils.get_param_value(Parameters.SHOW_PROGRESS_BAR, parameters, True) + show_progress_bar = exec_utils.get_param_value(Parameters.SHOW_PROGRESS_BAR, parameters, constants.SHOW_PROGRESS_BAR) progress = None if importlib.util.find_spec("tqdm") and show_progress_bar: diff --git a/pm4py/objects/log/importer/xes/variants/iterparse.py b/pm4py/objects/log/importer/xes/variants/iterparse.py index f4f5affd5..3aac0335b 100644 --- a/pm4py/objects/log/importer/xes/variants/iterparse.py +++ b/pm4py/objects/log/importer/xes/variants/iterparse.py @@ -79,7 +79,7 @@ def import_from_context(context, num_traces, parameters=None): timestamp_key = exec_utils.get_param_value(Parameters.TIMESTAMP_KEY, parameters, xes_constants.DEFAULT_TIMESTAMP_KEY) reverse_sort = exec_utils.get_param_value(Parameters.REVERSE_SORT, parameters, False) - show_progress_bar = exec_utils.get_param_value(Parameters.SHOW_PROGRESS_BAR, parameters, True) + show_progress_bar = exec_utils.get_param_value(Parameters.SHOW_PROGRESS_BAR, parameters, constants.SHOW_PROGRESS_BAR) date_parser = dt_parser.get() progress = None @@ -312,7 +312,7 @@ def import_log(filename, parameters=None): parameters = {} encoding = exec_utils.get_param_value(Parameters.ENCODING, parameters, constants.DEFAULT_ENCODING) - show_progress_bar = exec_utils.get_param_value(Parameters.SHOW_PROGRESS_BAR, parameters, True) + show_progress_bar = exec_utils.get_param_value(Parameters.SHOW_PROGRESS_BAR, parameters, constants.SHOW_PROGRESS_BAR) is_compressed = filename.lower().endswith(".gz") if importlib.util.find_spec("tqdm") and show_progress_bar: @@ -364,7 +364,7 @@ def import_from_string(log_string, parameters=None): parameters = {} encoding = exec_utils.get_param_value(Parameters.ENCODING, parameters, constants.DEFAULT_ENCODING) - show_progress_bar = exec_utils.get_param_value(Parameters.SHOW_PROGRESS_BAR, parameters, True) + show_progress_bar = exec_utils.get_param_value(Parameters.SHOW_PROGRESS_BAR, parameters, constants.SHOW_PROGRESS_BAR) decompress_serialization = exec_utils.get_param_value(Parameters.DECOMPRESS_SERIALIZATION, parameters, False) if type(log_string) is str: diff --git a/pm4py/objects/log/importer/xes/variants/iterparse_20.py b/pm4py/objects/log/importer/xes/variants/iterparse_20.py index 79606e591..8cddf7901 100644 --- a/pm4py/objects/log/importer/xes/variants/iterparse_20.py +++ b/pm4py/objects/log/importer/xes/variants/iterparse_20.py @@ -79,7 +79,7 @@ def import_from_context(context, num_traces, parameters=None): timestamp_key = exec_utils.get_param_value(Parameters.TIMESTAMP_KEY, parameters, xes_constants.DEFAULT_TIMESTAMP_KEY) reverse_sort = exec_utils.get_param_value(Parameters.REVERSE_SORT, parameters, False) - show_progress_bar = exec_utils.get_param_value(Parameters.SHOW_PROGRESS_BAR, parameters, True) + show_progress_bar = exec_utils.get_param_value(Parameters.SHOW_PROGRESS_BAR, parameters, constants.SHOW_PROGRESS_BAR) date_parser = dt_parser.get() progress = None @@ -312,7 +312,7 @@ def import_log(filename, parameters=None): parameters = {} encoding = exec_utils.get_param_value(Parameters.ENCODING, parameters, constants.DEFAULT_ENCODING) - show_progress_bar = exec_utils.get_param_value(Parameters.SHOW_PROGRESS_BAR, parameters, True) + show_progress_bar = exec_utils.get_param_value(Parameters.SHOW_PROGRESS_BAR, parameters, constants.SHOW_PROGRESS_BAR) is_compressed = filename.lower().endswith(".gz") if importlib.util.find_spec("tqdm") and show_progress_bar: @@ -364,7 +364,7 @@ def import_from_string(log_string, parameters=None): parameters = {} encoding = exec_utils.get_param_value(Parameters.ENCODING, parameters, constants.DEFAULT_ENCODING) - show_progress_bar = exec_utils.get_param_value(Parameters.SHOW_PROGRESS_BAR, parameters, True) + show_progress_bar = exec_utils.get_param_value(Parameters.SHOW_PROGRESS_BAR, parameters, constants.SHOW_PROGRESS_BAR) decompress_serialization = exec_utils.get_param_value(Parameters.DECOMPRESS_SERIALIZATION, parameters, False) if type(log_string) is str: diff --git a/pm4py/objects/log/importer/xes/variants/iterparse_mem_compressed.py b/pm4py/objects/log/importer/xes/variants/iterparse_mem_compressed.py index 2579abc66..e834969d8 100644 --- a/pm4py/objects/log/importer/xes/variants/iterparse_mem_compressed.py +++ b/pm4py/objects/log/importer/xes/variants/iterparse_mem_compressed.py @@ -81,7 +81,7 @@ def import_from_context(context, num_traces, log, parameters=None): timestamp_key = exec_utils.get_param_value(Parameters.TIMESTAMP_KEY, parameters, xes_constants.DEFAULT_TIMESTAMP_KEY) reverse_sort = exec_utils.get_param_value(Parameters.REVERSE_SORT, parameters, False) - show_progress_bar = exec_utils.get_param_value(Parameters.SHOW_PROGRESS_BAR, parameters, True) + show_progress_bar = exec_utils.get_param_value(Parameters.SHOW_PROGRESS_BAR, parameters, constants.SHOW_PROGRESS_BAR) date_parser = dt_parser.get() progress = None @@ -310,7 +310,7 @@ def import_log(filename, parameters=None): parameters = {} encoding = exec_utils.get_param_value(Parameters.ENCODING, parameters, constants.DEFAULT_ENCODING) - show_progress_bar = exec_utils.get_param_value(Parameters.SHOW_PROGRESS_BAR, parameters, True) + show_progress_bar = exec_utils.get_param_value(Parameters.SHOW_PROGRESS_BAR, parameters, constants.SHOW_PROGRESS_BAR) is_compressed = filename.lower().endswith(".gz") if importlib.util.find_spec("tqdm") and show_progress_bar: @@ -363,7 +363,7 @@ def import_from_string(log_string, parameters=None): parameters = {} encoding = exec_utils.get_param_value(Parameters.ENCODING, parameters, constants.DEFAULT_ENCODING) - show_progress_bar = exec_utils.get_param_value(Parameters.SHOW_PROGRESS_BAR, parameters, True) + show_progress_bar = exec_utils.get_param_value(Parameters.SHOW_PROGRESS_BAR, parameters, constants.SHOW_PROGRESS_BAR) decompress_serialization = exec_utils.get_param_value(Parameters.DECOMPRESS_SERIALIZATION, parameters, False) if type(log_string) is str: diff --git a/pm4py/util/constants.py b/pm4py/util/constants.py index c615f5916..96d00cc1b 100644 --- a/pm4py/util/constants.py +++ b/pm4py/util/constants.py @@ -61,6 +61,7 @@ def get_param_from_env(name, default): DEFAULT_RANKDIR_GVIZ = get_param_from_env("PM4PY_DEFAULT_RANKDIR_GVIZ", "LR") ENABLE_MULTIPROCESSING_DEFAULT = True if get_param_from_env("PM4PY_ENABLE_MULTIPROCESSING_DEFAULT", "False").lower() == "true" else False +SHOW_PROGRESS_BAR = True if get_param_from_env("PM4PY_SHOW_PROGRESS_BAR", "True").lower() == "true" else False DEFAULT_READ_XES_LEGACY_OBJECT = True if get_param_from_env("PM4PY_DEFAULT_READ_XES_LEGACY_OBJECT", "False").lower() == "true" else False DEFAULT_RETURN_DIAGNOSTICS_DATAFRAME = True if get_param_from_env("PM4PY_DEFAULT_RETURN_DIAGNOSTICS_DATAFRAME", "False").lower() == "true" else False From c1379120480539f5578a52ce6d76effb4819b3c6 Mon Sep 17 00:00:00 2001 From: Alessandro Berti Date: Fri, 6 Oct 2023 07:34:02 +0200 Subject: [PATCH 18/27] fix(pm4py): bug fix --- tests/execute_tests.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/execute_tests.py b/tests/execute_tests.py index 5aa37f6b3..82acff35d 100644 --- a/tests/execute_tests.py +++ b/tests/execute_tests.py @@ -7,6 +7,10 @@ current_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) parent_dir = os.path.dirname(current_dir) sys.path.insert(0, parent_dir) + + import pm4py + pm4py.util.constants.SHOW_PROGRESS_BAR = False + from tests.doc_tests import DocTests from tests.role_detection import RoleDetectionTest from tests.passed_time import PassedTimeTest From abcefee69c8b05fdab09ba1c73485a3b03e9d298 Mon Sep 17 00:00:00 2001 From: Alessandro Berti Date: Fri, 6 Oct 2023 07:45:39 +0200 Subject: [PATCH 19/27] feat(pm4py): properly closing file objects in different pm4py importers/exporters --- pm4py/objects/bpmn/importer/variants/lxml.py | 5 ++++- pm4py/objects/log/importer/xes/variants/iterparse.py | 1 + pm4py/objects/log/importer/xes/variants/iterparse_20.py | 1 + .../log/importer/xes/variants/iterparse_mem_compressed.py | 1 + pm4py/objects/ocel/exporter/xmlocel/variants/classic.py | 5 ++++- pm4py/objects/ocel/exporter/xmlocel/variants/ocel20.py | 5 ++++- pm4py/objects/ocel/importer/xmlocel/variants/classic.py | 6 +++++- pm4py/objects/ocel/importer/xmlocel/variants/ocel20.py | 6 +++++- pm4py/objects/petri_net/exporter/variants/pnml.py | 4 +++- pm4py/objects/petri_net/importer/variants/pnml.py | 6 +++++- pm4py/objects/process_tree/exporter/variants/ptml.py | 4 +++- pm4py/objects/process_tree/importer/variants/ptml.py | 6 +++++- 12 files changed, 41 insertions(+), 9 deletions(-) diff --git a/pm4py/objects/bpmn/importer/variants/lxml.py b/pm4py/objects/bpmn/importer/variants/lxml.py index a0ebb01da..6028d0a7d 100644 --- a/pm4py/objects/bpmn/importer/variants/lxml.py +++ b/pm4py/objects/bpmn/importer/variants/lxml.py @@ -285,7 +285,10 @@ def apply(path, parameters=None): from lxml import etree, objectify parser = etree.XMLParser(remove_comments=True, encoding=encoding) - xml_tree = objectify.parse(path, parser=parser) + + F = open(path, "rb") + xml_tree = objectify.parse(F, parser=parser) + F.close() return import_xml_tree_from_root(xml_tree.getroot()) diff --git a/pm4py/objects/log/importer/xes/variants/iterparse.py b/pm4py/objects/log/importer/xes/variants/iterparse.py index f4f5affd5..948c98dc8 100644 --- a/pm4py/objects/log/importer/xes/variants/iterparse.py +++ b/pm4py/objects/log/importer/xes/variants/iterparse.py @@ -331,6 +331,7 @@ def import_log(filename, parameters=None): else: f = open(filename, "rb") context = etree.iterparse(f, events=[_EVENT_START, _EVENT_END], encoding=encoding) + f.close() return import_from_context(context, num_traces, parameters=parameters) diff --git a/pm4py/objects/log/importer/xes/variants/iterparse_20.py b/pm4py/objects/log/importer/xes/variants/iterparse_20.py index 79606e591..898c11037 100644 --- a/pm4py/objects/log/importer/xes/variants/iterparse_20.py +++ b/pm4py/objects/log/importer/xes/variants/iterparse_20.py @@ -331,6 +331,7 @@ def import_log(filename, parameters=None): else: f = open(filename, "rb") context = etree.iterparse(f, events=[_EVENT_START, _EVENT_END], encoding=encoding) + f.close() return import_from_context(context, num_traces, parameters=parameters) diff --git a/pm4py/objects/log/importer/xes/variants/iterparse_mem_compressed.py b/pm4py/objects/log/importer/xes/variants/iterparse_mem_compressed.py index 2579abc66..4e0add11a 100644 --- a/pm4py/objects/log/importer/xes/variants/iterparse_mem_compressed.py +++ b/pm4py/objects/log/importer/xes/variants/iterparse_mem_compressed.py @@ -329,6 +329,7 @@ def import_log(filename, parameters=None): else: f = open(filename, "rb") context = etree.iterparse(f, events=[_EVENT_START, _EVENT_END], encoding=encoding) + f.close() log = EventLog() return import_from_context(context, num_traces, log, parameters=parameters) diff --git a/pm4py/objects/ocel/exporter/xmlocel/variants/classic.py b/pm4py/objects/ocel/exporter/xmlocel/variants/classic.py index 7f9d6ca8a..875fb86f2 100644 --- a/pm4py/objects/ocel/exporter/xmlocel/variants/classic.py +++ b/pm4py/objects/ocel/exporter/xmlocel/variants/classic.py @@ -169,4 +169,7 @@ def apply(ocel: OCEL, target_path: str, parameters: Optional[Dict[Any, Any]] = N del objects_items tree = etree.ElementTree(root) - tree.write(target_path, pretty_print=True, xml_declaration=True, encoding=encoding) + + F = open(target_path, "wb") + tree.write(F, pretty_print=True, xml_declaration=True, encoding=encoding) + F.close() diff --git a/pm4py/objects/ocel/exporter/xmlocel/variants/ocel20.py b/pm4py/objects/ocel/exporter/xmlocel/variants/ocel20.py index a6880f416..400897ff7 100644 --- a/pm4py/objects/ocel/exporter/xmlocel/variants/ocel20.py +++ b/pm4py/objects/ocel/exporter/xmlocel/variants/ocel20.py @@ -164,4 +164,7 @@ def apply(ocel: OCEL, target_path: str, parameters: Optional[Dict[Any, Any]] = N event_attribute.text = str(v) tree = etree.ElementTree(root) - tree.write(target_path, pretty_print=True, xml_declaration=True, encoding=encoding) + + F = open(target_path, "wb") + tree.write(F, pretty_print=True, xml_declaration=True, encoding=encoding) + F.close() diff --git a/pm4py/objects/ocel/importer/xmlocel/variants/classic.py b/pm4py/objects/ocel/importer/xmlocel/variants/classic.py index cfccb33dd..4872abbfa 100644 --- a/pm4py/objects/ocel/importer/xmlocel/variants/classic.py +++ b/pm4py/objects/ocel/importer/xmlocel/variants/classic.py @@ -78,7 +78,11 @@ def apply(file_path: str, parameters: Optional[Dict[Any, Any]] = None) -> OCEL: date_parser = dt_parsing.parser.get() parser = etree.XMLParser(remove_comments=True, encoding=encoding) - tree = objectify.parse(file_path, parser=parser) + + F = open(file_path, "rb") + tree = objectify.parse(F, parser=parser) + F.close() + root = tree.getroot() for child in root: diff --git a/pm4py/objects/ocel/importer/xmlocel/variants/ocel20.py b/pm4py/objects/ocel/importer/xmlocel/variants/ocel20.py index 30a02f798..8cc2f44c1 100644 --- a/pm4py/objects/ocel/importer/xmlocel/variants/ocel20.py +++ b/pm4py/objects/ocel/importer/xmlocel/variants/ocel20.py @@ -57,7 +57,11 @@ def apply(file_path: str, parameters: Optional[Dict[Any, Any]] = None) -> OCEL: date_parser = dt_parsing.parser.get() parser = etree.XMLParser(remove_comments=True, encoding=encoding) - tree = objectify.parse(file_path, parser=parser) + + F = open(file_path, "rb") + tree = objectify.parse(F, parser=parser) + F.close() + root = tree.getroot() object_type_attributes = {} diff --git a/pm4py/objects/petri_net/exporter/variants/pnml.py b/pm4py/objects/petri_net/exporter/variants/pnml.py index 030219489..8f25ad2ad 100644 --- a/pm4py/objects/petri_net/exporter/variants/pnml.py +++ b/pm4py/objects/petri_net/exporter/variants/pnml.py @@ -259,4 +259,6 @@ def export_net(petrinet, marking, output_filename, final_marking=None, export_pr export_prom5=export_prom5) # write the tree to a file - tree.write(output_filename, pretty_print=True, xml_declaration=True, encoding=encoding) + F = open(output_filename, "wb") + tree.write(F, pretty_print=True, xml_declaration=True, encoding=encoding) + F.close() diff --git a/pm4py/objects/petri_net/importer/variants/pnml.py b/pm4py/objects/petri_net/importer/variants/pnml.py index dc1e52ab2..d2451e753 100644 --- a/pm4py/objects/petri_net/importer/variants/pnml.py +++ b/pm4py/objects/petri_net/importer/variants/pnml.py @@ -45,7 +45,11 @@ def import_net(input_file_path, parameters=None): encoding = exec_utils.get_param_value(Parameters.ENCODING, parameters, None) parser = etree.XMLParser(remove_comments=True, encoding=encoding) - tree = objectify.parse(input_file_path, parser=parser) + + F = open(input_file_path, "rb") + tree = objectify.parse(F, parser=parser) + F.close() + root = tree.getroot() return import_net_from_xml_object(root, parameters=parameters) diff --git a/pm4py/objects/process_tree/exporter/variants/ptml.py b/pm4py/objects/process_tree/exporter/variants/ptml.py index 1f38955f4..9b4a5e081 100644 --- a/pm4py/objects/process_tree/exporter/variants/ptml.py +++ b/pm4py/objects/process_tree/exporter/variants/ptml.py @@ -171,6 +171,8 @@ def apply(tree, output_path, parameters=None): tree = export_ptree_tree(tree, parameters=parameters) # exports the tree to a file - tree.write(output_path, pretty_print=True, xml_declaration=True, encoding=encoding) + F = open(output_path, "wb") + tree.write(F, pretty_print=True, xml_declaration=True, encoding=encoding) + F.close() return tree diff --git a/pm4py/objects/process_tree/importer/variants/ptml.py b/pm4py/objects/process_tree/importer/variants/ptml.py index ac8770afd..5f1fd6d42 100644 --- a/pm4py/objects/process_tree/importer/variants/ptml.py +++ b/pm4py/objects/process_tree/importer/variants/ptml.py @@ -37,7 +37,11 @@ def apply(path, parameters=None): encoding = exec_utils.get_param_value(Parameters.ENCODING, parameters, None) parser = etree.XMLParser(remove_comments=True, encoding=encoding) - xml_tree = objectify.parse(path, parser=parser) + + F = open(path, "rb") + xml_tree = objectify.parse(F, parser=parser) + F.close() + root = xml_tree.getroot() return import_tree_from_xml_object(root, parameters=parameters) From 8c9c87b9dc903fbde3d97607848fb127b74f81e3 Mon Sep 17 00:00:00 2001 From: Alessandro Berti Date: Fri, 6 Oct 2023 07:49:58 +0200 Subject: [PATCH 20/27] fix(pm4py): bug fix --- pm4py/objects/log/importer/xes/variants/iterparse.py | 5 +++-- pm4py/objects/log/importer/xes/variants/iterparse_20.py | 5 +++-- .../log/importer/xes/variants/iterparse_mem_compressed.py | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/pm4py/objects/log/importer/xes/variants/iterparse.py b/pm4py/objects/log/importer/xes/variants/iterparse.py index 948c98dc8..5755e2b32 100644 --- a/pm4py/objects/log/importer/xes/variants/iterparse.py +++ b/pm4py/objects/log/importer/xes/variants/iterparse.py @@ -331,9 +331,10 @@ def import_log(filename, parameters=None): else: f = open(filename, "rb") context = etree.iterparse(f, events=[_EVENT_START, _EVENT_END], encoding=encoding) - f.close() - return import_from_context(context, num_traces, parameters=parameters) + log = import_from_context(context, num_traces, parameters=parameters) + f.close() + return log def import_from_string(log_string, parameters=None): diff --git a/pm4py/objects/log/importer/xes/variants/iterparse_20.py b/pm4py/objects/log/importer/xes/variants/iterparse_20.py index 898c11037..a53a5e40d 100644 --- a/pm4py/objects/log/importer/xes/variants/iterparse_20.py +++ b/pm4py/objects/log/importer/xes/variants/iterparse_20.py @@ -331,9 +331,10 @@ def import_log(filename, parameters=None): else: f = open(filename, "rb") context = etree.iterparse(f, events=[_EVENT_START, _EVENT_END], encoding=encoding) - f.close() - return import_from_context(context, num_traces, parameters=parameters) + log = import_from_context(context, num_traces, parameters=parameters) + f.close() + return log def import_from_string(log_string, parameters=None): diff --git a/pm4py/objects/log/importer/xes/variants/iterparse_mem_compressed.py b/pm4py/objects/log/importer/xes/variants/iterparse_mem_compressed.py index 4e0add11a..84665a414 100644 --- a/pm4py/objects/log/importer/xes/variants/iterparse_mem_compressed.py +++ b/pm4py/objects/log/importer/xes/variants/iterparse_mem_compressed.py @@ -329,10 +329,11 @@ def import_log(filename, parameters=None): else: f = open(filename, "rb") context = etree.iterparse(f, events=[_EVENT_START, _EVENT_END], encoding=encoding) - f.close() log = EventLog() - return import_from_context(context, num_traces, log, parameters=parameters) + log = import_from_context(context, num_traces, log, parameters=parameters) + f.close() + return log def import_from_string(log_string, parameters=None): From a4288026b53906bb8ef0d42c2bd0018d7b888856 Mon Sep 17 00:00:00 2001 From: Alessandro Berti Date: Fri, 6 Oct 2023 07:54:47 +0200 Subject: [PATCH 21/27] fix(pm4py): fixed JSON-OCEL importing/exporting --- pm4py/objects/ocel/exporter/jsonocel/variants/classic.py | 4 +++- pm4py/objects/ocel/exporter/jsonocel/variants/ocel20.py | 4 +++- pm4py/objects/ocel/importer/jsonocel/variants/classic.py | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/pm4py/objects/ocel/exporter/jsonocel/variants/classic.py b/pm4py/objects/ocel/exporter/jsonocel/variants/classic.py index 0f0a37355..dfaee1e2d 100644 --- a/pm4py/objects/ocel/exporter/jsonocel/variants/classic.py +++ b/pm4py/objects/ocel/exporter/jsonocel/variants/classic.py @@ -104,4 +104,6 @@ def apply(ocel: OCEL, target_path: str, parameters: Optional[Dict[Any, Any]] = N base_object = get_base_json_object(ocel, parameters=parameters) - json.dump(base_object, open(target_path, "w", encoding=encoding), indent=2) + F = open(target_path, "w", encoding=encoding) + json.dump(base_object, F, indent=2) + F.close() diff --git a/pm4py/objects/ocel/exporter/jsonocel/variants/ocel20.py b/pm4py/objects/ocel/exporter/jsonocel/variants/ocel20.py index 8a4b3b871..9f75c6802 100644 --- a/pm4py/objects/ocel/exporter/jsonocel/variants/ocel20.py +++ b/pm4py/objects/ocel/exporter/jsonocel/variants/ocel20.py @@ -114,4 +114,6 @@ def apply(ocel: OCEL, target_path: str, parameters: Optional[Dict[Any, Any]] = N base_object[constants.OCEL_OBJECTS_KEY][oid][constants.OCEL_O2O_KEY].append({object_id: oid2, constants.DEFAULT_QUALIFIER: qualifier}) - json.dump(base_object, open(target_path, "w", encoding=encoding), indent=2) + F = open(target_path, "w", encoding=encoding) + json.dump(base_object, F, indent=2) + F.close() diff --git a/pm4py/objects/ocel/importer/jsonocel/variants/classic.py b/pm4py/objects/ocel/importer/jsonocel/variants/classic.py index f76c0f475..c4061c883 100644 --- a/pm4py/objects/ocel/importer/jsonocel/variants/classic.py +++ b/pm4py/objects/ocel/importer/jsonocel/variants/classic.py @@ -133,7 +133,9 @@ def apply(file_path: str, parameters: Optional[Dict[Any, Any]] = None) -> OCEL: encoding = exec_utils.get_param_value(Parameters.ENCODING, parameters, pm4_constants.DEFAULT_ENCODING) - json_obj = json.load(open(file_path, "r", encoding=encoding)) + F = open(file_path, "r", encoding=encoding) + json_obj = json.load(F) + F.close() log = get_base_ocel(json_obj, parameters=parameters) From 063a6d64bae61f1b54444e0b34ec0926b504aa34 Mon Sep 17 00:00:00 2001 From: Alessandro Berti Date: Fri, 6 Oct 2023 07:59:42 +0200 Subject: [PATCH 22/27] feat(pm4py): closing Graphviz objects --- pm4py/visualization/petri_net/common/visualize.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pm4py/visualization/petri_net/common/visualize.py b/pm4py/visualization/petri_net/common/visualize.py index 37526d3dc..ee7b06009 100644 --- a/pm4py/visualization/petri_net/common/visualize.py +++ b/pm4py/visualization/petri_net/common/visualize.py @@ -98,6 +98,8 @@ def graphviz_visualization(net, image_format="png", initial_marking=None, final_ font_size = str(font_size) filename = tempfile.NamedTemporaryFile(suffix='.gv') + filename.close() + viz = Digraph(net.name, filename=filename.name, engine='dot', graph_attr={'bgcolor': bgcolor}) if set_rankdir: viz.graph_attr['rankdir'] = set_rankdir From 49a472d002890b35e3f59ef93fd75f2e35455715 Mon Sep 17 00:00:00 2001 From: Alessandro Berti Date: Fri, 6 Oct 2023 11:22:26 +0200 Subject: [PATCH 23/27] removed legacy folder --- tests/older_py/minimal.txt | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 tests/older_py/minimal.txt diff --git a/tests/older_py/minimal.txt b/tests/older_py/minimal.txt deleted file mode 100644 index 353f05d66..000000000 --- a/tests/older_py/minimal.txt +++ /dev/null @@ -1,9 +0,0 @@ -stringdist -graphviz -intervaltree -numpy -pydotplus -networkx -pulp -deprecation -pandas From 70f03eb8eb897c37bc141d455043c77796da7254 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 6 Oct 2023 11:22:59 +0000 Subject: [PATCH 24/27] chore(deps): update dependency fonttools to v4.43.1 --- requirements_stable.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements_stable.txt b/requirements_stable.txt index 7c261caf5..8b32dd355 100644 --- a/requirements_stable.txt +++ b/requirements_stable.txt @@ -2,7 +2,7 @@ colorama==0.4.6 contourpy==1.1.1 cycler==0.12.0 deprecation==2.1.0 -fonttools==4.43.0 +fonttools==4.43.1 graphviz==0.20.1 intervaltree==3.1.0 kiwisolver==1.4.5 From 7d215d77d4f3d8b69243db11c2e16911995c3785 Mon Sep 17 00:00:00 2001 From: Alessandro Berti Date: Fri, 6 Oct 2023 15:19:26 +0200 Subject: [PATCH 25/27] docs(pm4py): updated README --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index fcaafc8d0..d9da3e156 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,9 @@ if __name__ == "__main__": pm4py can be installed on Python 3.9.x / 3.10.x / 3.11.x / 3.12.x by invoking: *pip install -U pm4py* +pm4py is also running on older Python environments with different requirements sets, including: +- Python 3.8 (3.8.10): third_party/old_python_deps/requirements_py38.txt + ## Requirements pm4py depends on some other Python packages, with different levels of importance: * *Essential requirements*: numpy, pandas, deprecation, networkx From d30ec0293d831aaa8c240ea5250fd7992a9adaab Mon Sep 17 00:00:00 2001 From: Alessandro Berti Date: Fri, 6 Oct 2023 15:23:24 +0200 Subject: [PATCH 26/27] docs(pm4py): updated changelog --- CHANGELOG.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 61b07cfaf..05805b406 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,15 +9,32 @@ f6993293d665e2f7b69c27ce0f09d2df4e889b0b f0240670292086cb3b6fe523b1646dcfa4c71ddc * Refactoring OCEL import/export +* c1379120480539f5578a52ce6d76effb4819b3c6 + * centralized enabling/disabling of TQDM progress bar + Disabling progress bar in tests +* 08c2c16d17d2cbe26224662032a298f6b0a409a9 + * avoiding the necessity of re-creating setup.py when new packages are added to pm4py +* a7dc86f7fd821b5dd229ff404b5afa3b5ad919b4 + * disable IM fallthroughs in the simplified interface ### Deprecated ### Fixed +* 063a6d64bae61f1b54444e0b34ec0926b504aa34 + * properly closing file objects in different pm4py importers/exporters (XES, PNML, PTML, ...) +* 35f13b65a0523f889748679fbe90cf2d041e1038 + * fixing XES importing warnings in obtaining the resulting pd.DataFrame +* ef548ef18f514ad6ad0a32a104f380b322ab72e7 + * fixing test/examples execution +* d1b39bde1b14f160c0fff42bdc6b172bb0ae760e + * fix Petri net serialization +* e51c5e1e084a7fd7d13cb8d1381f868435762cca + * fixing TBR diagnostics when the methods are called on pd.DataFrame ### Removed ### Other - +* 49a472d002890b35e3f59ef93fd75f2e35455715 + * storing stable pm4py Python requirements for the old Python 3.8 --- From f4e53a87d26011fb7d51db46d8d3a54dd139e6b8 Mon Sep 17 00:00:00 2001 From: Alessandro Berti Date: Fri, 6 Oct 2023 15:28:02 +0200 Subject: [PATCH 27/27] updated release date --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05805b406..6ca69b0e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog of pm4py -## pm4py 2.7.8 (2023.10.XX) +## pm4py 2.7.8 (2023.10.06) ### Added