add option to disable edge rescaling to provide edge weights as integers, closes #1
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -28,14 +28,26 @@ def test_build_tk_graph_post_pipe():
|
||||
assert len(pipe.actions) == 3
|
||||
|
||||
|
||||
def test_build_tk_graph_rescaling_pipe():
|
||||
def test_build_tk_graph_rescaling_pipe_with_edge_rescaling():
|
||||
pipe = pre.build_tk_graph_rescaling_pipe(
|
||||
save_result=False, exit_point=EntryPoints.TK_GRAPH_ANALYSIS_RESCALED
|
||||
save_result=False,
|
||||
exit_point=EntryPoints.TK_GRAPH_ANALYSIS_RESCALED,
|
||||
enable_rescaling=True,
|
||||
)
|
||||
assert pipe.name == 'Graph_Rescaling'
|
||||
assert len(pipe.actions) == 2
|
||||
|
||||
|
||||
def test_build_tk_graph_rescaling_pipe_without_edge_rescaling():
|
||||
pipe = pre.build_tk_graph_rescaling_pipe(
|
||||
save_result=False,
|
||||
exit_point=EntryPoints.TK_GRAPH_ANALYSIS_RESCALED,
|
||||
enable_rescaling=False,
|
||||
)
|
||||
assert pipe.name == 'Graph_Rescaling'
|
||||
assert len(pipe.actions) == 1
|
||||
|
||||
|
||||
@pytest.mark.parametrize('with_subgraphs', [True, False])
|
||||
def test_build_tk_graph_render_pipe(with_subgraphs):
|
||||
pipe = pre.build_tk_graph_render_pipe(with_subgraphs=with_subgraphs)
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user