コード例 #1
0
ファイル: test_utils.py プロジェクト: nkandhari/cellrank
    def test_return_vector(self):
        a = _one_hot(n=10, cat=None)
        b = _one_hot(n=10, cat=5)

        b_check = np.zeros(10)
        b_check[5] = True

        assert a.dtype == "bool"
        assert b.dtype == "bool"
        assert (a == np.zeros(10)).all()
        assert (b == b_check).all()
コード例 #2
0
ファイル: test_utils.py プロジェクト: nkandhari/cellrank
 def test_index_error(self):
     with pytest.raises(IndexError):
         _ = _one_hot(10, 10)
コード例 #3
0
ファイル: test_utils.py プロジェクト: nkandhari/cellrank
 def test_normal_run(self):
     _one_hot(n=10, cat=5)
     _one_hot(n=10, cat=None)