Skip to content

Commit

Permalink
refactor(pm4py): refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
fit-alessandro-berti committed Nov 20, 2023
1 parent 19956ee commit b2b4d31
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ Different statistics that could be computed on top of event logs are proposed, i
* :meth:`pm4py.stats.get_all_case_durations`; gets the list of *case durations* for the cases of the event log.
* :meth:`pm4py.stats.get_case_duration`; gets the *case duration* of a specific case in the log.
* :meth:`pm4py.stats.get_stochastic_language`; gets the *stochastic language* of an event log or a process model.
* :meth:`pm4py.stats.get_service_time`; gets the average *service time* per activity.


Filtering (:mod:`pm4py.filtering`)
Expand Down Expand Up @@ -538,6 +539,7 @@ Overall List of Methods
pm4py.stats.get_all_case_durations
pm4py.stats.get_case_duration
pm4py.stats.get_frequent_trace_segments
pm4py.stats.get_service_time
pm4py.stats.get_activity_position_summary
pm4py.stats.get_stochastic_language
pm4py.filtering
Expand Down
2 changes: 1 addition & 1 deletion pm4py/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
get_minimum_self_distances, get_minimum_self_distance_witnesses, get_frequent_trace_segments, \
get_case_arrival_average, get_rework_cases_per_activity, get_case_overlap, get_cycle_time, \
get_all_case_durations, get_case_duration, get_activity_position_summary, get_stochastic_language, \
split_by_process_variant, get_variants_paths_duration
split_by_process_variant, get_variants_paths_duration, get_service_time
from pm4py.sim import play_out, generate_process_tree
from pm4py.ml import split_train_test, get_prefixes_from_log, extract_ocel_features, extract_features_dataframe, extract_temporal_features_dataframe, extract_outcome_enriched_dataframe, extract_target_vector
from pm4py.org import discover_handover_of_work_network, discover_activity_based_resource_similarity, discover_subcontracting_network, discover_working_together_network, discover_organizational_roles, discover_network_analysis
Expand Down
4 changes: 2 additions & 2 deletions pm4py/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -603,9 +603,9 @@ def get_service_time(log: Union[EventLog, pd.DataFrame], aggregation_measure: st
import pm4py
log = pm4py.read_xes('tests/input_data/interval_event_log.xes')
mean_serv_time = pm4py.stats.get_service_time(log, start_timestamp_key='start_timestamp', aggregation_measure='mean')
mean_serv_time = pm4py.get_service_time(log, start_timestamp_key='start_timestamp', aggregation_measure='mean')
print(mean_serv_time)
median_serv_time = pm4py.stats.get_service_time(log, start_timestamp_key='start_timestamp', aggregation_measure='median')
median_serv_time = pm4py.get_service_time(log, start_timestamp_key='start_timestamp', aggregation_measure='median')
print(median_serv_time)
"""
if type(log) not in [pd.DataFrame, EventLog, EventStream]: raise Exception("the method can be applied only to a traditional event log!")
Expand Down

0 comments on commit b2b4d31

Please sign in to comment.