From 3df7945f48f0282cd5df13b29252cf65a871073a Mon Sep 17 00:00:00 2001 From: Justine Hansen Date: Thu, 16 Nov 2023 15:40:46 -0500 Subject: [PATCH] [FIX] stats.compare_images compatible with more metrics --- neuromaps/stats.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neuromaps/stats.py b/neuromaps/stats.py index d2ba500b..a5742b10 100644 --- a/neuromaps/stats.py +++ b/neuromaps/stats.py @@ -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.')