diff --git a/pm4py/analysis.py b/pm4py/analysis.py index 75439953a..6ce570179 100644 --- a/pm4py/analysis.py +++ b/pm4py/analysis.py @@ -207,8 +207,6 @@ def cluster_log(log: Union[EventLog, EventStream, pd.DataFrame], sklearn_cluster for clust_log in pm4py.cluster_log(df): print(clust_log) """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception( - "the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) properties = get_properties(log, activity_key=activity_key, case_id_key=case_id_key, timestamp_key=timestamp_key) @@ -237,8 +235,6 @@ def insert_artificial_start_end(log: Union[EventLog, pd.DataFrame], activity_key dataframe = pm4py.insert_artificial_start_end(dataframe, activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception( - "the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) properties = get_properties(log, activity_key=activity_key, case_id_key=case_id_key, timestamp_key=timestamp_key) @@ -278,8 +274,6 @@ def insert_case_service_waiting_time(log: Union[EventLog, pd.DataFrame], service dataframe = pm4py.insert_case_service_waiting_time(dataframe, activity_key='concept:name', timestamp_key='time:timestamp', case_id_key='case:concept:name', start_timestamp_key='time:timestamp') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception( - "the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) properties = get_properties(log, activity_key=activity_key, case_id_key=case_id_key, timestamp_key=timestamp_key) @@ -313,8 +307,6 @@ def insert_case_arrival_finish_rate(log: Union[EventLog, pd.DataFrame], arrival_ dataframe = pm4py.insert_case_arrival_finish_rate(dataframe, activity_key='concept:name', timestamp_key='time:timestamp', case_id_key='case:concept:name', start_timestamp_key='time:timestamp') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception( - "the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) properties = get_properties(log, activity_key=activity_key, case_id_key=case_id_key, timestamp_key=timestamp_key) diff --git a/pm4py/conformance.py b/pm4py/conformance.py index d08c0016d..cffbfcd8d 100644 --- a/pm4py/conformance.py +++ b/pm4py/conformance.py @@ -80,7 +80,6 @@ def conformance_diagnostics_token_based_replay(log: Union[EventLog, pd.DataFrame net, im, fm = pm4py.discover_petri_net_inductive(dataframe, activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') tbr_diagnostics = pm4py.conformance_diagnostics_token_based_replay(dataframe, net, im, fm, activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) if check_is_pandas_dataframe(log): @@ -143,7 +142,6 @@ def conformance_diagnostics_alignments(log: Union[EventLog, pd.DataFrame], *args net, im, fm = pm4py.discover_petri_net_inductive(dataframe, activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') alignments_diagnostics = pm4py.conformance_diagnostics_alignments(dataframe, net, im, fm, activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) if check_is_pandas_dataframe(log): @@ -241,7 +239,6 @@ def fitness_token_based_replay(log: Union[EventLog, pd.DataFrame], petri_net: Pe net, im, fm = pm4py.discover_petri_net_inductive(dataframe, activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') fitness_tbr = pm4py.fitness_token_based_replay(dataframe, net, im, fm, activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) if check_is_pandas_dataframe(log): @@ -291,7 +288,6 @@ def fitness_alignments(log: Union[EventLog, pd.DataFrame], petri_net: PetriNet, net, im, fm = pm4py.discover_petri_net_inductive(dataframe, activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') fitness_alignments = pm4py.fitness_alignments(dataframe, net, im, fm, activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) if check_is_pandas_dataframe(log): @@ -338,7 +334,6 @@ def precision_token_based_replay(log: Union[EventLog, pd.DataFrame], petri_net: net, im, fm = pm4py.discover_petri_net_inductive(dataframe, activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') precision_tbr = pm4py.precision_token_based_replay(dataframe, net, im, fm, activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) if check_is_pandas_dataframe(log): @@ -388,7 +383,6 @@ def precision_alignments(log: Union[EventLog, pd.DataFrame], petri_net: PetriNet net, im, fm = pm4py.discover_petri_net_inductive(dataframe, activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') precision_alignments = pm4py.precision_alignments(dataframe, net, im, fm, activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) if check_is_pandas_dataframe(log): @@ -666,7 +660,6 @@ def conformance_temporal_profile(log: Union[EventLog, pd.DataFrame], temporal_pr temporal_profile = pm4py.discover_temporal_profile(dataframe, activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') conformance_temporal_profile = pm4py.conformance_temporal_profile(dataframe, temporal_profile, zeta=1, activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) if check_is_pandas_dataframe(log): @@ -707,8 +700,6 @@ def conformance_declare(log: Union[EventLog, pd.DataFrame], declare_model: Dict[ declare_model = pm4py.discover_declare(log) conf_result = pm4py.conformance_declare(log, declare_model) """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception( - "the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) if check_is_pandas_dataframe(log): @@ -769,7 +760,6 @@ def conformance_log_skeleton(log: Union[EventLog, pd.DataFrame], log_skeleton: D log_skeleton = pm4py.discover_log_skeleton(dataframe, noise_threshold=0.1, activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') conformance_lsk = pm4py.conformance_log_skeleton(dataframe, log_skeleton, activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) if check_is_pandas_dataframe(log): diff --git a/pm4py/convert.py b/pm4py/convert.py index 3310de8fa..35adc080c 100644 --- a/pm4py/convert.py +++ b/pm4py/convert.py @@ -55,7 +55,6 @@ def convert_to_event_log(obj: Union[pd.DataFrame, EventStream], case_id_key: str dataframe = pm4py.format_dataframe(dataframe, case_id_column='case:concept:name', activity_column='concept:name', timestamp_column='time:timestamp') log = pm4py.convert_to_event_log(dataframe) """ - if type(obj) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") if check_is_pandas_dataframe(obj): check_pandas_dataframe_columns(obj, case_id_key=case_id_key) @@ -88,8 +87,6 @@ def convert_to_event_stream(obj: Union[EventLog, pd.DataFrame], case_id_key: str event_stream = pm4py.convert_to_event_stream(log) """ - if type(obj) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") - if check_is_pandas_dataframe(obj): check_pandas_dataframe_columns(obj, case_id_key=case_id_key) @@ -119,8 +116,6 @@ def convert_to_dataframe(obj: Union[EventStream, EventLog], **kwargs) -> pd.Data log = pm4py.read_xes("tests/input_data/running-example.xes") dataframe = pm4py.convert_to_dataframe(log) """ - if type(obj) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") - if check_is_pandas_dataframe(obj): check_pandas_dataframe_columns(obj) @@ -299,9 +294,6 @@ def convert_log_to_ocel(log: Union[EventLog, EventStream, pd.DataFrame], activit ocel = pm4py.convert_log_to_ocel(log, activity_column='concept:name', timestamp_column='time:timestamp', object_types=['case:concept:name']) """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: - raise Exception( - "the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) if isinstance(log, EventStream): @@ -392,8 +384,6 @@ def convert_log_to_time_intervals(log: Union[EventLog, pd.DataFrame], filter_act time_intervals = pm4py.convert_log_to_time_intervals(log, ('Confirmation of receipt', 'T02 Check confirmation of receipt')) print(len(time_intervals)) """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception( - "the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) properties = get_properties(log, activity_key=activity_key, case_id_key=case_id_key, timestamp_key=timestamp_key) diff --git a/pm4py/discovery.py b/pm4py/discovery.py index 99899b5e3..f0961032c 100644 --- a/pm4py/discovery.py +++ b/pm4py/discovery.py @@ -59,9 +59,6 @@ def discover_dfg(log: Union[EventLog, pd.DataFrame], activity_key: str = "concep dfg, start_activities, end_activities = pm4py.discover_dfg(dataframe, case_id_key='case:concept:name', activity_key='concept:name', timestamp_key='time:timestamp') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: - raise Exception( - "the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) properties = get_properties( @@ -94,10 +91,6 @@ def discover_dfg(log: Union[EventLog, pd.DataFrame], activity_key: str = "concep def discover_directly_follows_graph(log: Union[EventLog, pd.DataFrame], activity_key: str = "concept:name", timestamp_key: str = "time:timestamp", case_id_key: str = "case:concept:name") -> Tuple[dict, dict, dict]: - if type(log) not in [pd.DataFrame, EventLog, EventStream]: - raise Exception( - "the method can be applied only to a traditional event log!") - return discover_dfg(log, activity_key=activity_key, timestamp_key=timestamp_key, case_id_key=case_id_key) @@ -163,9 +156,6 @@ def discover_performance_dfg(log: Union[EventLog, pd.DataFrame], business_hours: performance_dfg, start_activities, end_activities = pm4py.discover_performance_dfg(dataframe, case_id_key='case:concept:name', activity_key='concept:name', timestamp_key='time:timestamp') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: - raise Exception( - "the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) properties = get_properties( @@ -216,9 +206,6 @@ def discover_petri_net_alpha(log: Union[EventLog, pd.DataFrame], activity_key: s net, im, fm = pm4py.discover_petri_net_alpha(dataframe, activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: - raise Exception( - "the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) if check_is_pandas_dataframe(log): @@ -246,9 +233,6 @@ def discover_petri_net_ilp(log: Union[EventLog, pd.DataFrame], alpha: float = 1. net, im, fm = pm4py.discover_petri_net_ilp(dataframe, activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: - raise Exception( - "the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) if check_is_pandas_dataframe(log): @@ -279,9 +263,6 @@ def discover_petri_net_alpha_plus(log: Union[EventLog, pd.DataFrame], activity_k net, im, fm = pm4py.discover_petri_net_alpha_plus(dataframe, activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: - raise Exception( - "the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) if check_is_pandas_dataframe(log): @@ -316,9 +297,6 @@ def discover_petri_net_inductive(log: Union[EventLog, pd.DataFrame, DFG], multi_ net, im, fm = pm4py.discover_petri_net_inductive(dataframe, activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream, DFG]: - raise Exception( - "the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) if check_is_pandas_dataframe(log): @@ -354,9 +332,6 @@ def discover_petri_net_heuristics(log: Union[EventLog, pd.DataFrame], dependency net, im, fm = pm4py.discover_petri_net_heuristics(dataframe, activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: - raise Exception( - "the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) from pm4py.algo.discovery.heuristics.variants import classic as heuristics_miner @@ -398,9 +373,6 @@ def discover_process_tree_inductive(log: Union[EventLog, pd.DataFrame, DFG], noi process_tree = pm4py.discover_process_tree_inductive(dataframe, activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream, DFG]: - raise Exception( - "the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) if check_is_pandas_dataframe(log): @@ -448,9 +420,6 @@ def discover_heuristics_net(log: Union[EventLog, pd.DataFrame], dependency_thres heu_net = pm4py.discover_heuristics_net(dataframe, activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: - raise Exception( - "the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) from pm4py.algo.discovery.heuristics.variants import classic as heuristics_miner @@ -490,9 +459,6 @@ def derive_minimum_self_distance(log: Union[DataFrame, EventLog, EventStream], a msd = pm4py.derive_minimum_self_distance(dataframe, activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: - raise Exception( - "the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) if check_is_pandas_dataframe(log): @@ -541,9 +507,6 @@ def discover_eventually_follows_graph(log: Union[EventLog, pd.DataFrame], activi efg = pm4py.discover_eventually_follows_graph(dataframe, activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: - raise Exception( - "the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) properties = get_properties( @@ -582,9 +545,6 @@ def discover_bpmn_inductive(log: Union[EventLog, pd.DataFrame, DFG], noise_thres bpmn_graph = pm4py.discover_bpmn_inductive(dataframe, activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream, DFG]: - raise Exception( - "the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) if check_is_pandas_dataframe(log): @@ -617,9 +577,6 @@ def discover_transition_system(log: Union[EventLog, pd.DataFrame], direction: st transition_system = pm4py.discover_transition_system(dataframe, activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: - raise Exception( - "the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) if check_is_pandas_dataframe(log): @@ -652,9 +609,6 @@ def discover_prefix_tree(log: Union[EventLog, pd.DataFrame], activity_key: str = prefix_tree = pm4py.discover_prefix_tree(dataframe, activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: - raise Exception( - "the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) if check_is_pandas_dataframe(log): @@ -698,9 +652,6 @@ def discover_temporal_profile(log: Union[EventLog, pd.DataFrame], activity_key: temporal_profile = pm4py.discover_temporal_profile(dataframe, activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: - raise Exception( - "the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) if check_is_pandas_dataframe(log): @@ -751,9 +702,6 @@ def discover_log_skeleton(log: Union[EventLog, pd.DataFrame], noise_threshold: f log_skeleton = pm4py.discover_log_skeleton(dataframe, noise_threshold=0.1, activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: - raise Exception( - "the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) if check_is_pandas_dataframe(log): @@ -791,9 +739,6 @@ def discover_declare(log: Union[EventLog, pd.DataFrame], allowed_templates: Opti declare_model = pm4py.discover_declare(log) """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: - raise Exception( - "the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) if check_is_pandas_dataframe(log): @@ -832,9 +777,6 @@ def discover_powl(log: Union[EventLog, pd.DataFrame], activity_key: str = "conce powl_model = pm4py.discover_powl(log, activity_key='concept:name') print(powl_model) """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: - raise Exception( - "the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) if check_is_pandas_dataframe(log): @@ -892,9 +834,6 @@ def discover_batches(log: Union[EventLog, pd.DataFrame], merge_distance: int = 1 batches = pm4py.discover_log_skeleton(dataframe, activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp', resource_key='org:resource') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: - raise Exception( - "the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) if check_is_pandas_dataframe(log): diff --git a/pm4py/filtering.py b/pm4py/filtering.py index 522ad0bcf..3d5893266 100644 --- a/pm4py/filtering.py +++ b/pm4py/filtering.py @@ -51,7 +51,6 @@ def filter_log_relative_occurrence_event_attribute(log: Union[EventLog, pd.DataF filtered_dataframe = pm4py.filter_log_relative_occurrence_event_attribute(dataframe, 0.5, level='cases', case_id_key='case:concept:name', timestamp_key='time:timestamp') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) parameters = get_properties(log, timestamp_key=timestamp_key, case_id_key=case_id_key, activity_key=attribute_key) @@ -87,7 +86,6 @@ def filter_start_activities(log: Union[EventLog, pd.DataFrame], activities: Unio filtered_dataframe = pm4py.filter_start_activities(dataframe, ['Act. A'], activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) parameters = get_properties(log, activity_key=activity_key, timestamp_key=timestamp_key, case_id_key=case_id_key) @@ -123,7 +121,6 @@ def filter_end_activities(log: Union[EventLog, pd.DataFrame], activities: Union filtered_dataframe = pm4py.filter_end_activities(dataframe, ['Act. Z'], activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) parameters = get_properties(log, activity_key=activity_key, timestamp_key=timestamp_key, case_id_key=case_id_key) @@ -159,7 +156,6 @@ def filter_event_attribute_values(log: Union[EventLog, pd.DataFrame], attribute_ filtered_dataframe = pm4py.filter_event_attribute_values(dataframe, 'concept:name', ['Act. A', 'Act. Z'], case_id_key='case:concept:name') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) parameters = get_properties(log, case_id_key=case_id_key) @@ -203,7 +199,6 @@ def filter_trace_attribute_values(log: Union[EventLog, pd.DataFrame], attribute_ filtered_dataframe = pm4py.filter_trace_attribute_values(dataframe, 'case:creator', ['Mike'], case_id_key='case:concept:name') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) parameters = get_properties(log, case_id_key=case_id_key) @@ -239,7 +234,6 @@ def filter_variants(log: Union[EventLog, pd.DataFrame], variants: Union[Set[str filtered_dataframe = pm4py.filter_variants(dataframe, [('Act. A', 'Act. B', 'Act. Z'), ('Act. A', 'Act. C', 'Act. Z')], activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) from pm4py.util import variants_util @@ -278,7 +272,6 @@ def filter_directly_follows_relation(log: Union[EventLog, pd.DataFrame], relatio filtered_dataframe = pm4py.filter_directly_follows_relation(dataframe, [('A','B'),('A','C')], activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) parameters = get_properties(log, activity_key=activity_key, timestamp_key=timestamp_key, case_id_key=case_id_key) @@ -376,7 +369,6 @@ def filter_time_range(log: Union[EventLog, pd.DataFrame], dt1: str, dt2: str, mo filtered_dataframe1 = pm4py.filter_time_range(dataframe, '2010-01-01 00:00:00', '2011-01-01 00:00:00', mode='traces_intersecting', case_id_key='case:concept:name', timestamp_key='time:timestamp') filtered_dataframe1 = pm4py.filter_time_range(dataframe, '2010-01-01 00:00:00', '2011-01-01 00:00:00', mode='events', case_id_key='case:concept:name', timestamp_key='time:timestamp') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) properties = get_properties(log, timestamp_key=timestamp_key, case_id_key=case_id_key) @@ -442,7 +434,6 @@ def filter_between(log: Union[EventLog, pd.DataFrame], act1: str, act2: str, act filtered_dataframe = pm4py.filter_between(dataframe, 'A', 'D', activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) parameters = get_properties(log, activity_key=activity_key, timestamp_key=timestamp_key, case_id_key=case_id_key) @@ -472,7 +463,6 @@ def filter_case_size(log: Union[EventLog, pd.DataFrame], min_size: int, max_size filtered_dataframe = pm4py.filter_case_size(dataframe, 5, 10, case_id_key='case:concept:name') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) parameters = get_properties(log, case_id_key=case_id_key) @@ -505,7 +495,6 @@ def filter_case_performance(log: Union[EventLog, pd.DataFrame], min_performance: filtered_dataframe = pm4py.filter_case_performance(dataframe, 3600.0, 86400.0, timestamp_key='time:timestamp', case_id_key='case:concept:name') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) parameters = get_properties(log, timestamp_key=timestamp_key, case_id_key=case_id_key) @@ -536,7 +525,6 @@ def filter_activities_rework(log: Union[EventLog, pd.DataFrame], activity: str, filtered_dataframe = pm4py.filter_activities_rework(dataframe, 'Approve Order', 2, activity_key='concept:name', timestamp_key='time:timestamp', case_id_key='case:concept:name') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) parameters = get_properties(log, activity_key=activity_key, timestamp_key=timestamp_key, case_id_key=case_id_key) @@ -572,7 +560,6 @@ def filter_paths_performance(log: Union[EventLog, pd.DataFrame], path: Tuple[str filtered_dataframe = pm4py.filter_paths_performance(dataframe, ('A', 'D'), 3600.0, 86400.0, activity_key='concept:name', timestamp_key='time:timestamp', case_id_key='case:concept:name') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) parameters = get_properties(log, activity_key=activity_key, timestamp_key=timestamp_key, case_id_key=case_id_key) @@ -606,7 +593,6 @@ def filter_variants_top_k(log: Union[EventLog, pd.DataFrame], k: int, activity_k filtered_dataframe = pm4py.filter_variants_top_k(dataframe, 5, activity_key='concept:name', timestamp_key='time:timestamp', case_id_key='case:concept:name') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) parameters = get_properties(log, activity_key=activity_key, timestamp_key=timestamp_key, case_id_key=case_id_key) @@ -639,7 +625,6 @@ def filter_variants_by_coverage_percentage(log: Union[EventLog, pd.DataFrame], m filtered_dataframe = pm4py.filter_variants_by_coverage_percentage(dataframe, 0.1, activity_key='concept:name', timestamp_key='time:timestamp', case_id_key='case:concept:name') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) parameters = get_properties(log, activity_key=activity_key, timestamp_key=timestamp_key, case_id_key=case_id_key) @@ -714,7 +699,6 @@ def filter_prefixes(log: Union[EventLog, pd.DataFrame], activity: str, strict=Tr filtered_dataframe = pm4py.filter_prefixes(dataframe, 'Act. C', activity_key='concept:name', timestamp_key='time:timestamp', case_id_key='case:concept:name') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) parameters = get_properties(log, activity_key=activity_key, timestamp_key=timestamp_key, case_id_key=case_id_key) @@ -759,7 +743,6 @@ def filter_suffixes(log: Union[EventLog, pd.DataFrame], activity: str, strict=Tr filtered_dataframe = pm4py.filter_prefixes(dataframe, 'Act. C', activity_key='concept:name', timestamp_key='time:timestamp', case_id_key='case:concept:name') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) parameters = get_properties(log, activity_key=activity_key, timestamp_key=timestamp_key, case_id_key=case_id_key) @@ -943,7 +926,6 @@ def filter_four_eyes_principle(log: Union[EventLog, pd.DataFrame], activity1: st filtered_dataframe = pm4py.filter_four_eyes_principle(dataframe, 'Act. A', 'Act. B', activity_key='concept:name', resource_key='org:resource', timestamp_key='time:timestamp', case_id_key='case:concept:name') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) properties = get_properties(log, activity_key=activity_key, timestamp_key=timestamp_key, case_id_key=case_id_key, resource_key=resource_key) @@ -977,7 +959,6 @@ def filter_activity_done_different_resources(log: Union[EventLog, pd.DataFrame], filtered_dataframe = pm4py.filter_activity_done_different_resources(dataframe, 'Act. A', activity_key='concept:name', resource_key='org:resource', timestamp_key='time:timestamp', case_id_key='case:concept:name') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) properties = get_properties(log, activity_key=activity_key, timestamp_key=timestamp_key, case_id_key=case_id_key, resource_key=resource_key) diff --git a/pm4py/llm.py b/pm4py/llm.py index 6711fec14..36715c30b 100644 --- a/pm4py/llm.py +++ b/pm4py/llm.py @@ -73,7 +73,6 @@ def abstract_dfg(log_obj: Union[pd.DataFrame, EventLog, EventStream], max_len: i log = pm4py.read_xes("tests/input_data/roadtraffic100traces.xes") print(pm4py.llm.abstract_dfg(log)) """ - if type(log_obj) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log_obj) parameters = get_properties( @@ -112,7 +111,6 @@ def abstract_variants(log_obj: Union[pd.DataFrame, EventLog, EventStream], max_l log = pm4py.read_xes("tests/input_data/roadtraffic100traces.xes") print(pm4py.llm.abstract_variants(log)) """ - if type(log_obj) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log_obj) parameters = get_properties( @@ -225,7 +223,6 @@ def abstract_event_stream(log_obj: Union[pd.DataFrame, EventLog, EventStream], m log = pm4py.read_xes("tests/input_data/roadtraffic100traces.xes") print(pm4py.llm.abstract_event_stream(log)) """ - if type(log_obj) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log_obj) parameters = get_properties( @@ -279,7 +276,6 @@ def abstract_log_attributes(log_obj: Union[pd.DataFrame, EventLog, EventStream], log = pm4py.read_xes("tests/input_data/roadtraffic100traces.xes") print(pm4py.llm.abstract_log_attributes(log)) """ - if type(log_obj) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log_obj) parameters = get_properties( @@ -308,7 +304,6 @@ def abstract_log_features(log_obj: Union[pd.DataFrame, EventLog, EventStream], m log = pm4py.read_xes("tests/input_data/roadtraffic100traces.xes") print(pm4py.llm.abstract_log_features(log)) """ - if type(log_obj) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log_obj) parameters = get_properties( diff --git a/pm4py/ml.py b/pm4py/ml.py index 366a6b751..24d77e120 100644 --- a/pm4py/ml.py +++ b/pm4py/ml.py @@ -47,7 +47,6 @@ def split_train_test(log: Union[EventLog, pd.DataFrame], train_percentage: float train_df, test_df = pm4py.split_train_test(dataframe, train_percentage=0.75) """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) if check_is_pandas_dataframe(log): @@ -86,7 +85,6 @@ def get_prefixes_from_log(log: Union[EventLog, pd.DataFrame], length: int, case_ trimmed_df = pm4py.get_prefixes_from_log(dataframe, length=5, case_id_key='case:concept:name') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) if check_is_pandas_dataframe(log): @@ -120,8 +118,6 @@ def extract_outcome_enriched_dataframe(log: Union[EventLog, pd.DataFrame], activ enriched_df = pm4py.extract_outcome_enriched_dataframe(log, activity_key='concept:name', timestamp_key='time:timestamp', case_id_key='case:concept:name', start_timestamp_key='time:timestamp') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception( - "the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) properties = get_properties(log, activity_key=activity_key, case_id_key=case_id_key, timestamp_key=timestamp_key) @@ -159,7 +155,6 @@ def extract_features_dataframe(log: Union[EventLog, pd.DataFrame], str_tr_attr=N features_df = pm4py.extract_features_dataframe(dataframe, activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) parameters = {} @@ -266,7 +261,6 @@ def extract_temporal_features_dataframe(log: Union[EventLog, pd.DataFrame], grou temporal_features_df = pm4py.extract_temporal_features_dataframe(dataframe, activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) parameters = get_properties(log, activity_key=activity_key, timestamp_key=timestamp_key, case_id_key=case_id_key) @@ -305,7 +299,6 @@ def extract_target_vector(log: Union[EventLog, pd.DataFrame], variant: str, acti vector_rem_time, class_rem_time = pm4py.extract_target_vector(log, 'remaining_time', activity_key='concept:name', timestamp_key='time:timestamp', case_id_key='case:concept:name') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) parameters = get_properties(log, activity_key=activity_key, timestamp_key=timestamp_key, case_id_key=case_id_key) diff --git a/pm4py/org.py b/pm4py/org.py index 8f72009f9..7f1368028 100644 --- a/pm4py/org.py +++ b/pm4py/org.py @@ -50,7 +50,6 @@ def discover_handover_of_work_network(log: Union[EventLog, pd.DataFrame], beta=0 metric = pm4py.discover_handover_of_work_network(dataframe, resource_key='org:resource', timestamp_key='time:timestamp', case_id_key='case:concept:name') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) from pm4py.algo.organizational_mining.sna import algorithm as sna @@ -79,7 +78,6 @@ def discover_working_together_network(log: Union[EventLog, pd.DataFrame], resour metric = pm4py.discover_working_together_network(dataframe, resource_key='org:resource', timestamp_key='time:timestamp', case_id_key='case:concept:name') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) properties = get_properties(log, resource_key=resource_key, timestamp_key=timestamp_key, case_id_key=case_id_key) @@ -108,7 +106,6 @@ def discover_activity_based_resource_similarity(log: Union[EventLog, pd.DataFram act_res_sim = pm4py.discover_activity_based_resource_similarity(dataframe, resource_key='org:resource', activity_key='concept:name', timestamp_key='time:timestamp', case_id_key='case:concept:name') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) properties = get_properties(log, activity_key=activity_key, resource_key=resource_key, timestamp_key=timestamp_key, case_id_key=case_id_key) @@ -137,7 +134,6 @@ def discover_subcontracting_network(log: Union[EventLog, pd.DataFrame], n=2, res metric = pm4py.discover_subcontracting_network(dataframe, resource_key='org:resource', timestamp_key='time:timestamp', case_id_key='case:concept:name') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) from pm4py.algo.organizational_mining.sna import algorithm as sna @@ -171,7 +167,6 @@ def discover_organizational_roles(log: Union[EventLog, pd.DataFrame], activity_k roles = pm4py.discover_organizational_roles(dataframe, resource_key='org:resource', activity_key='concept:name', timestamp_key='time:timestamp', case_id_key='case:concept:name') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) properties = get_properties(log, activity_key=activity_key, resource_key=resource_key, timestamp_key=timestamp_key, case_id_key=case_id_key) @@ -226,7 +221,6 @@ def discover_network_analysis(log: Union[pd.DataFrame, EventLog, EventStream], o net_ana = pm4py.discover_network_analysis(dataframe, out_column='case:concept:name', in_column='case:concept:name', node_column_source='org:resource', node_column_target='org:resource', edge_column='concept:name') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) if check_is_pandas_dataframe(log): diff --git a/pm4py/stats.py b/pm4py/stats.py index 7e4949b85..b2c8ae8d3 100644 --- a/pm4py/stats.py +++ b/pm4py/stats.py @@ -49,7 +49,6 @@ def get_start_activities(log: Union[EventLog, pd.DataFrame], activity_key: str = start_activities = pm4py.get_start_activities(dataframe, activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) properties = get_properties(log, activity_key=activity_key, timestamp_key=timestamp_key, case_id_key=case_id_key) @@ -79,7 +78,6 @@ def get_end_activities(log: Union[EventLog, pd.DataFrame], activity_key: str = " end_activities = pm4py.get_end_activities(dataframe, activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) properties = get_properties(log, activity_key=activity_key, timestamp_key=timestamp_key, case_id_key=case_id_key) @@ -106,7 +104,6 @@ def get_event_attributes(log: Union[EventLog, pd.DataFrame]) -> List[str]: event_attributes = pm4py.get_event_attributes(dataframe) """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) if check_is_pandas_dataframe(log): @@ -130,7 +127,6 @@ def get_trace_attributes(log: Union[EventLog, pd.DataFrame]) -> List[str]: trace_attributes = pm4py.get_trace_attributes(dataframe) """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) from pm4py.util import constants @@ -158,7 +154,6 @@ def get_event_attribute_values(log: Union[EventLog, pd.DataFrame], attribute: st activities = pm4py.get_event_attribute_values(dataframe, 'concept:name', case_id_key='case:concept:name') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) parameters = get_properties(log, case_id_key=case_id_key) @@ -187,7 +182,6 @@ def get_trace_attribute_values(log: Union[EventLog, pd.DataFrame], attribute: st tr_attr_values = pm4py.get_trace_attribute_values(dataframe, 'case:attribute', case_id_key='case:concept:name') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) parameters = get_properties(log, case_id_key=case_id_key) @@ -249,7 +243,6 @@ def get_variants_as_tuples(log: Union[EventLog, pd.DataFrame], activity_key: str variants = pm4py.get_variants_as_tuples(dataframe, activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) properties = get_properties(log, activity_key=activity_key, timestamp_key=timestamp_key, case_id_key=case_id_key) @@ -291,8 +284,6 @@ def split_by_process_variant(log: Union[EventLog, pd.DataFrame], activity_key: s print(variant) print(subdf) """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception( - "the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) import pm4py @@ -352,8 +343,6 @@ def get_variants_paths_duration(log: Union[EventLog, pd.DataFrame], activity_key var_paths_durs = pm4py.get_variants_paths_duration(dataframe) print(var_paths_durs) """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception( - "the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) check_pandas_dataframe_columns(log, activity_key=activity_key, timestamp_key=timestamp_key, case_id_key=case_id_key) @@ -439,7 +428,6 @@ def get_minimum_self_distances(log: Union[EventLog, pd.DataFrame], activity_key: msd = pm4py.get_minimum_self_distances(dataframe, activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') ''' - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) if check_is_pandas_dataframe(log): @@ -472,7 +460,6 @@ def get_minimum_self_distance_witnesses(log: Union[EventLog, pd.DataFrame], acti msd_wit = pm4py.get_minimum_self_distance_witnesses(dataframe, activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) if check_is_pandas_dataframe(log): @@ -499,7 +486,6 @@ def get_case_arrival_average(log: Union[EventLog, pd.DataFrame], activity_key: s case_arr_avg = pm4py.get_case_arrival_average(dataframe, activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) properties = get_properties(log, activity_key=activity_key, timestamp_key=timestamp_key, case_id_key=case_id_key) @@ -532,7 +518,6 @@ def get_rework_cases_per_activity(log: Union[EventLog, pd.DataFrame], activity_k rework = pm4py.get_rework_cases_per_activity(dataframe, activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) properties = get_properties(log, activity_key=activity_key, timestamp_key=timestamp_key, case_id_key=case_id_key) @@ -563,7 +548,6 @@ def get_case_overlap(log: Union[EventLog, pd.DataFrame], activity_key: str = "co overlap = pm4py.get_case_overlap(dataframe, activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) properties = get_properties(log, activity_key=activity_key, timestamp_key=timestamp_key, case_id_key=case_id_key) @@ -604,7 +588,6 @@ def get_cycle_time(log: Union[EventLog, pd.DataFrame], activity_key: str = "conc cycle_time = pm4py.get_cycle_time(dataframe, activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) properties = get_properties(log, activity_key=activity_key, timestamp_key=timestamp_key, case_id_key=case_id_key) @@ -636,7 +619,6 @@ def get_all_case_durations(log: Union[EventLog, pd.DataFrame], business_hours: b case_durations = pm4py.get_all_case_durations(dataframe, activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) properties = get_properties(log, activity_key=activity_key, timestamp_key=timestamp_key, case_id_key=case_id_key) @@ -671,7 +653,6 @@ def get_case_duration(log: Union[EventLog, pd.DataFrame], case_id: str, business duration = pm4py.get_case_duration(dataframe, 'case 1', activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) properties = get_properties(log, activity_key=activity_key, timestamp_key=timestamp_key, case_id_key=case_id_key) @@ -709,7 +690,6 @@ def get_activity_position_summary(log: Union[EventLog, pd.DataFrame], activity: act_pos = pm4py.get_activity_position_summary(dataframe, 'Act. A', activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) if check_is_pandas_dataframe(log): diff --git a/pm4py/utils.py b/pm4py/utils.py index 87eb39859..64aa22f33 100644 --- a/pm4py/utils.py +++ b/pm4py/utils.py @@ -60,8 +60,6 @@ def format_dataframe(df: pd.DataFrame, case_id: str = constants.CASE_CONCEPT_NAM dataframe = pd.read_csv('event_log.csv') dataframe = pm4py.format_dataframe(dataframe, case_id_key='case:concept:name', activity_key='concept:name', timestamp_key='time:timestamp', start_timestamp_key='start_timestamp', timest_format='%Y-%m-%d %H:%M:%S') """ - if type(df) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") - if timest_format is None: timest_format = constants.DEFAULT_TIMESTAMP_PARSE_FORMAT @@ -350,7 +348,6 @@ def set_classifier(log, classifier, classifier_attribute=constants.DEFAULT_CLASS :param classifier_attribute: The attribute of the event that should store the concatenation of the attribute values for the given classifier :rtype: ``Union[EventLog, pd.DataFrame]`` """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) if type(classifier) is list: @@ -454,7 +451,6 @@ def project_on_event_attribute(log: Union[EventLog, pd.DataFrame], attribute_key list_list_activities = pm4py.project_on_event_attribute(dataframe, 'concept:name') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) output = [] diff --git a/pm4py/vis.py b/pm4py/vis.py index a7f60645f..a433bfc05 100644 --- a/pm4py/vis.py +++ b/pm4py/vis.py @@ -381,8 +381,6 @@ def __dotted_attribute_selection(log: Union[EventLog, pd.DataFrame], attributes) """ Default attribute selection for the dotted chart """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") - if check_is_pandas_dataframe(log): check_pandas_dataframe_columns(log) @@ -433,8 +431,6 @@ def view_dotted_chart(log: Union[EventLog, pd.DataFrame], format: str = "png", a """ format = str(format).lower() - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") - if check_is_pandas_dataframe(log): check_pandas_dataframe_columns(log) @@ -483,7 +479,6 @@ def save_vis_dotted_chart(log: Union[EventLog, pd.DataFrame], file_path: str, at pm4py.save_vis_dotted_chart(dataframe, 'dotted.png', attributes=['time:timestamp', 'concept:name', 'org:resource']) """ file_path = str(file_path) - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") if check_is_pandas_dataframe(log): check_pandas_dataframe_columns(log) @@ -579,8 +574,6 @@ def view_case_duration_graph(log: Union[EventLog, pd.DataFrame], format: str = " """ format = str(format).lower() - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") - if check_is_pandas_dataframe(log): check_pandas_dataframe_columns(log, activity_key=activity_key, case_id_key=case_id_key, timestamp_key=timestamp_key) from pm4py.statistics.traces.generic.pandas import case_statistics @@ -611,7 +604,6 @@ def save_vis_case_duration_graph(log: Union[EventLog, pd.DataFrame], file_path: pm4py.save_vis_case_duration_graph(dataframe, 'duration.png', activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') """ file_path = str(file_path) - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") if check_is_pandas_dataframe(log): check_pandas_dataframe_columns(log, activity_key=activity_key, case_id_key=case_id_key, timestamp_key=timestamp_key) @@ -645,8 +637,6 @@ def view_events_per_time_graph(log: Union[EventLog, pd.DataFrame], format: str = """ format = str(format).lower() - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") - if check_is_pandas_dataframe(log): check_pandas_dataframe_columns(log, activity_key=activity_key, case_id_key=case_id_key, timestamp_key=timestamp_key) from pm4py.statistics.attributes.pandas import get as attributes_get @@ -677,7 +667,6 @@ def save_vis_events_per_time_graph(log: Union[EventLog, pd.DataFrame], file_path pm4py.save_vis_events_per_time_graph(dataframe, 'ev_time.png', activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') """ file_path = str(file_path) - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") if check_is_pandas_dataframe(log): check_pandas_dataframe_columns(log, activity_key=activity_key, case_id_key=case_id_key, timestamp_key=timestamp_key) @@ -719,8 +708,6 @@ def view_performance_spectrum(log: Union[EventLog, pd.DataFrame], activities: Li """ format = str(format).lower() - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") - if check_is_pandas_dataframe(log): check_pandas_dataframe_columns(log, activity_key=activity_key, case_id_key=case_id_key, timestamp_key=timestamp_key) @@ -757,7 +744,6 @@ def save_vis_performance_spectrum(log: Union[EventLog, pd.DataFrame], activities pm4py.save_vis_performance_spectrum(dataframe, ['Act. A', 'Act. C', 'Act. D'], 'perf_spec.png', activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') """ file_path = str(file_path) - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") if check_is_pandas_dataframe(log): check_pandas_dataframe_columns(log, activity_key=activity_key, case_id_key=case_id_key, timestamp_key=timestamp_key) @@ -777,8 +763,6 @@ def __builds_events_distribution_graph(log: Union[EventLog, pd.DataFrame], param """ Internal method to build the events distribution graph """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") - if distr_type == "days_month": title = "Distribution of the Events over the Days of a Month"; x_axis = "Day of month"; @@ -838,8 +822,6 @@ def view_events_distribution_graph(log: Union[EventLog, pd.DataFrame], distr_typ """ format = str(format).lower() - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") - if check_is_pandas_dataframe(log): check_pandas_dataframe_columns(log, activity_key=activity_key, case_id_key=case_id_key, timestamp_key=timestamp_key) @@ -875,7 +857,6 @@ def save_vis_events_distribution_graph(log: Union[EventLog, pd.DataFrame], file_ pm4py.save_vis_events_distribution_graph(dataframe, 'ev_distr_graph.png', distr_type='days_week', activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp') """ file_path = str(file_path) - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") if check_is_pandas_dataframe(log): check_pandas_dataframe_columns(log, activity_key=activity_key, case_id_key=case_id_key, timestamp_key=timestamp_key) diff --git a/pm4py/write.py b/pm4py/write.py index f9b7a0417..918d2ed7c 100644 --- a/pm4py/write.py +++ b/pm4py/write.py @@ -47,7 +47,6 @@ def write_xes(log: Union[EventLog, pd.DataFrame], file_path: str, case_id_key: s pm4py.write_xes(log, '', case_id_key='case:concept:name') """ - if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!") __event_log_deprecation_warning(log) if check_is_pandas_dataframe(log):