pm4py / pm4py-core

Public repository for the PM4Py (Process Mining for Python) project.
https://pm4py.fit.fraunhofer.de
GNU General Public License v3.0
722 stars 286 forks source link

Filtering on timeframe #59

Closed andionita closed 5 years ago

andionita commented 5 years ago

Hi,

timestamp_filter.filter_traces_intersecting seems to not produce the output that is expected, i.e. return traces that have at least one event inside the specified time interval.

Consider the example:

xes_file_path = os.path.join('pm4py-source', 'tests', 'input_data', 'running-example.xes')
trace_log = xes_importer.import_log(xes_file_path)
trace_log = sorting.sort_timestamp(trace_log)
trace_log = timestamp_filter.filter_traces_intersecting(trace_log, "2011-01-05 00:00:00", "2011-01-10 23:59:59")

All cases in the example have events inside the time interval above and outside it, either from one side (all events happen before 2011-01-11 or after 2011-01-05) except case id 3, where there are events events happening on both sides of the interval and within the interval. Why is this trace not considered intersecting?

Tested on Python 3.6.5, Ubuntu 16.04, pm4py version 1.0.23 / commit e0f408a

Javert899 commented 5 years ago

Hi,

Thanks for your efforts!

The issues will be evaluated by the end of next week, and possibly some fixes released

Javert899 commented 5 years ago

Thanks for signaling.

There was obviously a problem on line 88 of timestamp_filter, for which some conditions of the intersection were not verified correctly.

The problem has been solved in release 1.0.24