diff --git a/clustering/feature-subsetting-plugin/src/polus/plugins/clustering/feature_subsetting/feature_subset.py b/clustering/feature-subsetting-plugin/src/polus/plugins/clustering/feature_subsetting/feature_subset.py index a84455e8e..06578672d 100644 --- a/clustering/feature-subsetting-plugin/src/polus/plugins/clustering/feature_subsetting/feature_subset.py +++ b/clustering/feature-subsetting-plugin/src/polus/plugins/clustering/feature_subsetting/feature_subset.py @@ -277,8 +277,6 @@ def feature_subset( # noqa : C901 {k: file[0][k] for k in section_variables}, ), ) - - # for k,v in rename_map.items(): fm = file[1][0][0] fname = file[1][0][1][0].name diff --git a/clustering/feature-subsetting-plugin/tests/test_feature_subsetting.py b/clustering/feature-subsetting-plugin/tests/test_feature_subsetting.py index 7c9828cc4..b3691f10f 100644 --- a/clustering/feature-subsetting-plugin/tests/test_feature_subsetting.py +++ b/clustering/feature-subsetting-plugin/tests/test_feature_subsetting.py @@ -39,3 +39,33 @@ def test_feature_subset( shutil.rmtree(inp_dir) shutil.rmtree(out_dir) shutil.rmtree(tabular_dir) + + +def test_filter_planes() -> None: + """Test filter planes.""" + feature_dict = { + 1: 1236.597914951989, + 2: 1153.754875685871, + 3: 1537.3429175240055, + 4: 1626.0415809327849, + } + + percentile = 0.1 + remove_direction = "Below" + fn = fs.filter_planes( + feature_dict=feature_dict, + remove_direction=remove_direction, + percentile=percentile, + ) + + assert type(fn) == set + + +def test_make_uniform() -> None: + """Test each section contain same number of images.""" + planes_dict = {1: [3, 4]} + uniques = [1, 2, 3, 4] + padding = 0 + fn = fs.make_uniform(planes_dict=planes_dict, uniques=uniques, padding=padding) + + assert len(fn) != 0