pm4py.algo.filtering.log.timestamp package

Submodules

pm4py.algo.filtering.log.timestamp.timestamp_filter module

This file is part of PM4Py (More Info: https://pm4py.fit.fraunhofer.de).

PM4Py is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

PM4Py is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with PM4Py. If not, see <https://www.gnu.org/licenses/>.

class pm4py.algo.filtering.log.timestamp.timestamp_filter.Parameters(value)[source]

Bases: enum.Enum

An enumeration.

TIMESTAMP_KEY = 'pm4py:param:timestamp_key'
pm4py.algo.filtering.log.timestamp.timestamp_filter.apply(df, parameters=None)[source]
pm4py.algo.filtering.log.timestamp.timestamp_filter.apply_auto_filter(df, parameters=None)[source]
pm4py.algo.filtering.log.timestamp.timestamp_filter.apply_events(log: pm4py.objects.log.obj.EventLog, dt1: Union[str, datetime.datetime], dt2: Union[str, datetime.datetime], parameters: Optional[Dict[Union[str, pm4py.algo.filtering.log.timestamp.timestamp_filter.Parameters], Any]] = None) pm4py.objects.log.obj.EventLog[source]

Get a new log containing all the events contained in the given interval

Parameters
  • log – Log

  • dt1 – Lower bound to the interval

  • dt2 – Upper bound to the interval

  • parameters

    Possible parameters of the algorithm, including:

    Parameters.TIMESTAMP_KEY -> Attribute to use as timestamp

Returns

Filtered log

Return type

filtered_log

pm4py.algo.filtering.log.timestamp.timestamp_filter.filter_on_trace_attribute(log: pm4py.objects.log.obj.EventLog, dt1: Union[str, datetime.datetime], dt2: Union[str, datetime.datetime], parameters: Optional[Dict[Union[str, pm4py.algo.filtering.log.timestamp.timestamp_filter.Parameters], Any]] = None) pm4py.objects.log.obj.EventLog[source]

Filters the traces of the event log that have a given trace attribute falling in the provided range

Parameters
  • log – Event log

  • dt1 – Left extreme of the time interval

  • dt2 – Right extreme of the time interval

  • parameters – Parameters of the filtering, including: - Parameters.TIMESTAMP_KEY => trace attribute to use for the filtering

Returns

Filtered event log

Return type

filtered_log

pm4py.algo.filtering.log.timestamp.timestamp_filter.filter_traces_attribute_in_timeframe(log: pm4py.objects.log.obj.EventLog, attribute: str, attribute_value: Any, dt1: Union[str, datetime.datetime], dt2: Union[str, datetime.datetime], parameters: Optional[Dict[Union[str, pm4py.algo.filtering.log.timestamp.timestamp_filter.Parameters], Any]] = None) pm4py.objects.log.obj.EventLog[source]

Get a new log containing all the traces that have an event in the given interval with the specified attribute value

Parameters
  • log – Log

  • attribute – The attribute to filter on

  • attribute_value – The attribute value to filter on

  • dt1 – Lower bound to the interval

  • dt2 – Upper bound to the interval

  • parameters

    Possible parameters of the algorithm, including:

    Parameters.TIMESTAMP_KEY -> Attribute to use as timestamp

Returns

Filtered log

Return type

filtered_log

pm4py.algo.filtering.log.timestamp.timestamp_filter.filter_traces_contained(log: pm4py.objects.log.obj.EventLog, dt1: Union[str, datetime.datetime], dt2: Union[str, datetime.datetime], parameters: Optional[Dict[Union[str, pm4py.algo.filtering.log.timestamp.timestamp_filter.Parameters], Any]] = None) pm4py.objects.log.obj.EventLog[source]

Get traces that are contained in the given interval

Parameters
  • log – Trace log

  • dt1 – Lower bound to the interval

  • dt2 – Upper bound to the interval

  • parameters

    Possible parameters of the algorithm, including:

    Parameters.TIMESTAMP_KEY -> Attribute to use as timestamp

Returns

Filtered log

Return type

filtered_log

pm4py.algo.filtering.log.timestamp.timestamp_filter.filter_traces_intersecting(log: pm4py.objects.log.obj.EventLog, dt1: Union[str, datetime.datetime], dt2: Union[str, datetime.datetime], parameters: Optional[Dict[Union[str, pm4py.algo.filtering.log.timestamp.timestamp_filter.Parameters], Any]] = None) pm4py.objects.log.obj.EventLog[source]

Filter traces intersecting the given interval

Parameters
  • log – Trace log

  • dt1 – Lower bound to the interval

  • dt2 – Upper bound to the interval

  • parameters

    Possible parameters of the algorithm, including:

    Parameters.TIMESTAMP_KEY -> Attribute to use as timestamp

Returns

Filtered log

Return type

filtered_log

pm4py.algo.filtering.log.timestamp.timestamp_filter.has_attribute_in_timeframe(trace, attribute, attribute_value, dt1, dt2, timestamp_key)[source]
pm4py.algo.filtering.log.timestamp.timestamp_filter.is_contained(trace, dt1, dt2, timestamp_key)[source]

Check if a trace is contained in the given interval

Parameters
  • trace – Trace to check

  • dt1 – Lower bound to the interval

  • dt2 – Upper bound to the interval

  • timestamp_key – Timestamp attribute

Returns

Is true if the trace is contained

Return type

boolean

pm4py.algo.filtering.log.timestamp.timestamp_filter.is_intersecting(trace, dt1, dt2, timestamp_key)[source]

Check if a trace is intersecting in the given interval

Parameters
  • trace – Trace to check

  • dt1 – Lower bound to the interval

  • dt2 – Upper bound to the interval

  • timestamp_key – Timestamp attribute

Returns

Is true if the trace is contained

Return type

boolean

pm4py.algo.filtering.log.timestamp.timestamp_filter.trace_attr_is_contained(trace: pm4py.objects.log.obj.Trace, dt1: Union[str, datetime.datetime], dt2: Union[str, datetime.datetime], trace_attr: str) bool[source]

Checks if the given attribute at the trace level is contained in the provided range

Parameters
  • trace – Trace object

  • dt1 – Left extreme of the time interval

  • dt2 – Right extreme of the time interval

  • trace_attr – Attribute at the trace level that is considered for the filtering

Returns

Boolean value

Return type

boolean

Module contents

This file is part of PM4Py (More Info: https://pm4py.fit.fraunhofer.de).

PM4Py is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

PM4Py is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with PM4Py. If not, see <https://www.gnu.org/licenses/>.