From a1a2a7a405c5a9a6bde3e70cb249ef3040810f03 Mon Sep 17 00:00:00 2001 From: Simon Wolf <swolf@mbp-von-simon.speedport.ip> Date: Mon, 16 Dec 2024 14:59:40 +0100 Subject: [PATCH] Added print statements --- .../api/routes/input_output/importing.py | 12 +- src/backend/backend_utilities/mine_log.py | 24 ++++ src/backend/environment.yml | 105 ++++++++++++++++++ 3 files changed, 139 insertions(+), 2 deletions(-) create mode 100644 src/backend/environment.yml diff --git a/src/backend/api/routes/input_output/importing.py b/src/backend/api/routes/input_output/importing.py index f21641e..f785ec2 100644 --- a/src/backend/api/routes/input_output/importing.py +++ b/src/backend/api/routes/input_output/importing.py @@ -73,8 +73,16 @@ async def load_ocel_from_file( # len(event_log) > config_repo.get_configuration().min_traces_variant_detection_mp #) #info = calculate_event_log_properties(event_log, use_mp=use_mp) - print(f"OCEL: {ocel}") - print("\n\n\n") + print("Type of ocel: ", type(ocel)) + print(ml.print_data_structure(ocel['super_variants_dict'], ocel['hierarchy_info_list'])) + #print("\n\n\n") + #for v in ocel: + #print(f"VARIANT: {v}") + #print("Type of element:", type(v)) + #print("\n\n\n") + print("Print does work") + #print(f"OCEL: {ocel}") + #print("\n\n\n") return ocel diff --git a/src/backend/backend_utilities/mine_log.py b/src/backend/backend_utilities/mine_log.py index 39df4a1..55503e7 100644 --- a/src/backend/backend_utilities/mine_log.py +++ b/src/backend/backend_utilities/mine_log.py @@ -123,11 +123,35 @@ async def process_ocel(parameters: Parameters = Parameters(), filename: str = "/ hierarchy_info = extract_hierarchy_info(hierarchy) hierarchy_info_list.append(hierarchy_info) + + return { "super_variants_dict": super_variants_dict, "hierarchy_info_list": hierarchy_info_list } +def print_data_structure(super_variants_dict, hierarchy_info_list): + """Print the data structure.""" + for key, value in super_variants_dict.items(): + print(f"Super Variant {key}:") + for super_variant in value: + print(super_variant) + print() + + for hierarchy_info in hierarchy_info_list: + print("Hierarchy:") + print("\n") + for level, super_variants in hierarchy_info["levels"].items(): + print(f"Level {level}:") + for super_variant in super_variants: + print(super_variant) + print("Super Variants:") + print("\n") + for super_variant in hierarchy_info["super_variants"]: + print(super_variant) + print() + + ''' if __name__ == "__main__": uvicorn.run(app, host="0.0.0.0", port=8000) diff --git a/src/backend/environment.yml b/src/backend/environment.yml new file mode 100644 index 0000000..dd7f594 --- /dev/null +++ b/src/backend/environment.yml @@ -0,0 +1,105 @@ +name: mining2 +channels: + - conda-forge +dependencies: + - bzip2=1.0.8=h99b78c6_7 + - ca-certificates=2024.8.30=hf0a4a13_0 + - libffi=3.4.2=h3422bc3_5 + - libsqlite=3.46.1=hc14010f_0 + - libzlib=1.3.1=h8359307_2 + - ncurses=6.5=h7bae524_1 + - openssl=3.3.2=h8359307_0 + - pip=24.2=pyh8b19718_1 + - python=3.10.15=hdce6c4c_2_cpython + - readline=8.2=h92ec313_1 + - setuptools=75.1.0=pyhd8ed1ab_0 + - tk=8.6.13=h5083fa2_1 + - wheel=0.44.0=pyhd8ed1ab_0 + - xz=5.2.6=h57fd34a_0 + - pip: + - absl-py==2.1.0 + - altgraph==0.17.4 + - annotated-types==0.7.0 + - antlr4-python3-runtime==4.8 + - anyio==4.6.2.post1 + - appdirs==1.4.4 + - asttokens==2.4.1 + - attrs==24.2.0 + - click==8.1.7 + - contourpy==1.3.0 + - cortado-core==1.3.27 + - cvxopt==1.3.2 + - cycler==0.11.0 + - decorator==5.1.1 + - deprecation==2.1.0 + - exceptiongroup==1.2.2 + - executing==2.1.0 + - fastapi==0.115.2 + - fonttools==4.54.1 + - gurobipy==11.0.3 + - h11==0.14.0 + - idna==3.10 + - immutabledict==4.2.0 + - intervaltree==3.1.0 + - ipython==8.28.0 + - jedi==0.19.1 + - jinja2==3.1.4 + - joblib==1.4.2 + - jsonpickle==3.3.0 + - jsonschema==4.23.0 + - jsonschema-specifications==2024.10.1 + - kiwisolver==1.4.7 + - lxml==5.3.0 + - macholib==1.16.3 + - markupsafe==3.0.1 + - matplotlib==3.6.2 + - matplotlib-inline==0.1.7 + - mpmath==1.3.0 + - networkx==3.0rc1 + - numpy==1.26.4 + - ocpa==1.3.3 + - ocsv==0.1.0 + - ortools==9.11.4210 + - packaging==24.1 + - pandas==2.2.3 + - parso==0.8.4 + - pexpect==4.9.0 + - pillow==11.0.0 + - pm4py==2.4.1 + - prompt-toolkit==3.0.48 + - protobuf==5.26.1 + - ptyprocess==0.7.0 + - pure-eval==0.2.3 + - pydantic==2.9.2 + - pydantic-core==2.23.4 + - pydotplus==2.0.2 + - pygments==2.18.0 + - pyinstaller==6.6.0 + - pyinstaller-hooks-contrib==2024.9 + - pyparsing==3.2.0 + - python-dateutil==2.9.0.post0 + - python-graphviz==0.20.3 + - python-multipart==0.0.12 + - pytz==2024.2 + - pyvis==0.3.2 + - referencing==0.35.1 + - rpds-py==0.20.0 + - scikit-learn==1.1.3 + - scipy==1.14.1 + - six==1.16.0 + - sniffio==1.3.1 + - sortedcontainers==2.4.0 + - stack-data==0.6.3 + - starlette==0.40.0 + - stringdist==1.0.9 + - sympy==1.13.3 + - threadpoolctl==3.5.0 + - tqdm==4.64.1 + - traitlets==5.14.3 + - typing-extensions==4.12.2 + - tzdata==2024.2 + - uvicorn==0.32.0 + - wcwidth==0.2.13 + - websockets==13.1 + - zss==1.2.0 +prefix: /Users/swolf/miniforge3/envs/mining2 -- GitLab