From 50e62245a1797b39084e51828f4af86fe4191852 Mon Sep 17 00:00:00 2001 From: foefl Date: Fri, 20 Jun 2025 09:10:37 +0200 Subject: [PATCH] support for optional edge rescaling --- lang_main_config.toml | 5 +++-- pyproject.toml | 10 +++++++--- src/tom_plugin/pipeline.py | 2 ++ tests/test_pipeline.py | 7 +++++++ 4 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 tests/test_pipeline.py diff --git a/lang_main_config.toml b/lang_main_config.toml index 9dd7da8..cb696d9 100644 --- a/lang_main_config.toml +++ b/lang_main_config.toml @@ -1,8 +1,8 @@ # d-opt -- lang_main: config file [paths] -inputs = './lang-data/in/' -results = './lang-data/out/' +inputs = './lang-main/data/tests/in/' +results = './lang-main/data/tests/out/' models = './lang-models' graph_export_filename = 'EXPORT-TokenGraph' @@ -35,6 +35,7 @@ threshold_amount_characters = 5 threshold_similarity = 0.92 [graph_postprocessing] +enable_edge_rescaling = false max_edge_number = -1 [time_analysis.uniqueness] diff --git a/pyproject.toml b/pyproject.toml index fcd63a1..20a0bef 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,11 +1,11 @@ [project] name = "tom-plugin" -version = "0.1.2dev1" +version = "0.1.2" description = "Wrapper for TOM plugins with different helper CLIs, primarily integration testing" authors = [ {name = "d-opt GmbH, resp. Florian Förster", email = "f.foerster@d-opt.com"}, ] -dependencies = ["lang-main[spacy-md,spacy-trf]>=0.1.1"] +dependencies = ["lang-main[spacy-md,spacy-trf]>=0.1.2.dev3"] requires-python = ">=3.11" readme = "README.md" license = {text = "MIT"} @@ -73,6 +73,7 @@ directory = "reports/coverage" + [tool.pdm] distribution = true @@ -94,10 +95,13 @@ dev = [ "bump-my-version>=0.29.0", "jupyterlab>=4.3.4", "ipywidgets>=8.1.5", + "pytest>=8.4.1", + "coverage>=7.9.1", + "pytest-cov>=6.2.1", ] [tool.bumpversion] -current_version = "0.1.2dev1" +current_version = "0.1.2" parse = """(?x) (?P0|[1-9]\\d*)\\. (?P0|[1-9]\\d*)\\. diff --git a/src/tom_plugin/pipeline.py b/src/tom_plugin/pipeline.py index 82381da..9191bc9 100644 --- a/src/tom_plugin/pipeline.py +++ b/src/tom_plugin/pipeline.py @@ -12,6 +12,7 @@ from lang_main.analysis.graphs import ( ) from lang_main.constants import ( CYTO_BASE_NETWORK_NAME, + ENABLE_EDGE_RESCALING, INPUT_PATH_FOLDER, SAVE_PATH_FOLDER, SKIP_GRAPH_POSTPROCESSING, @@ -51,6 +52,7 @@ pipe_graph_postprocessing = build_tk_graph_post_pipe() pipe_graph_rescaling = build_tk_graph_rescaling_pipe( save_result=True, exit_point=EntryPoints.TK_GRAPH_ANALYSIS_RESCALED, + enable_rescaling=ENABLE_EDGE_RESCALING, ) pipe_timeline = build_timeline_pipe() diff --git a/tests/test_pipeline.py b/tests/test_pipeline.py new file mode 100644 index 0000000..4751086 --- /dev/null +++ b/tests/test_pipeline.py @@ -0,0 +1,7 @@ +from tom_plugin import pipeline + + +def test_pipeline(): + test_id = 'test1' + filename = 'Dummy_Dataset_N_1000.csv' + pipeline.run_on_csv_data(id=test_id, filename=filename)