Skip to content

Commit

Permalink
Added two more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hamshkhawar committed Jan 25, 2024
1 parent d8c6e4e commit d384b72
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit d384b72

Please sign in to comment.