CoolFace
Apppublic

linpershey/process_mining

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes
statistics_df_test.py79 linesDownload Raw Back to tests
1from pm4py.objects.log.util import dataframe_utils2import unittest3import os4from pm4py.util import constants, pandas_utils5 6 7class StatisticsDfTest(unittest.TestCase):8    def get_dataframe(self):9        dataframe = pandas_utils.read_csv(os.path.join("input_data", "roadtraffic100traces.csv"))10        dataframe = dataframe_utils.convert_timestamp_columns_in_df(dataframe, timest_format=constants.DEFAULT_TIMESTAMP_PARSE_FORMAT)11        return dataframe12 13    def test_end_activities(self):14        from pm4py.statistics.end_activities.pandas import get15        df = self.get_dataframe()16        get.get_end_activities(df)17 18    def test_start_activities(self):19        from pm4py.statistics.start_activities.pandas import get20        df = self.get_dataframe()21        get.get_start_activities(df)22 23    def test_case_arrival(self):24        from pm4py.statistics.traces.generic.pandas import case_arrival25        df = self.get_dataframe()26        case_arrival.get_case_arrival_avg(df)27 28    def test_case_statistics(self):29        from pm4py.statistics.traces.generic.pandas import case_statistics30        df = self.get_dataframe()31        case_statistics.get_cases_description(df)32        case_statistics.get_variants_df(df)33        case_statistics.get_variant_statistics(df)34        #case_statistics.get_variant_statistics_with_case_duration(df)35        case_statistics.get_events(df, "N77802")36        case_statistics.get_variants_df_with_case_duration(df)37        case_statistics.get_variants_df_and_list(df)38        case_statistics.get_kde_caseduration(df)39 40    def test_variants(self):41        from pm4py.statistics.variants.pandas import get42        df = self.get_dataframe()43        get.get_variants_set(df)44 45    def test_batch_detection(self):46        from pm4py.algo.discovery.batches.variants import pandas as pandas_batches47        dataframe = pandas_utils.read_csv(os.path.join("input_data", "receipt.csv"))48        dataframe = dataframe_utils.convert_timestamp_columns_in_df(dataframe, timest_format=constants.DEFAULT_TIMESTAMP_PARSE_FORMAT)49        pandas_batches.apply(dataframe)50 51    def test_case_overlap(self):52        from pm4py.statistics.overlap.cases.pandas import get as overlap_get53        df = self.get_dataframe()54        overlap_get.apply(df)55 56    def test_cycle_time(self):57        from pm4py.statistics.traces.cycle_time.pandas import get as cycle_time_get58        df = self.get_dataframe()59        cycle_time_get.apply(df)60 61    def test_rework(self):62        from pm4py.statistics.rework.pandas import get as rework_get63        df = self.get_dataframe()64        rework_get.apply(df)65 66    def test_events_distribution(self):67        from pm4py.statistics.attributes.pandas import get as attributes_get68        df = self.get_dataframe()69        attributes_get.get_events_distribution(df)70 71    def test_msd(self):72        from pm4py.algo.discovery.minimum_self_distance.variants import pandas as msd_pandas73        df = self.get_dataframe()74        msd_pandas.apply(df)75 76 77if __name__ == "__main__":78    unittest.main()79