Repository: rsagroup/rsatoolbox

Issue:
rank transform does not update dissimilarity measure
Perhaps it should be adapted, for example _euclidean_ becomes _euclidean (ranks)_

https://github.com/rsagroup/rsatoolbox/blob/11d394852695851d3d1dabb059adfc277ad996e6/rsatoolbox/rdm/transform.py#L34

Discussion:

Patch:
diff --git a/rsatoolbox/rdm/transform.py b/rsatoolbox/rdm/transform.py
index a0999ba7..caa12257 100644
--- a/rsatoolbox/rdm/transform.py
+++ b/rsatoolbox/rdm/transform.py
@@ -30,8 +30,11 @@ def rank_transform(rdms, method='average'):
     dissimilarities = rdms.get_vectors()
     dissimilarities = np.array([rankdata(dissimilarities[i], method=method)
                                 for i in range(rdms.n_rdm)])
+    measure = rdms.dissimilarity_measure
+    if not measure[-7:] == '(ranks)':
+        measure = measure + ' (ranks)'
     rdms_new = RDMs(dissimilarities,
-                    dissimilarity_measure=rdms.dissimilarity_measure,
+                    dissimilarity_measure=measure,
                     descriptors=deepcopy(rdms.descriptors),
                     rdm_descriptors=deepcopy(rdms.rdm_descriptors),
                     pattern_descriptors=deepcopy(rdms.pattern_descriptors))


Test patch:
diff --git a/tests/test_rdm.py b/tests/test_rdm.py
index efdf3ad6..e92c5c31 100644
--- a/tests/test_rdm.py
+++ b/tests/test_rdm.py
@@ -244,6 +244,7 @@ class TestRDM(unittest.TestCase):
         rank_rdm = rank_transform(rdms)
         self.assertEqual(rank_rdm.n_rdm, rdms.n_rdm)
         self.assertEqual(rank_rdm.n_cond, rdms.n_cond)
+        self.assertEqual(rank_rdm.dissimilarity_measure, 'Euclidean (ranks)')
 
     def test_sqrt_transform(self):
         from rsatoolbox.rdm import sqrt_transform