Exemple #1
0
    def test_get_item_types(self):
        ft = FeatureTable(feature_table_data, dtype=feature_table_dtype)

        # row slice
        s = ft[1:]
        assert isinstance(s, FeatureTable)

        # row index
        s = ft[0]
        assert isinstance(s, np.record)
        assert not isinstance(s, FeatureTable)

        # col access
        s = ft['seqid']
        assert isinstance(s, np.ndarray)
        assert not isinstance(s, FeatureTable)
        s = ft[['seqid', 'start', 'end']]
        assert isinstance(s, FeatureTable)
Exemple #2
0
    def test_constructor(self):

        # missing data arg
        with pytest.raises(TypeError):
            # noinspection PyArgumentList
            FeatureTable()
Exemple #3
0
 def setup_instance(self, data, **kwargs):
     return FeatureTable(data, **kwargs)