Skip to content

Commit

Permalink
fix syntax for doctests
Browse files Browse the repository at this point in the history
  • Loading branch information
floesche committed Dec 16, 2024
1 parent d1ce83d commit fcca47a
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion navis/core/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ def convert_units(
should become `np.float32(266476.88)` instead of `266476.8`)
>>> import navis
>>> if int(np.version.version.split('.')[0])>=2:
np.set_printoptions(legacy="1.25")
... np.set_printoptions(legacy="1.25")
>>> n = navis.example_neurons(1)
>>> n.units
<Quantity(8, 'nanometer')>
Expand Down
2 changes: 1 addition & 1 deletion navis/core/skeleton.py
Original file line number Diff line number Diff line change
Expand Up @@ -1427,7 +1427,7 @@ def snap(self, locs, to='nodes'):
should become `np.int32(1124)` instead of `1124`)
>>> import navis
>>> if int(np.version.version.split('.')[0])>=2:
np.set_printoptions(legacy="1.25")
... np.set_printoptions(legacy="1.25")
>>> n = navis.example_neurons(1)
>>> id, dist = n.snap([0, 0, 0])
>>> id
Expand Down
2 changes: 1 addition & 1 deletion navis/graph/graph_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,7 @@ def find_main_branchpoint(
should become `np.int32(110)` instead of `110`)
>>> import navis
>>> if int(np.version.version.split('.')[0])>=2:
np.set_printoptions(legacy="1.25")
... np.set_printoptions(legacy="1.25")
>>> n = navis.example_neurons(1)
>>> navis.find_main_branchpoint(n, reroot_soma=True)
110
Expand Down
2 changes: 1 addition & 1 deletion navis/intersection/intersect.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def in_volume(x: Union['core.NeuronObject', Sequence, pd.DataFrame],
>>> import navis
>>> if int(np.version.version.split('.')[0])>=2:
np.set_printoptions(legacy="1.25")
... np.set_printoptions(legacy="1.25")
>>> n = navis.example_neurons(1)
>>> lh = navis.example_volume('LH')
>>> n_lh = navis.in_volume(n, lh, inplace=False)
Expand Down
14 changes: 7 additions & 7 deletions navis/morpho/mmetrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def strahler_index(
>>> import navis
>>> if int(np.version.version.split('.')[0])>=2:
np.set_printoptions(legacy="1.25")
... np.set_printoptions(legacy="1.25")
>>> n = navis.example_neurons(2, kind='skeleton')
>>> n.reroot(n.soma, inplace=True)
>>> _ = navis.strahler_index(n)
Expand Down Expand Up @@ -562,7 +562,7 @@ def arbor_segregation_index(x: "core.NeuronObject") -> "core.NeuronObject":
>>> import navis
>>> if int(np.version.version.split('.')[0])>=2:
np.set_printoptions(legacy="1.25")
... np.set_printoptions(legacy="1.25")
>>> n = navis.example_neurons(1)
>>> n.reroot(n.soma, inplace=True)
>>> _ = navis.arbor_segregation_index(n)
Expand Down Expand Up @@ -717,7 +717,7 @@ def bending_flow(x: "core.NeuronObject") -> "core.NeuronObject":
>>> import navis
>>> if int(np.version.version.split('.')[0])>=2:
np.set_printoptions(legacy="1.25")
... np.set_printoptions(legacy="1.25")
>>> n = navis.example_neurons(1)
>>> n.reroot(n.soma, inplace=True)
>>> _ = navis.bending_flow(n)
Expand Down Expand Up @@ -993,7 +993,7 @@ def synapse_flow_centrality(
>>> import navis
>>> if int(np.version.version.split('.')[0])>=2:
np.set_printoptions(legacy="1.25")
... np.set_printoptions(legacy="1.25")
>>> n = navis.example_neurons(2)
>>> n.reroot(n.soma, inplace=True)
>>> _ = navis.synapse_flow_centrality(n)
Expand Down Expand Up @@ -1204,7 +1204,7 @@ def flow_centrality(x: "core.NeuronObject") -> "core.NeuronObject":
>>> import navis
>>> if int(np.version.version.split('.')[0])>=2:
np.set_printoptions(legacy="1.25")
... np.set_printoptions(legacy="1.25")
>>> n = navis.example_neurons(2)
>>> n.reroot(n.soma, inplace=True)
>>> _ = navis.flow_centrality(n)
Expand Down Expand Up @@ -1356,7 +1356,7 @@ def tortuosity(
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")
... np.set_printoptions(legacy="1.25")
>>> n = navis.example_neurons(1)
>>> # Calculate tortuosity as-is
>>> T = navis.tortuosity(n)
Expand Down Expand Up @@ -1671,7 +1671,7 @@ def betweeness_centrality(
>>> import navis
>>> if int(np.version.version.split('.')[0])>=2:
np.set_printoptions(legacy="1.25")
... np.set_printoptions(legacy="1.25")
>>> n = navis.example_neurons(2, kind='skeleton')
>>> n.reroot(n.soma, inplace=True)
>>> _ = navis.betweeness_centrality(n)
Expand Down
4 changes: 2 additions & 2 deletions navis/nbl/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,9 @@ def update_scores(queries, targets, scores_ex, nblast_func, **kwargs):
Once numpy<=2 is dropped from requirements, the doctest comparissons
should become `np.True_` instead of `True`)
>>> import navis
>>> if int(np.version.version.split('.')[0])>=2:
np.set_printoptions(legacy="1.25")
>>> import numpy as np
>>> if int(np.version.version.split('.')[0])>=2:
... np.set_printoptions(legacy="1.25")
>>> nl = navis.example_neurons(n=5)
>>> dp = navis.make_dotprops(nl, k=5) / 125
>>> # Full NBLAST
Expand Down

0 comments on commit fcca47a

Please sign in to comment.