Skip to content

Commit

Permalink
move number representation to test itself
Browse files Browse the repository at this point in the history
  • Loading branch information
floesche committed Dec 16, 2024
1 parent d650c2b commit 3f2d47e
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions navis/morpho/mmetrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@
# Set up logging
logger = config.get_logger(__name__)

# Set up numpy number representation, see NEP51
# Once numpy<=2 is dropped from requirements, the doctest comparissons
# should become `np.float64(1.074)` instead of `1.074`
if int(np.version.version.split('.')[0])>=2:
np.set_printoptions(legacy="1.25")

__all__ = sorted(
[
"strahler_index",
Expand Down Expand Up @@ -1327,7 +1321,12 @@ def tortuosity(
Examples
--------
(Set up numpy number representation within the test, see NEP51.
Once numpy<=2 is dropped from requirements, the doctest comparissons
should become `np.float64(1.074)` instead of `1.074`)
>>> import navis
>>> if int(np.version.version.split('.')[0])>=2:
np.set_printoptions(legacy="1.25")
>>> n = navis.example_neurons(1)
>>> # Calculate tortuosity as-is
>>> T = navis.tortuosity(n)
Expand Down

0 comments on commit 3f2d47e

Please sign in to comment.