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

Convert file changes - Functions are not accessible #497

Closed Deepan-mn closed 2 months ago

Deepan-mn commented 2 months ago
def convert_log_to_time_intervals(log: Union[EventLog, pd.DataFrame], filter_activity_couple: Optional[Tuple[str, str]] = None,
                                  activity_key: str = "concept:name",
                                  timestamp_key: str = "time:timestamp", case_id_key: str = "case:concept:name",
                                  start_timestamp_key: str = "time:timestamp"
                                  ) -> List[List[Any]]:
    """
    Gets a list of intervals from an event log.
    Each interval contains two temporally consecutive events and measures the time between the two events
    (complete timestamp of the first against start timestamp of the second).

    :param log: log object
    :param filter_activity_couple: (optional) filters the intervals to only consider a given couple of activities of the log
    :param activity_key: the attribute to be used as activity
    :param timestamp_key: the attribute to be used as timestamp
    :param case_id_key: the attribute to be used as case identifier
    :param start_timestamp_key: the attribute to be used as start timestamp
    :rtype: ``List[List[Any]]``

    .. code-block:: python3

        import pm4py

        log = pm4py.read_xes('tests/input_data/receipt.xes')
        time_intervals = pm4py.convert_log_to_time_intervals(log)
        print(len(time_intervals))
        time_intervals = pm4py.convert_log_to_time_intervals(log, ('Confirmation of receipt', 'T02 Check confirmation of receipt'))
        print(len(time_intervals))
    """
    __event_log_deprecation_warning(log)

    properties = get_properties(log, activity_key=activity_key, case_id_key=case_id_key, timestamp_key=timestamp_key)
    properties["filter_activity_couple"] = filter_activity_couple
    properties[constants.PARAMETER_CONSTANT_START_TIMESTAMP_KEY] = start_timestamp_key

    from pm4py.algo.transformation.log_to_interval_tree.variants import open_paths
    return open_paths.log_to_intervals(log, parameters=properties)

This is not available in latest version - (2.2.23)

file path pm4py/convert.py

fit-alessandro-berti commented 2 months ago

Dear @Deepan-mn

The current release of pm4py is 2.7.11.12 and many old features are renamed / removed. Please consult only the documentation provided at: https://processintelligence.solutions/static/api/2.7.11/index.html