Skip to content

Commit

Permalink
nblast functions: check if scores is valid value...
Browse files Browse the repository at this point in the history
... previously any unknown value would have silently used 'forward'
  • Loading branch information
schlegelp committed Nov 8, 2023
1 parent cea5ad6 commit 98aa6c0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions navis/nbl/nblast_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
# NBLAST
OMP_NUM_THREADS_LIMIT = 1

ALLOWED_SCORES = ('forward', 'mean', 'min', 'max', 'both')


class NBlaster(Blaster):
"""Implements version 2 of the NBLAST algorithm.
Expand Down Expand Up @@ -368,6 +370,7 @@ def nblast_smart(query: Union[Dotprops, NeuronList],
"""
utils.eval_param(criterion, name='criterion',
allowed_values=("percentile", "score", "N"))
utils.eval_param(scores, name='scores', allowed_values=ALLOWED_SCORES)

# We will make a couple tweaks for speed things up if this is
# an all-by-all NBLAST
Expand Down Expand Up @@ -772,6 +775,8 @@ def nblast(query: Union[Dotprops, NeuronList],
A synapse-based variant of NBLAST.
"""
utils.eval_param(scores, name='scores', allowed_values=ALLOWED_SCORES)

if isinstance(target, type(None)):
target = query

Expand Down

0 comments on commit 98aa6c0

Please sign in to comment.