From 3f2d47e904413f7194d1210e599742029d61c2fd Mon Sep 17 00:00:00 2001 From: Frank Loesche Date: Mon, 16 Dec 2024 10:41:41 -0500 Subject: [PATCH] move number representation to test itself --- navis/morpho/mmetrics.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/navis/morpho/mmetrics.py b/navis/morpho/mmetrics.py index 7864326e..93a4feca 100644 --- a/navis/morpho/mmetrics.py +++ b/navis/morpho/mmetrics.py @@ -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", @@ -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)