Skip to content

Commit

Permalink
Update utils.py
Browse files Browse the repository at this point in the history
  • Loading branch information
C-Achard committed Dec 12, 2023
1 parent 246a06c commit 19c44f5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions napari_cellseg3d/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,16 +206,16 @@ def sphericity_axis(semi_major, semi_minor):
/ (a + (b**2) / root * np.log((a + root) / b))
)
except ZeroDivisionError:
LOGGER.debug(
"Zero division in sphericity calculation was replaced by None"
)
# LOGGER.debug(
# "Zero division in sphericity calculation was replaced by None"
# )
result = None
except ValueError as e:
LOGGER.warning(f"Error encountered in calculation : {e}")
result = "Error in calculation"

if math.isnan(result):
LOGGER.debug("NaN in sphericity calculation was replaced by None")
# LOGGER.debug("NaN in sphericity calculation was replaced by None")
result = None

return result
Expand Down

0 comments on commit 19c44f5

Please sign in to comment.