support for optional edge rescaling

This commit is contained in:
Florian Förster 2025-06-20 09:10:37 +02:00
parent 6cdab45e61
commit 50e62245a1
4 changed files with 19 additions and 5 deletions

View File

@ -1,8 +1,8 @@
# d-opt -- lang_main: config file # d-opt -- lang_main: config file
[paths] [paths]
inputs = './lang-data/in/' inputs = './lang-main/data/tests/in/'
results = './lang-data/out/' results = './lang-main/data/tests/out/'
models = './lang-models' models = './lang-models'
graph_export_filename = 'EXPORT-TokenGraph' graph_export_filename = 'EXPORT-TokenGraph'
@ -35,6 +35,7 @@ threshold_amount_characters = 5
threshold_similarity = 0.92 threshold_similarity = 0.92
[graph_postprocessing] [graph_postprocessing]
enable_edge_rescaling = false
max_edge_number = -1 max_edge_number = -1
[time_analysis.uniqueness] [time_analysis.uniqueness]

View File

@ -1,11 +1,11 @@
[project] [project]
name = "tom-plugin" name = "tom-plugin"
version = "0.1.2dev1" version = "0.1.2"
description = "Wrapper for TOM plugins with different helper CLIs, primarily integration testing" description = "Wrapper for TOM plugins with different helper CLIs, primarily integration testing"
authors = [ authors = [
{name = "d-opt GmbH, resp. Florian Förster", email = "f.foerster@d-opt.com"}, {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" requires-python = ">=3.11"
readme = "README.md" readme = "README.md"
license = {text = "MIT"} license = {text = "MIT"}
@ -73,6 +73,7 @@ directory = "reports/coverage"
[tool.pdm] [tool.pdm]
distribution = true distribution = true
@ -94,10 +95,13 @@ dev = [
"bump-my-version>=0.29.0", "bump-my-version>=0.29.0",
"jupyterlab>=4.3.4", "jupyterlab>=4.3.4",
"ipywidgets>=8.1.5", "ipywidgets>=8.1.5",
"pytest>=8.4.1",
"coverage>=7.9.1",
"pytest-cov>=6.2.1",
] ]
[tool.bumpversion] [tool.bumpversion]
current_version = "0.1.2dev1" current_version = "0.1.2"
parse = """(?x) parse = """(?x)
(?P<major>0|[1-9]\\d*)\\. (?P<major>0|[1-9]\\d*)\\.
(?P<minor>0|[1-9]\\d*)\\. (?P<minor>0|[1-9]\\d*)\\.

View File

@ -12,6 +12,7 @@ from lang_main.analysis.graphs import (
) )
from lang_main.constants import ( from lang_main.constants import (
CYTO_BASE_NETWORK_NAME, CYTO_BASE_NETWORK_NAME,
ENABLE_EDGE_RESCALING,
INPUT_PATH_FOLDER, INPUT_PATH_FOLDER,
SAVE_PATH_FOLDER, SAVE_PATH_FOLDER,
SKIP_GRAPH_POSTPROCESSING, SKIP_GRAPH_POSTPROCESSING,
@ -51,6 +52,7 @@ pipe_graph_postprocessing = build_tk_graph_post_pipe()
pipe_graph_rescaling = build_tk_graph_rescaling_pipe( pipe_graph_rescaling = build_tk_graph_rescaling_pipe(
save_result=True, save_result=True,
exit_point=EntryPoints.TK_GRAPH_ANALYSIS_RESCALED, exit_point=EntryPoints.TK_GRAPH_ANALYSIS_RESCALED,
enable_rescaling=ENABLE_EDGE_RESCALING,
) )
pipe_timeline = build_timeline_pipe() pipe_timeline = build_timeline_pipe()

7
tests/test_pipeline.py Normal file
View File

@ -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)