Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
daubners committed Jan 16, 2025
1 parent 278c562 commit b9da23c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions taufactor/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,8 @@ def extract_through_feature(array, grayscale_value, axis, periodic=[False,False,

# Compute volume fraction of given grayscale value
vol_phase = volume_fraction(array, phases={'1': grayscale_value})['1']
if vol_phase == 0:
return 0, 0

# Define a list of connectivities to loop over
connectivities_to_loop_over = [connectivity] if connectivity else range(1, 4)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_taufactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def test_volume_fraction_on_checkerboard():
img = generate_checkerboard(l)
vf = volume_fraction(img, phases={'zeros': 0, 'ones': 1})

assert (vf['zeros'], vf['ones']) == [0.5, 0.5]
assert (vf['zeros'], vf['ones']) == (0.5, 0.5)


def test_volume_fraction_on_strip_of_ones():
Expand Down

0 comments on commit b9da23c

Please sign in to comment.