コード例 #1
0
    def func(c, t):
        op = get_operator(c, x.astype(t))
        c_ = type(op)
        if c_ in (IdentityOperator, ZeroOperator):
            expected_dtype = int
        elif c_ is MaskOperator:
            expected_dtype = bool
        else:
            expected_dtype = t
        assert_equal(op.data.dtype, expected_dtype)

        if c_ in (IdentityOperator, MaskOperator, ZeroOperator):
            assert_equal(op.dtype, None)
        elif c_ is DiagonalNumexprOperator:
            assert_equal(op.dtype, float_dtype(t))
        else:
            assert_equal(op.dtype, t)
コード例 #2
0
ファイル: test_utils.py プロジェクト: pchanial/pyoperators
 def func(dtype, expected):
     if expected is None:
         assert_raises(TypeError, float_dtype, dtype)
     else:
         actual = float_dtype(dtype)
         assert_eq(actual, expected)
コード例 #3
0
ファイル: test_utils.py プロジェクト: satorchi/pyoperators
 def func(dtype, expected):
     if expected is None:
         assert_raises(TypeError, float_dtype, dtype)
     else:
         actual = float_dtype(dtype)
         assert_eq(actual, expected)