Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/hotfixes' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
fit-alessandro-berti committed Nov 15, 2023
2 parents d0b03d6 + 5633153 commit 55c2912
Show file tree
Hide file tree
Showing 33 changed files with 338 additions and 217 deletions.
2 changes: 1 addition & 1 deletion examples/activity_position.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


def execute_script():
dataframe = pd.read_csv(os.path.join("..", "tests", "input_data", "receipt.csv"), dtype_backend=constants.DEFAULT_PANDAS_PARSING_DTYPE_BACKEND)
dataframe = pd.read_csv(os.path.join("..", "tests", "input_data", "receipt.csv"))
dataframe["time:timestamp"] = pd.to_datetime(dataframe["time:timestamp"], utc=True, format="ISO8601")
# prints the summary of the positions of two activities
print(pm4py.get_activity_position_summary(dataframe, "Confirmation of receipt"))
Expand Down
2 changes: 1 addition & 1 deletion examples/corr_mining.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


def execute_script():
df = pd.read_csv("../tests/input_data/interval_event_log.csv", dtype_backend=constants.DEFAULT_PANDAS_PARSING_DTYPE_BACKEND)
df = pd.read_csv("../tests/input_data/interval_event_log.csv")
df = dataframe_utils.convert_timestamp_columns_in_df(df, timest_format="ISO8601")
act_count = dict(df["concept:name"].value_counts())
parameters = {}
Expand Down
2 changes: 1 addition & 1 deletion examples/dataframe_prefix_and_fea_extraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

def execute_script():
# loads a dataframe. setup dates
df = pd.read_csv("../tests/input_data/receipt.csv", dtype_backend=constants.DEFAULT_PANDAS_PARSING_DTYPE_BACKEND)
df = pd.read_csv("../tests/input_data/receipt.csv")
df = dataframe_utils.convert_timestamp_columns_in_df(df, timest_format="ISO8601")
print(df)
# insert the case index in the dataframe
Expand Down
2 changes: 1 addition & 1 deletion examples/df_to_log_postpro.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


def execute_script():
dataframe = pd.read_csv(os.path.join("..", "tests", "input_data", "running-example.csv"), dtype_backend=constants.DEFAULT_PANDAS_PARSING_DTYPE_BACKEND)
dataframe = pd.read_csv(os.path.join("..", "tests", "input_data", "running-example.csv"))
dataframe = pm4py.format_dataframe(dataframe, timest_format="ISO8601")
log = log_converter.apply(dataframe, variant=log_converter.Variants.TO_EVENT_LOG, parameters={"stream_postprocessing": False})
pm4py.write_xes(log, "non_postprocessed.xes")
Expand Down
2 changes: 1 addition & 1 deletion examples/dfg_min_ex_pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

def execute_script():
log_path = os.path.join("..", "tests", "input_data", "interval_event_log.csv")
dataframe = pd.read_csv(log_path, dtype_backend=constants.DEFAULT_PANDAS_PARSING_DTYPE_BACKEND)
dataframe = pd.read_csv(log_path)
log_path = os.path.join("..", "tests", "input_data", "reviewing.xes")
log = pm4py.read_xes(log_path)
dataframe = pm4py.convert_to_dataframe(log)
Expand Down
2 changes: 1 addition & 1 deletion examples/events_distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


def execute_script():
df = pd.read_csv(os.path.join("..", "tests", "input_data", "receipt.csv"), dtype_backend=constants.DEFAULT_PANDAS_PARSING_DTYPE_BACKEND)
df = pd.read_csv(os.path.join("..", "tests", "input_data", "receipt.csv"))
df["time:timestamp"] = pd.to_datetime(df["time:timestamp"], utc=True, format="ISO8601")
# plots the distribution of the events over the days of a month
x0, y0 = attr_get.get_events_distribution(df, distr_type="days_month")
Expand Down
2 changes: 1 addition & 1 deletion examples/heuminer_plusplus.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


def execute_script():
df = pd.read_csv("../tests/input_data/interval_event_log.csv", dtype_backend=constants.DEFAULT_PANDAS_PARSING_DTYPE_BACKEND)
df = pd.read_csv("../tests/input_data/interval_event_log.csv")
df["time:timestamp"] = pd.to_datetime(df["time:timestamp"], utc=True, format="ISO8601")
df["start_timestamp"] = pd.to_datetime(df["start_timestamp"], utc=True, format="ISO8601")
log = pm4py.read_xes("../tests/input_data/interval_event_log.xes")
Expand Down
2 changes: 1 addition & 1 deletion examples/link_analysis_vbfa.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


def execute_script():
dataframe = pd.read_csv(os.path.join("..", "tests", "input_data", "ocel", "VBFA.zip"), compression="zip", dtype="str", dtype_backend=constants.DEFAULT_PANDAS_PARSING_DTYPE_BACKEND)
dataframe = pd.read_csv(os.path.join("..", "tests", "input_data", "ocel", "VBFA.zip"), compression="zip", dtype="str")
dataframe["time:timestamp"] = dataframe["ERDAT"] + " " + dataframe["ERZET"]
dataframe["time:timestamp"] = pd.to_datetime(dataframe["time:timestamp"], format="%Y%m%d %H%M%S")
dataframe["RFWRT"] = dataframe["RFWRT"].astype(float)
Expand Down
6 changes: 3 additions & 3 deletions examples/merging_case_relations.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@


def execute_script():
dataframe1 = pd.read_csv(os.path.join("..", "tests", "input_data", "interleavings", "receipt_even.csv"), dtype_backend=constants.DEFAULT_PANDAS_PARSING_DTYPE_BACKEND)
dataframe1 = pd.read_csv(os.path.join("..", "tests", "input_data", "interleavings", "receipt_even.csv"))
dataframe1["time:timestamp"] = pd.to_datetime(dataframe1["time:timestamp"], utc=True, format="ISO8601")
dataframe2 = pd.read_csv(os.path.join("..", "tests", "input_data", "interleavings", "receipt_odd.csv"), dtype_backend=constants.DEFAULT_PANDAS_PARSING_DTYPE_BACKEND)
dataframe2 = pd.read_csv(os.path.join("..", "tests", "input_data", "interleavings", "receipt_odd.csv"))
dataframe2["time:timestamp"] = pd.to_datetime(dataframe2["time:timestamp"], utc=True, format="ISO8601")
case_relations = pd.read_csv(os.path.join("..", "tests", "input_data", "interleavings", "case_relations.csv"), dtype_backend=constants.DEFAULT_PANDAS_PARSING_DTYPE_BACKEND)
case_relations = pd.read_csv(os.path.join("..", "tests", "input_data", "interleavings", "case_relations.csv"))
merged = case_relations_merging.apply(dataframe1, dataframe2, case_relations)
dfg, sa, ea = pm4py.discover_dfg(merged)
pm4py.view_dfg(dfg, sa, ea, format=examples_conf.TARGET_IMG_FORMAT)
Expand Down
2 changes: 1 addition & 1 deletion examples/perf_spectrum_visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def execute_script():
log = pm4py.read_xes(os.path.join("..", "tests", "input_data", "receipt.xes"))
pm4py.view_performance_spectrum(log, ["Confirmation of receipt", "T04 Determine confirmation of receipt",
"T10 Determine necessity to stop indication"], format=examples_conf.TARGET_IMG_FORMAT)
df = pd.read_csv(os.path.join("..", "tests", "input_data", "receipt.csv"), dtype_backend=constants.DEFAULT_PANDAS_PARSING_DTYPE_BACKEND)
df = pd.read_csv(os.path.join("..", "tests", "input_data", "receipt.csv"))
df["time:timestamp"] = pd.to_datetime(df["time:timestamp"], utc=True, format="ISO8601")
pm4py.view_performance_spectrum(df, ["Confirmation of receipt", "T04 Determine confirmation of receipt",
"T10 Determine necessity to stop indication"], format=examples_conf.TARGET_IMG_FORMAT)
Expand Down
2 changes: 1 addition & 1 deletion examples/simplified_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def execute_script():
log1 = pm4py.read_xes("../tests/input_data/running-example.xes")

# reads a CSV into a dataframe
df = pd.read_csv("../tests/input_data/running-example.csv", dtype_backend=constants.DEFAULT_PANDAS_PARSING_DTYPE_BACKEND)
df = pd.read_csv("../tests/input_data/running-example.csv")
df["time:timestamp"] = pd.to_datetime(df["time:timestamp"], utc=True, format="ISO8601")
df["case:concept:name"] = df["case:concept:name"].astype("string")

Expand Down
2 changes: 1 addition & 1 deletion examples/temporal_profile_dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


def execute_script():
dataframe = pd.read_csv("../tests/input_data/receipt.csv", dtype_backend=constants.DEFAULT_PANDAS_PARSING_DTYPE_BACKEND)
dataframe = pd.read_csv("../tests/input_data/receipt.csv")
dataframe = dataframe_utils.convert_timestamp_columns_in_df(dataframe, timest_format="ISO8601")
tf = temporal_profile_discovery.apply(dataframe)
conformance = temporal_profile_conformance.apply(dataframe, tf, parameters={"zeta": 6.0})
Expand Down
2 changes: 1 addition & 1 deletion examples/timestamp_granularity.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


def execute_script():
dataframe = pd.read_csv("../tests/input_data/receipt.csv", dtype_backend=constants.DEFAULT_PANDAS_PARSING_DTYPE_BACKEND)
dataframe = pd.read_csv("../tests/input_data/receipt.csv")
dataframe = pm4py.format_dataframe(dataframe, timest_format="ISO8601")

# prints the original timestamp column of the dataframe
Expand Down
6 changes: 3 additions & 3 deletions examples/timestamp_interleavings.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@


def execute_script():
receipt_even = pd.read_csv(os.path.join("..", "tests", "input_data", "interleavings", "receipt_even.csv"), dtype_backend=constants.DEFAULT_PANDAS_PARSING_DTYPE_BACKEND)
receipt_even = pd.read_csv(os.path.join("..", "tests", "input_data", "interleavings", "receipt_even.csv"))
receipt_even["time:timestamp"] = pd.to_datetime(receipt_even["time:timestamp"], utc=True, format="ISO8601")
receipt_odd = pd.read_csv(os.path.join("..", "tests", "input_data", "interleavings", "receipt_odd.csv"), dtype_backend=constants.DEFAULT_PANDAS_PARSING_DTYPE_BACKEND)
receipt_odd = pd.read_csv(os.path.join("..", "tests", "input_data", "interleavings", "receipt_odd.csv"))
receipt_odd["time:timestamp"] = pd.to_datetime(receipt_odd["time:timestamp"], utc=True, format="ISO8601")
case_relations = pd.read_csv(os.path.join("..", "tests", "input_data", "interleavings", "case_relations.csv"), dtype_backend=constants.DEFAULT_PANDAS_PARSING_DTYPE_BACKEND)
case_relations = pd.read_csv(os.path.join("..", "tests", "input_data", "interleavings", "case_relations.csv"))
interleavings_dataframe = interleavings_miner.apply(receipt_even, receipt_odd, case_relations)
print(interleavings_dataframe)
# print the frequency and the direction of the interleavings
Expand Down
Loading

0 comments on commit 55c2912

Please sign in to comment.