Skip to content

Commit 69f27f9

Browse files
Merge pull request #312 from Aceticia/viz-similarity
Visualization support for `rho-a`
2 parents bef1775 + 04bed92 commit 69f27f9

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/rsatoolbox/vis/model_plot.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -987,4 +987,7 @@ def _get_y_label(method):
987987
elif method.lower() == 'neg_riem_dist':
988988
y_label = '[across-subject mean of ' \
989989
+ 'negative riemannian distance]'
990+
elif method.lower() == 'rho-a':
991+
y_label = '[across-subject mean of ' \
992+
+ 'Spearman r rank correlation with random tie-breaking]'
990993
return y_label

tests/test_vis.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,17 @@ def test_show_rdm_icon_string_no_error(self):
163163

164164

165165
class Test_model_plot(TestCase):
166+
methods_supported = [
167+
"corr", "cosine", "cosine_cov", "spearman", "corr_cov",
168+
"tau-b", "tau-a", "neg_riem_dist", "rho-a"
169+
]
166170
def test_y_label(self):
167171
from rsatoolbox.vis.model_plot import _get_y_label
168172

169-
y_label = _get_y_label("corr")
170-
self.assertIsInstance(y_label, str)
173+
for this_method in self.methods_supported:
174+
with self.subTest(msg=f"Testing {this_method}..."):
175+
y_label = _get_y_label(this_method)
176+
self.assertIsInstance(y_label, str)
171177

172178
def test_descr(self):
173179
from rsatoolbox.vis.model_plot import _get_model_comp_descr

0 commit comments

Comments
 (0)