@@ -174,6 +174,11 @@ def test_get_reduction(self):
174
174
assert reduction .shape == (10 , 2 )
175
175
176
176
177
+ def test_reduction_setter (self ):
178
+ reduction = self .results .get_reduction ("test_dr" )
179
+ self .results .reductions = {"test_dr" : reduction }
180
+
181
+
177
182
def test_add_item (self ):
178
183
self .results ["new_dr" ] = np .random .rand (10 , 2 )
179
184
assert "new_dr" in self .results .names
@@ -272,6 +277,18 @@ def test_rank_dr_methods(self):
272
277
assert results [m ] <= 2 and results [m ] >= 1
273
278
274
279
280
+ def test_rank_dr_methods_no_type_cluster (self ):
281
+ self .results .original_cell_types = None
282
+ self .results .evaluate (category = ["downstream" ])
283
+ results : Dict [str , float ] = self .results .rank_dr_methods ()
284
+ for m in ["new_dr" , "test_dr" ]:
285
+ assert m in results .keys ()
286
+ assert isinstance (results [m ], float )
287
+ assert results [m ] <= 2 and results [m ] >= 1
288
+
289
+ self .results .original_cell_types = np .repeat (np .array (["a" ,"b" ]), 5 )
290
+
291
+
275
292
def test_evaluate_pairwise (self ):
276
293
self .results .evaluate (category = "global" , pwd_metric = "pairwise" )
277
294
assert "global" in self .results .evaluations .keys ()
0 commit comments