add option to disable edge rescaling to provide edge weights as integers, closes #1

This commit is contained in:
2025-06-20 09:06:51 +02:00
parent a7718c12cd
commit 63eb274975
7 changed files with 53 additions and 14 deletions

View File

@@ -326,6 +326,15 @@ def test_pipe_rescale_graph_edge_weights(tk_graph):
assert rescaled_undir[1][2]['weight'] == pytest.approx(1.0)
def test_pipe_graph_split(tk_graph):
graph_copy, graph_undir = graphs.pipe_graph_split(tk_graph)
assert len(graph_copy.nodes) == len(tk_graph.nodes)
assert len(graph_copy.edges) == len(tk_graph.edges)
assert len(graph_copy.nodes) == len(graph_undir.nodes)
assert len(graph_undir.nodes) == len(tk_graph.nodes)
assert len(graph_undir.edges) != len(tk_graph.edges)
@pytest.mark.parametrize('import_graph', ['graph', 'tk_graph'])
def test_rescale_edge_weights(import_graph, request):
test_graph = request.getfixturevalue(import_graph)

View File

@@ -29,13 +29,6 @@ def test_remove_na(raw_data_path, raw_data_date_cols):
assert len(data) == 998
# def test_string_cleansing():
# string = 'Ölleckage durch\nundichten \t Ölsumpf,, aber Dichtung intakt??!!!'
# cleaned_string = shared.clean_string_slim(string)
# target_string = 'Ölleckage durch undichten Ölsumpf, aber Dichtung intakt!'
# assert cleaned_string == target_string
def test_entry_wise_cleansing(raw_data_path, raw_data_date_cols):
(data,) = ppc.load_raw_data(raw_data_path, raw_data_date_cols)
(data,) = ppc.remove_duplicates(data)