Skip to content

Commit 8bea3b6

Browse files
Merge remote-tracking branch 'upstream/release' into release
2 parents df540bf + c49ebd4 commit 8bea3b6

File tree

13 files changed

+65
-91
lines changed

13 files changed

+65
-91
lines changed

RELEASE_NOTES

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
===== PM4Py 2.0.1.2 =====
2+
This is a minor release, fixing the compatibility of the streaming package with Python 3.5.x - 3.7.x
3+
14
===== PM4Py 2.0.1 =====
25
This is a minor release, consisting of the following changes:
36
1. commit 81579e19e

docs/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
author = 'Fraunhofer FIT'
2525

2626
# The short X.Y version
27-
version = '2.0'
27+
version = '2.0.1'
2828
# The full version, including alpha/beta/rc tags
29-
release = '4'
29+
release = '2.0.1'
3030

3131
# -- General configuration ---------------------------------------------------
3232

examples/pn_to_pt.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from pm4py.evaluation.wf_net import evaluator as is_wf_net
77
from pm4py.objects.conversion.process_tree import converter as pt_converter
88
from pm4py.objects.conversion.wf_net import converter as wf_net_converter
9-
from pm4py.objects.process_tree.util import fold
109

1110

1211
def execute_script():
@@ -30,25 +29,17 @@ def execute_script():
3029
parameters={woflan.Parameters.RETURN_ASAP_WHEN_NOT_SOUND: True,
3130
woflan.Parameters.PRINT_DIAGNOSTICS: False}))
3231
try:
33-
tree_alpha = wf_net_converter.apply(alpha_petri_net, alpha_im, alpha_fm, parameters={"debug": False})
34-
if tree_alpha is not None:
35-
tree_alpha = fold(tree_alpha)
32+
tree_alpha = wf_net_converter.apply(alpha_petri_net, alpha_im, alpha_fm)
3633
print(tree_alpha)
3734
except:
3835
traceback.print_exc()
3936
try:
40-
tree_heuristics = wf_net_converter.apply(heuristics_petri_net, heuristics_im, heuristics_fm,
41-
parameters={"debug": False})
42-
if tree_heuristics is not None:
43-
tree_heuristics = fold(tree_heuristics)
37+
tree_heuristics = wf_net_converter.apply(heuristics_petri_net, heuristics_im, heuristics_fm)
4438
print(tree_heuristics)
4539
except:
4640
traceback.print_exc()
4741
try:
48-
tree_inductive = wf_net_converter.apply(inductive_petri_net, inductive_im, inductive_fm,
49-
parameters={"debug": False})
50-
if tree_inductive is not None:
51-
tree_inductive = fold(tree_inductive)
42+
tree_inductive = wf_net_converter.apply(inductive_petri_net, inductive_im, inductive_fm)
5243
print(tree_inductive)
5344
pm4py.view_process_tree(tree_inductive, format="svg")
5445
except:

examples/streaming_conformance_footprints.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def execute_script():
3232
# the conditions on the closure of all the cases are checked
3333
# (for each case, it is checked whether the end activity of the case
3434
# is possible according to the footprints)
35-
diagn_df = conf_obj._current_result()
35+
diagn_df = conf_obj.get()
3636
conf_obj.terminate_all()
3737
print(diagn_df)
3838
print(diagn_df[diagn_df["is_fit"] == False])

examples/streaming_conformance_tbr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def execute_script():
2929
# sends a termination signal to the conformance checking algorithm;
3030
# the conditions on the closure of all the cases are checked
3131
# (for each case, it is checked whether the final marking is reached)
32-
diagn_df = conf_obj._current_result()
32+
diagn_df = conf_obj.get()
3333
conf_obj.terminate_all()
3434
print(diagn_df)
3535
print(diagn_df[diagn_df["is_fit"] == False])

examples/streaming_discovery_dfg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def execute_script():
2525
# stops the live event stream
2626
live_stream.stop()
2727
# gets the DFG along with the start and end activities from the stream
28-
dfg, activities, start_activities, end_activities = stream_dfg_disc._current_result()
28+
dfg, activities, start_activities, end_activities = stream_dfg_disc.get()
2929
# visualize the DFG
3030
gviz = dfg_visualizer.apply(dfg, variant=dfg_visualizer.Variants.FREQUENCY, activities_count=activities,
3131
parameters={"start_activities": start_activities, "end_activities": end_activities})

pm4py/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
else:
5656
logging.error("intervaltree is not available. This can lead some features of PM4Py to not work correctly!")
5757

58-
__version__ = '2.0.1.1'
58+
__version__ = '2.0.1.2'
5959
__doc__ = "Process Mining for Python (PM4Py)"
6060
__author__ = 'Fraunhofer Institute for Applied Technology'
6161
__author_email__ = 'pm4py@fit.fraunhofer.de'
@@ -78,8 +78,8 @@
7878
from pm4py.stats import get_start_activities, get_end_activities, get_attributes, get_attribute_values, get_variants, \
7979
get_trace_attributes
8080

81-
# this package is available only for Python >= 3.7
82-
if sys.version_info >= (3, 7):
81+
# this package is available only for Python >= 3.5
82+
if sys.version_info >= (3, 5):
8383
from pm4py import streaming
8484

8585
if pkgutil.find_loader("sympy"):

pm4py/filtering.py

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,5 @@
1-
import pkgutil
2-
3-
from pm4py.util import constants, xes_constants
4-
5-
6-
def check_is_dataframe(log):
7-
if pkgutil.find_loader("pandas"):
8-
import pandas as pd
9-
return type(log) is pd.DataFrame
10-
11-
return False
12-
13-
14-
def check_dataframe_columns(df):
15-
"""
16-
Checks if the dataframe contains all the required columns.
17-
If not, raise an exception
18-
19-
Parameters
20-
--------------
21-
df
22-
Pandas dataframe
23-
"""
24-
if len(set(df.columns).intersection(
25-
set([constants.CASE_CONCEPT_NAME, xes_constants.DEFAULT_NAME_KEY,
26-
xes_constants.DEFAULT_TIMESTAMP_KEY]))) < 3:
27-
raise Exception(
28-
"please format your dataframe accordingly! df = pm4py.format_dataframe(df, case_id='<name of the case ID column>', activity_key='<name of the activity column>', timestamp_key='<name of the timestamp column>')")
1+
from pm4py.util import constants
2+
from pm4py.util.pandas_utils import check_is_dataframe, check_dataframe_columns
293

304

315
def filter_start_activities(log, admitted_start_activities):

pm4py/read.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,9 @@ def read_csv(file_path, sep=",", quotechar=None, encoding='utf-8', nrows=1000000
5959
logging.error(
6060
"Less than three columns were imported from the CSV file. Please check the specification of the separation and the quote character!")
6161
else:
62-
logging.warning(
63-
"Please specify the format of the dataframe: df = pm4py.format_dataframe(df, case_id='<name of the case ID column>', activity_key='<name of the activity column>', timestamp_key='<name of the timestamp column>')")
62+
#logging.warning(
63+
# "Please specify the format of the dataframe: df = pm4py.format_dataframe(df, case_id='<name of the case ID column>', activity_key='<name of the activity column>', timestamp_key='<name of the timestamp column>')")
64+
pass
6465

6566
return df
6667

@@ -99,8 +100,8 @@ def format_dataframe(df, case_id=constants.CASE_CONCEPT_NAME, activity_key=xes_c
99100
df = pandas_utils.insert_index(df, INDEX_COLUMN)
100101
# sorts the dataframe
101102
df = df.sort_values([constants.CASE_CONCEPT_NAME, xes_constants.DEFAULT_TIMESTAMP_KEY, INDEX_COLUMN])
102-
logging.warning(
103-
"please convert the dataframe for advanced process mining applications. log = pm4py.convert_to_event_log(df)")
103+
# logging.warning(
104+
# "please convert the dataframe for advanced process mining applications. log = pm4py.convert_to_event_log(df)")
104105
return df
105106

106107

pm4py/stats.py

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,4 @@
1-
import pkgutil
2-
3-
from pm4py.util import constants, xes_constants
4-
5-
6-
def check_is_dataframe(log):
7-
if pkgutil.find_loader("pandas"):
8-
import pandas as pd
9-
return type(log) is pd.DataFrame
10-
return False
11-
12-
13-
def check_dataframe_columns(df):
14-
"""
15-
Checks if the dataframe contains all the required columns.
16-
If not, raise an exception
17-
18-
Parameters
19-
--------------
20-
df
21-
Pandas dataframe
22-
"""
23-
if len(set(df.columns).intersection(
24-
{constants.CASE_CONCEPT_NAME, xes_constants.DEFAULT_NAME_KEY, xes_constants.DEFAULT_TIMESTAMP_KEY})) < 3:
25-
raise Exception(
26-
"please format your dataframe accordingly! df = pm4py.format_dataframe(df, case_id='<name of the case ID column>', activity_key='<name of the activity column>', timestamp_key='<name of the timestamp column>')")
1+
from pm4py.util.pandas_utils import check_is_dataframe, check_dataframe_columns
272

283

294
def get_start_activities(log):

0 commit comments

Comments
 (0)