Skip to content

Commit 05067ec

Browse files
Merge branch 'release' into release-github
# Conflicts: # pm4py/algo/discovery/minimum_self_distance/__init__.py # pm4py/algo/discovery/performance_spectrum/variants/dataframe.py # pm4py/algo/discovery/performance_spectrum/variants/dataframe_disconnected.py # pm4py/algo/discovery/performance_spectrum/variants/log_disconnected.py # pm4py/meta.py # pm4py/objects/log/util/sorting.py # pm4py/vis.py # pm4py/visualization/graphs/variants/__init__.py # pm4py/visualization/graphs/visualizer.py
2 parents 13e3670 + 7688bcf commit 05067ec

File tree

87 files changed

+3209
-432
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+3209
-432
lines changed

CHANGELOG.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,52 @@
11
# PM4Py Changelog
22

3+
## PM4PY 2.2.9 (2021.06.25)
4+
5+
### Fixed
6+
7+
* daf74e83
8+
* update imports in feature extraction
9+
* 74be3e3c
10+
* minor bug fix in alpha plus (place that was created was not always added to the resulting Petri net)
11+
12+
### Removed
13+
14+
### Deprecated
15+
16+
### Changed
17+
18+
* d97b1790
19+
* drop deepcopy in event log sorting (enhances performance)
20+
* 1d4e625b
21+
* revised IMf implementation (more close to ProM / PhD thesis Sander Leemans)
22+
* 20aabd95
23+
* calculation of minimum self distance now adheres to the standard invocation structure
24+
25+
### Added
26+
27+
* 598c6ecb
28+
* simplified interface now stores properties (using attr attribute) to dataframes
29+
* 1f7a3fa8
30+
* add computation of rework statistic (cases containing the same activity more than once)
31+
* 32c7d330
32+
* add computation of cycle time (active time of process divided by the number of instances of the process)
33+
* 8187f0e9
34+
* add distribution plots over different time-frames (matplotlib)
35+
* 269d826c
36+
* add batch detection based on Martin, N., Swennen, M., Depaire, B., Jans, M., Caris, A., & Vanhoof, K. (2015,
37+
December). Batch Processing: Definition and Event Log Identification. In SIMPDA (pp. 137-140).
38+
* d5326d46
39+
* compute case overlap of a case with all other cases
40+
41+
### Other
42+
43+
* 92a70586
44+
* performance optimization for calculation of performance spectrum
45+
* b0fc57c4
46+
* performance optimization for Pandas datetime conversion non-ISO8601 (regular formats)
47+
48+
---
49+
350
## PM4PY 2.2.8 (2021.06.11)
451

552
### Fixed

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# The short X.Y version
2727
version = '2.2'
2828
# The full version, including alpha/beta/rc tags
29-
release = '2.2.8'
29+
release = '2.2.9'
3030

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

examples/bath_detection.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import pm4py
2+
from pm4py.algo.discovery.batches import algorithm
3+
import os
4+
5+
6+
def execute_script():
7+
log = pm4py.read_xes(os.path.join("..", "tests", "input_data", "receipt.xes"))
8+
# detect the batches from the event log
9+
batches = algorithm.apply(log)
10+
# print the batches (complete information) in a single row
11+
print(batches)
12+
# print a summary information (size) for each activity-resource combination that is performed in batches
13+
for batch in batches:
14+
print(batch[0], batch[1])
15+
16+
17+
if __name__ == "__main__":
18+
execute_script()

examples/case_overlap_stat.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import pm4py
2+
import os
3+
from pm4py.statistics.traces.case_overlap.log import get as wip_get
4+
5+
6+
def execute_script():
7+
log = pm4py.read_xes(os.path.join("..", "tests", "input_data", "receipt.xes"))
8+
# calculates the WIP statistics from the event log object.
9+
# The WIP statistic associates to each case the number of cases open during the lifecycle of the case
10+
wip = wip_get.apply(log)
11+
print(wip)
12+
13+
14+
if __name__ == "__main__":
15+
execute_script()

examples/cycle_time.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import os
2+
3+
import pm4py
4+
from pm4py.statistics.traces.cycle_time.log import get as cycle_time_get
5+
6+
7+
def execute_script():
8+
log = pm4py.read_xes(os.path.join("..", "tests", "input_data", "interval_event_log.xes"))
9+
print(cycle_time_get.apply(log, parameters={cycle_time_get.Parameters.START_TIMESTAMP_KEY: "start_timestamp",
10+
cycle_time_get.Parameters.TIMESTAMP_KEY: "time:timestamp"}))
11+
12+
13+
if __name__ == "__main__":
14+
execute_script()

examples/decisiontree_trivial_example.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,17 @@
33
from sklearn import tree
44

55
from pm4py.objects.log.importer.xes import importer as xes_importer
6-
from pm4py.objects.log.util import get_log_representation, get_class_representation
6+
from pm4py.objects.log.util import get_class_representation
7+
from pm4py.algo.transformation.log_to_features import algorithm as log_to_features
78
from pm4py.visualization.decisiontree import visualizer as dt_vis
89

910

1011
def execute_script():
1112
log_path = os.path.join("..", "tests", "input_data", "roadtraffic50traces.xes")
1213
# log_path = os.path.join("..", "tests", "input_data", "receipt.xes")
1314
log = xes_importer.apply(log_path)
14-
# gets a log representation by including the concept:name event attribute (string) and the amount event attribute
15-
# (float)
16-
# data, feature_names = get_log_representation.get_representation(log, [], ["concept:name"], [], ["amount"])
1715
# now, it is possible to get a default representation of an event log
18-
data, feature_names = get_log_representation.get_default_representation(log)
16+
data, feature_names = log_to_features.apply(log, variant=log_to_features.Variants.TRACE_BASED)
1917
# gets classes representation by final concept:name value (end activity)
2018
target, classes = get_class_representation.get_class_representation_by_str_ev_attr_value_value(log, "concept:name")
2119
# mine the decision tree given 'data' and 'target'

examples/events_distribution.py

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import os
2+
3+
import pandas as pd
4+
5+
import pm4py
6+
from pm4py.statistics.attributes.pandas import get as attr_get
7+
from pm4py.visualization.graphs import visualizer
8+
9+
10+
def execute_script():
11+
df = pd.read_csv(os.path.join("..", "tests", "input_data", "receipt.csv"))
12+
df = pm4py.format_dataframe(df)
13+
# plots the distribution of the events over the days of a month
14+
x0, y0 = attr_get.get_events_distribution(df, distr_type="days_month")
15+
gviz = visualizer.apply(x0, y0, variant=visualizer.Variants.BARPLOT,
16+
parameters={"format": "svg", "title": "Distribution of the Events over the Days of a Month",
17+
"x_axis": "Day of month", "y_axis": "Number of Events"})
18+
visualizer.view(gviz)
19+
# plots the distribution of the events over the months
20+
x1, y1 = attr_get.get_events_distribution(df, distr_type="months")
21+
gviz = visualizer.apply(x1, y1, variant=visualizer.Variants.BARPLOT,
22+
parameters={"format": "svg", "title": "Distribution of the Events over the Months",
23+
"x_axis": "Month", "y_axis": "Number of Events"})
24+
visualizer.view(gviz)
25+
# plots the distribution of the events over the years
26+
x2, y2 = attr_get.get_events_distribution(df, distr_type="years")
27+
gviz = visualizer.apply(x2, y2, variant=visualizer.Variants.BARPLOT,
28+
parameters={"format": "svg", "title": "Distribution of the Events over the Years",
29+
"x_axis": "Year", "y_axis": "Number of Events"})
30+
visualizer.view(gviz)
31+
# plots the distribution of the events over the hours (of the day)
32+
x3, y3 = attr_get.get_events_distribution(df, distr_type="hours")
33+
gviz = visualizer.apply(x3, y3, variant=visualizer.Variants.BARPLOT,
34+
parameters={"format": "svg", "title": "Distribution of the Events over the Hours",
35+
"x_axis": "Hour (of day)", "y_axis": "Number of Events"})
36+
visualizer.view(gviz)
37+
# plots the distribution of the events over the days of the week
38+
x4, y4 = attr_get.get_events_distribution(df, distr_type="days_week")
39+
gviz = visualizer.apply(x4, y4, variant=visualizer.Variants.BARPLOT,
40+
parameters={"format": "svg", "title": "Distribution of the Events over the Days of a Week",
41+
"x_axis": "Day of the Week", "y_axis": "Number of Events"})
42+
visualizer.view(gviz)
43+
44+
45+
if __name__ == "__main__":
46+
execute_script()

examples/rework.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import pm4py
2+
import os
3+
from pm4py.statistics.rework.log import get as rework_get
4+
5+
6+
def execute_script():
7+
log = pm4py.read_xes(os.path.join("..", "tests", "input_data", "receipt.xes"))
8+
rework = rework_get.apply(log)
9+
print(rework)
10+
11+
12+
if __name__ == "__main__":
13+
execute_script()

0 commit comments

Comments
 (0)