Spaces:
Runtime error
Runtime error
Download pm4py/tests/role_detection.py from linpershey/process_mining: direct link, hf CLI and curl.
- Browser
- Download file 1.27 kB
-
https://huggingface.co/spaces/linpershey/process_mining/resolve/main/pm4py/tests/role_detection.py
- Command line
-
hf download hf://spaces/linpershey/process_mining/pm4py/tests/role_detection.py
-
curl -L -o role_detection.py https://huggingface.co/spaces/linpershey/process_mining/resolve/main/pm4py/tests/role_detection.py
1.27 kB
| import unittest | |
| import os | |
| from pm4py.objects.log.importer.xes import importer as xes_importer | |
| from pm4py.objects.log.util import dataframe_utils | |
| from pm4py.util import constants, pandas_utils | |
| from pm4py.algo.organizational_mining.roles import algorithm as role_mining | |
| class RoleDetectionTest(unittest.TestCase): | |
| def test_role_running_csv(self): | |
| df = pandas_utils.read_csv(os.path.join("input_data", "running-example.csv")) | |
| df = dataframe_utils.convert_timestamp_columns_in_df(df, timest_format=constants.DEFAULT_TIMESTAMP_PARSE_FORMAT) | |
| roles = role_mining.apply(df) | |
| def test_role_running_xes(self): | |
| log = xes_importer.apply(os.path.join("..", "tests", "input_data", "running-example.xes")) | |
| roles = role_mining.apply(log) | |
| def test_role_receipt_csv(self): | |
| df = pandas_utils.read_csv(os.path.join("input_data", "receipt.csv")) | |
| df = dataframe_utils.convert_timestamp_columns_in_df(df, timest_format=constants.DEFAULT_TIMESTAMP_PARSE_FORMAT) | |
| roles = role_mining.apply(df) | |
| def test_role_receipt_xes(self): | |
| log = xes_importer.apply(os.path.join("..", "tests", "input_data", "receipt.xes")) | |
| roles = role_mining.apply(log) | |
| if __name__ == "__main__": | |
| unittest.main() | |