Skip to content

Commit

Permalink
[FIX] stats.compare_images compatible with more metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
justinehansen committed Nov 16, 2023
1 parent bfe44bd commit 3df7945
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion neuromaps/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def compare_images(src, trg, metric='pearsonr', ignore_zero=True, nulls=None,
if not callable(metric):
raise ValueError(f'Invalid `metric`: {metric}')
else:
if not isinstance(metric([1, 1], [1, 1]), float):
if not np.isscalar(metric([1, 1], [1, 1])):
raise ValueError('Provided callable `metric` must accept two '
'inputs and return single value.')

Expand Down

0 comments on commit 3df7945

Please sign in to comment.