1212import numpy .testing as npt
1313from biom .table import Table
1414
15- from q2_feature_table import subsample
15+ from q2_feature_table import subsample_ids
1616
1717
18- class SubsampleTests (TestCase ):
18+ class SubsampleIDsTests (TestCase ):
1919
2020 def test_subsample_samples (self ):
2121 t = Table (np .array ([[0 , 1 , 3 ], [1 , 1 , 2 ]]),
2222 ['O1' , 'O2' ],
2323 ['S1' , 'S2' , 'S3' ])
24- a = subsample (t , 2 , 'sample' )
24+ a = subsample_ids (t , 2 , 'sample' )
2525 self .assertEqual (a .shape , (2 , 2 ))
2626
2727 sample_ids = frozenset (a .ids (axis = 'sample' ))
@@ -38,7 +38,7 @@ def test_subsample_features(self):
3838 t = Table (np .array ([[0 , 1 , 3 ], [1 , 1 , 2 ]]).T ,
3939 ['O1' , 'O2' , 'O3' ],
4040 ['S1' , 'S2' ])
41- a = subsample (t , 2 , 'feature' )
41+ a = subsample_ids (t , 2 , 'feature' )
4242 self .assertEqual (a .shape , (2 , 2 ))
4343
4444 sample_ids = frozenset (a .ids (axis = 'observation' ))
@@ -56,28 +56,28 @@ def test_subsample_samples_oversample(self):
5656 ['O1' , 'O2' , 'O3' ],
5757 ['S1' , 'S2' ])
5858 with self .assertRaisesRegex (ValueError , "depth exceeds" ):
59- subsample (t , 10 , 'sample' )
59+ subsample_ids (t , 10 , 'sample' )
6060
6161 def test_subsample_features_oversample (self ):
6262 t = Table (np .array ([[0 , 1 , 3 ], [1 , 1 , 2 ]]).T ,
6363 ['O1' , 'O2' , 'O3' ],
6464 ['S1' , 'S2' ])
6565 with self .assertRaisesRegex (ValueError , "depth exceeds" ):
66- subsample (t , 10 , 'feature' )
66+ subsample_ids (t , 10 , 'feature' )
6767
6868 def test_subsample_samples_empty (self ):
6969 t = Table (np .array ([[0 , 0 , 0 ], [0 , 0 , 0 ]]).T ,
7070 ['O1' , 'O2' , 'O3' ],
7171 ['S1' , 'S2' ])
7272 with self .assertRaisesRegex (ValueError , "contains no" ):
73- subsample (t , 2 , 'sample' )
73+ subsample_ids (t , 2 , 'sample' )
7474
7575 def test_subsample_features_empty (self ):
7676 t = Table (np .array ([[0 , 0 , 0 ], [0 , 0 , 0 ]]).T ,
7777 ['O1' , 'O2' , 'O3' ],
7878 ['S1' , 'S2' ])
7979 with self .assertRaisesRegex (ValueError , "contains no" ):
80- subsample (t , 2 , 'feature' )
80+ subsample_ids (t , 2 , 'feature' )
8181
8282
8383if __name__ == "__main__" :
0 commit comments