Skip to content

Commit 79c9190

Browse files
committed
fix: specify amount of components with the threshold arguement
Signed-off-by: Dasun Abeykoon <[email protected]>
1 parent 553de44 commit 79c9190

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

tests/test_NMF_analysis_code.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,16 @@
1212
data_dir = os.path.join(dir, "data/synthetic_r_vs_gr")
1313

1414
test_map = [
15-
([data_dir, "--xrange", "5,10"], "output_1", "Number of components: 10"),
16-
([data_dir], "output_2", "Number of components: 10"),
1715
(
18-
[data_dir, "--xrange", "5,10", "12,15"],
16+
[data_dir, "--xrange", "5,10", "--threshold", "3"],
17+
"output_1",
18+
"Number of components: 3\n",
19+
),
20+
([data_dir, "--threshold", "3"], "output_2", "Number of components: 3\n"),
21+
(
22+
[data_dir, "--xrange", "5,10", "12,15", "--threshold", "3"],
1923
"output_3",
20-
"Number of components: 10",
24+
"Number of components: 3\n",
2125
),
2226
]
2327

@@ -50,8 +54,7 @@ def test_nmf_mapping_code(tm, temp_dir, capsys):
5054
os.chdir(working_dir)
5155
main(args=data_dir)
5256
out, err = capsys.readouterr()
53-
out_lines = out.splitlines()
54-
assert out_lines[2] == tm[2]
57+
assert out == tm[2]
5558
results_dir = os.path.join(working_dir, "nmf_result")
5659
os.chdir(results_dir)
5760
expected_base = os.path.join(os.path.dirname(__file__), "output")

0 commit comments

Comments
 (0)