|
4 | 4 |
|
5 | 5 |
|
6 | 6 | @pytest.mark.parametrize( |
7 | | - 'methods,args,consensus', |
| 7 | + 'methods,args,cons,anndata', |
8 | 8 | [ |
9 | | - ['all', dict(), True], |
10 | | - ['aucell', dict(aucell=dict(n_up=3)), True], |
11 | | - [['ulm'], dict(), False], |
12 | | - [['ulm', 'ora'], dict(ulm=dict(), ora=dict(n_up=3)), False] |
| 9 | + ['all', dict(), True, True], |
| 10 | + ['aucell', dict(aucell=dict(n_up=3)), True, False], |
| 11 | + [['ulm'], dict(), False, True], |
| 12 | + [['ulm', 'ora'], dict(ulm=dict(), ora=dict(n_up=3)), False, False] |
13 | 13 | ] |
14 | 14 | ) |
15 | 15 | def test_decouple( |
16 | 16 | adata, |
17 | 17 | net, |
18 | 18 | methods, |
19 | 19 | args, |
20 | | - consensus, |
| 20 | + cons, |
| 21 | + anndata |
21 | 22 | ): |
22 | | - dc.mt.decouple(data=adata, net=net, methods=methods, args=args, cons=consensus, tmin=0) |
23 | | - if consensus: |
24 | | - assert 'score_consensus' in adata.obsm |
| 23 | + if anndata: |
| 24 | + dc.mt.decouple(data=adata, net=net, methods=methods, args=args, cons=cons, tmin=0) |
| 25 | + if cons: |
| 26 | + assert 'score_consensus' in adata.obsm |
| 27 | + else: |
| 28 | + assert 'score_consensus' not in adata.obsm |
25 | 29 | else: |
26 | | - assert 'score_consensus' not in adata.obsm |
| 30 | + res = dc.mt.decouple(data=adata.to_df(), net=net, methods=methods, args=args, cons=cons, tmin=0) |
| 31 | + if cons: |
| 32 | + assert 'score_consensus' in res |
| 33 | + else: |
| 34 | + assert 'score_consensus' not in res |
0 commit comments