Python numpy.core.umath_tests.test_signature() Examples

The following are code examples for showing how to use numpy.core.umath_tests.test_signature(). They are from open source Python projects. You can vote up the examples you like or vote down the ones you don't like.

Example 1
Project: att   Author: Centre-Alt-Rendiment-Esportiu   File: test_ufunc.py    GNU General Public License v3.0 5 votes vote down vote up
def test_signature(self):
        # the arguments to test_signature are: nin, nout, core_signature
        # pass
        assert_equal(umt.test_signature(2, 1, "(i),(i)->()"), 1)

        # pass. empty core signature; treat as plain ufunc (with trivial core)
        assert_equal(umt.test_signature(2, 1, "(),()->()"), 0)

        # in the following calls, a ValueError should be raised because
        # of error in core signature
        # error: extra parenthesis
        msg = "core_sig: extra parenthesis"
        try:
            ret = umt.test_signature(2, 1, "((i)),(i)->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError: None
        # error: parenthesis matching
        msg = "core_sig: parenthesis matching"
        try:
            ret = umt.test_signature(2, 1, "(i),)i(->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError: None
        # error: incomplete signature. letters outside of parenthesis are ignored
        msg = "core_sig: incomplete signature"
        try:
            ret = umt.test_signature(2, 1, "(i),->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError: None
        # error: incomplete signature. 2 output arguments are specified
        msg = "core_sig: incomplete signature"
        try:
            ret = umt.test_signature(2, 2, "(i),(i)->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError: None

        # more complicated names for variables
        assert_equal(umt.test_signature(2, 1, "(i1,i2),(J_1)->(_kAB)"), 1) 
Example 2
Project: Computable   Author: ktraunmueller   File: test_ufunc.py    MIT License 5 votes vote down vote up
def test_signature(self):
        # the arguments to test_signature are: nin, nout, core_signature
        # pass
        assert_equal(umt.test_signature(2, 1, "(i),(i)->()"), 1)

        # pass. empty core signature; treat as plain ufunc (with trivial core)
        assert_equal(umt.test_signature(2, 1, "(),()->()"), 0)

        # in the following calls, a ValueError should be raised because
        # of error in core signature
        # error: extra parenthesis
        msg = "core_sig: extra parenthesis"
        try:
            ret = umt.test_signature(2, 1, "((i)),(i)->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError: None
        # error: parenthesis matching
        msg = "core_sig: parenthesis matching"
        try:
            ret = umt.test_signature(2, 1, "(i),)i(->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError: None
        # error: incomplete signature. letters outside of parenthesis are ignored
        msg = "core_sig: incomplete signature"
        try:
            ret = umt.test_signature(2, 1, "(i),->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError: None
        # error: incomplete signature. 2 output arguments are specified
        msg = "core_sig: incomplete signature"
        try:
            ret = umt.test_signature(2, 2, "(i),(i)->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError: None

        # more complicated names for variables
        assert_equal(umt.test_signature(2, 1, "(i1,i2),(J_1)->(_kAB)"), 1) 
Example 3
Project: 3dprinteros-client   Author: panasevychol   File: test_ufunc.py    GNU Affero General Public License v3.0 5 votes vote down vote up
def test_signature(self):
        # the arguments to test_signature are: nin, nout, core_signature
        # pass
        assert_equal(umt.test_signature(2, 1, "(i),(i)->()"), 1)

        # pass. empty core signature; treat as plain ufunc (with trivial core)
        assert_equal(umt.test_signature(2, 1, "(),()->()"), 0)

        # in the following calls, a ValueError should be raised because
        # of error in core signature
        # error: extra parenthesis
        msg = "core_sig: extra parenthesis"
        try:
            ret = umt.test_signature(2, 1, "((i)),(i)->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError: None
        # error: parenthesis matching
        msg = "core_sig: parenthesis matching"
        try:
            ret = umt.test_signature(2, 1, "(i),)i(->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError: None
        # error: incomplete signature. letters outside of parenthesis are ignored
        msg = "core_sig: incomplete signature"
        try:
            ret = umt.test_signature(2, 1, "(i),->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError: None
        # error: incomplete signature. 2 output arguments are specified
        msg = "core_sig: incomplete signature"
        try:
            ret = umt.test_signature(2, 2, "(i),(i)->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError: None

        # more complicated names for variables
        assert_equal(umt.test_signature(2, 1, "(i1,i2),(J_1)->(_kAB)"), 1) 
Example 4
Project: 3dprinteros-client   Author: panasevychol   File: test_ufunc.py    GNU Affero General Public License v3.0 5 votes vote down vote up
def test_signature(self):
        # the arguments to test_signature are: nin, nout, core_signature
        # pass
        assert_equal(umt.test_signature(2, 1, "(i),(i)->()"), 1)

        # pass. empty core signature; treat as plain ufunc (with trivial core)
        assert_equal(umt.test_signature(2, 1, "(),()->()"), 0)

        # in the following calls, a ValueError should be raised because
        # of error in core signature
        # error: extra parenthesis
        msg = "core_sig: extra parenthesis"
        try:
            ret = umt.test_signature(2, 1, "((i)),(i)->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError: None
        # error: parenthesis matching
        msg = "core_sig: parenthesis matching"
        try:
            ret = umt.test_signature(2, 1, "(i),)i(->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError: None
        # error: incomplete signature. letters outside of parenthesis are ignored
        msg = "core_sig: incomplete signature"
        try:
            ret = umt.test_signature(2, 1, "(i),->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError: None
        # error: incomplete signature. 2 output arguments are specified
        msg = "core_sig: incomplete signature"
        try:
            ret = umt.test_signature(2, 2, "(i),(i)->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError: None

        # more complicated names for variables
        assert_equal(umt.test_signature(2, 1, "(i1,i2),(J_1)->(_kAB)"), 1) 
Example 5
Project: ImageFusion   Author: pfchai   File: test_ufunc.py    MIT License 5 votes vote down vote up
def test_signature(self):
        # the arguments to test_signature are: nin, nout, core_signature
        # pass
        assert_equal(umt.test_signature(2, 1, "(i),(i)->()"), 1)

        # pass. empty core signature; treat as plain ufunc (with trivial core)
        assert_equal(umt.test_signature(2, 1, "(),()->()"), 0)

        # in the following calls, a ValueError should be raised because
        # of error in core signature
        # error: extra parenthesis
        msg = "core_sig: extra parenthesis"
        try:
            ret = umt.test_signature(2, 1, "((i)),(i)->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError: None
        # error: parenthesis matching
        msg = "core_sig: parenthesis matching"
        try:
            ret = umt.test_signature(2, 1, "(i),)i(->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError: None
        # error: incomplete signature. letters outside of parenthesis are ignored
        msg = "core_sig: incomplete signature"
        try:
            ret = umt.test_signature(2, 1, "(i),->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError: None
        # error: incomplete signature. 2 output arguments are specified
        msg = "core_sig: incomplete signature"
        try:
            ret = umt.test_signature(2, 2, "(i),(i)->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError: None

        # more complicated names for variables
        assert_equal(umt.test_signature(2, 1, "(i1,i2),(J_1)->(_kAB)"), 1) 
Example 6
Project: senior-design   Author: james-tate   File: test_ufunc.py    GNU General Public License v2.0 5 votes vote down vote up
def test_signature(self):
        # the arguments to test_signature are: nin, nout, core_signature
        # pass
        assert_equal(umt.test_signature(2,1,"(i),(i)->()"), 1)

        # pass. empty core signature; treat as plain ufunc (with trivial core)
        assert_equal(umt.test_signature(2,1,"(),()->()"), 0)

        # in the following calls, a ValueError should be raised because
        # of error in core signature
        # error: extra parenthesis
        msg = "core_sig: extra parenthesis"
        try:
            ret = umt.test_signature(2,1,"((i)),(i)->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError: None
        # error: parenthesis matching
        msg = "core_sig: parenthesis matching"
        try:
            ret = umt.test_signature(2,1,"(i),)i(->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError: None
        # error: incomplete signature. letters outside of parenthesis are ignored
        msg = "core_sig: incomplete signature"
        try:
            ret = umt.test_signature(2,1,"(i),->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError: None
        # error: incomplete signature. 2 output arguments are specified
        msg = "core_sig: incomplete signature"
        try:
            ret = umt.test_signature(2,2,"(i),(i)->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError: None

        # more complicated names for variables
        assert_equal(umt.test_signature(2,1,"(i1,i2),(J_1)->(_kAB)"),1) 
Example 7
Project: cnidaria   Author: sauloal   File: test_ufunc.py    MIT License 5 votes vote down vote up
def test_signature(self):
        # the arguments to test_signature are: nin, nout, core_signature
        # pass
        assert_equal(umt.test_signature(2, 1, "(i),(i)->()"), 1)

        # pass. empty core signature; treat as plain ufunc (with trivial core)
        assert_equal(umt.test_signature(2, 1, "(),()->()"), 0)

        # in the following calls, a ValueError should be raised because
        # of error in core signature
        # error: extra parenthesis
        msg = "core_sig: extra parenthesis"
        try:
            ret = umt.test_signature(2, 1, "((i)),(i)->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError: None
        # error: parenthesis matching
        msg = "core_sig: parenthesis matching"
        try:
            ret = umt.test_signature(2, 1, "(i),)i(->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError: None
        # error: incomplete signature. letters outside of parenthesis are ignored
        msg = "core_sig: incomplete signature"
        try:
            ret = umt.test_signature(2, 1, "(i),->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError: None
        # error: incomplete signature. 2 output arguments are specified
        msg = "core_sig: incomplete signature"
        try:
            ret = umt.test_signature(2, 2, "(i),(i)->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError: None

        # more complicated names for variables
        assert_equal(umt.test_signature(2, 1, "(i1,i2),(J_1)->(_kAB)"), 1) 
Example 8
Project: LaserTOF   Author: kyleuckert   File: test_ufunc.py    MIT License 4 votes vote down vote up
def test_signature(self):
        # the arguments to test_signature are: nin, nout, core_signature
        # pass
        assert_equal(umt.test_signature(2, 1, "(i),(i)->()"), 1)

        # pass. empty core signature; treat as plain ufunc (with trivial core)
        assert_equal(umt.test_signature(2, 1, "(),()->()"), 0)

        # in the following calls, a ValueError should be raised because
        # of error in core signature
        # FIXME These should be using assert_raises

        # error: extra parenthesis
        msg = "core_sig: extra parenthesis"
        try:
            ret = umt.test_signature(2, 1, "((i)),(i)->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: parenthesis matching
        msg = "core_sig: parenthesis matching"
        try:
            ret = umt.test_signature(2, 1, "(i),)i(->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: incomplete signature. letters outside of parenthesis are ignored
        msg = "core_sig: incomplete signature"
        try:
            ret = umt.test_signature(2, 1, "(i),->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: incomplete signature. 2 output arguments are specified
        msg = "core_sig: incomplete signature"
        try:
            ret = umt.test_signature(2, 2, "(i),(i)->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # more complicated names for variables
        assert_equal(umt.test_signature(2, 1, "(i1,i2),(J_1)->(_kAB)"), 1) 
Example 9
Project: auto-alt-text-lambda-api   Author: abhisuri97   File: test_ufunc.py    MIT License 4 votes vote down vote up
def test_signature(self):
        # the arguments to test_signature are: nin, nout, core_signature
        # pass
        assert_equal(umt.test_signature(2, 1, "(i),(i)->()"), 1)

        # pass. empty core signature; treat as plain ufunc (with trivial core)
        assert_equal(umt.test_signature(2, 1, "(),()->()"), 0)

        # in the following calls, a ValueError should be raised because
        # of error in core signature
        # FIXME These should be using assert_raises

        # error: extra parenthesis
        msg = "core_sig: extra parenthesis"
        try:
            ret = umt.test_signature(2, 1, "((i)),(i)->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: parenthesis matching
        msg = "core_sig: parenthesis matching"
        try:
            ret = umt.test_signature(2, 1, "(i),)i(->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: incomplete signature. letters outside of parenthesis are ignored
        msg = "core_sig: incomplete signature"
        try:
            ret = umt.test_signature(2, 1, "(i),->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: incomplete signature. 2 output arguments are specified
        msg = "core_sig: incomplete signature"
        try:
            ret = umt.test_signature(2, 2, "(i),(i)->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # more complicated names for variables
        assert_equal(umt.test_signature(2, 1, "(i1,i2),(J_1)->(_kAB)"), 1) 
Example 10
Project: vnpy_crypto   Author: birforce   File: test_ufunc.py    MIT License 4 votes vote down vote up
def test_signature(self):
        # the arguments to test_signature are: nin, nout, core_signature
        # pass
        assert_equal(umt.test_signature(2, 1, "(i),(i)->()"), 1)

        # pass. empty core signature; treat as plain ufunc (with trivial core)
        assert_equal(umt.test_signature(2, 1, "(),()->()"), 0)

        # in the following calls, a ValueError should be raised because
        # of error in core signature
        # FIXME These should be using assert_raises

        # error: extra parenthesis
        msg = "core_sig: extra parenthesis"
        try:
            ret = umt.test_signature(2, 1, "((i)),(i)->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: parenthesis matching
        msg = "core_sig: parenthesis matching"
        try:
            ret = umt.test_signature(2, 1, "(i),)i(->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: incomplete signature. letters outside of parenthesis are ignored
        msg = "core_sig: incomplete signature"
        try:
            ret = umt.test_signature(2, 1, "(i),->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: incomplete signature. 2 output arguments are specified
        msg = "core_sig: incomplete signature"
        try:
            ret = umt.test_signature(2, 2, "(i),(i)->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # more complicated names for variables
        assert_equal(umt.test_signature(2, 1, "(i1,i2),(J_1)->(_kAB)"), 1) 
Example 11
Project: poker   Author: surgebiswas   File: test_ufunc.py    MIT License 4 votes vote down vote up
def test_signature(self):
        # the arguments to test_signature are: nin, nout, core_signature
        # pass
        assert_equal(umt.test_signature(2, 1, "(i),(i)->()"), 1)

        # pass. empty core signature; treat as plain ufunc (with trivial core)
        assert_equal(umt.test_signature(2, 1, "(),()->()"), 0)

        # in the following calls, a ValueError should be raised because
        # of error in core signature
        # FIXME These should be using assert_raises

        # error: extra parenthesis
        msg = "core_sig: extra parenthesis"
        try:
            ret = umt.test_signature(2, 1, "((i)),(i)->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: parenthesis matching
        msg = "core_sig: parenthesis matching"
        try:
            ret = umt.test_signature(2, 1, "(i),)i(->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: incomplete signature. letters outside of parenthesis are ignored
        msg = "core_sig: incomplete signature"
        try:
            ret = umt.test_signature(2, 1, "(i),->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: incomplete signature. 2 output arguments are specified
        msg = "core_sig: incomplete signature"
        try:
            ret = umt.test_signature(2, 2, "(i),(i)->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # more complicated names for variables
        assert_equal(umt.test_signature(2, 1, "(i1,i2),(J_1)->(_kAB)"), 1) 
Example 12
Project: linear_neuron   Author: uglyboxer   File: test_ufunc.py    MIT License 4 votes vote down vote up
def test_signature(self):
        # the arguments to test_signature are: nin, nout, core_signature
        # pass
        assert_equal(umt.test_signature(2, 1, "(i),(i)->()"), 1)

        # pass. empty core signature; treat as plain ufunc (with trivial core)
        assert_equal(umt.test_signature(2, 1, "(),()->()"), 0)

        # in the following calls, a ValueError should be raised because
        # of error in core signature
        # FIXME These should be using assert_raises

        # error: extra parenthesis
        msg = "core_sig: extra parenthesis"
        try:
            ret = umt.test_signature(2, 1, "((i)),(i)->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: parenthesis matching
        msg = "core_sig: parenthesis matching"
        try:
            ret = umt.test_signature(2, 1, "(i),)i(->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: incomplete signature. letters outside of parenthesis are ignored
        msg = "core_sig: incomplete signature"
        try:
            ret = umt.test_signature(2, 1, "(i),->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: incomplete signature. 2 output arguments are specified
        msg = "core_sig: incomplete signature"
        try:
            ret = umt.test_signature(2, 2, "(i),(i)->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # more complicated names for variables
        assert_equal(umt.test_signature(2, 1, "(i1,i2),(J_1)->(_kAB)"), 1) 
Example 13
Project: islam-buddy   Author: hamir   File: test_ufunc.py    MIT License 4 votes vote down vote up
def test_signature(self):
        # the arguments to test_signature are: nin, nout, core_signature
        # pass
        assert_equal(umt.test_signature(2, 1, "(i),(i)->()"), 1)

        # pass. empty core signature; treat as plain ufunc (with trivial core)
        assert_equal(umt.test_signature(2, 1, "(),()->()"), 0)

        # in the following calls, a ValueError should be raised because
        # of error in core signature
        # FIXME These should be using assert_raises

        # error: extra parenthesis
        msg = "core_sig: extra parenthesis"
        try:
            ret = umt.test_signature(2, 1, "((i)),(i)->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: parenthesis matching
        msg = "core_sig: parenthesis matching"
        try:
            ret = umt.test_signature(2, 1, "(i),)i(->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: incomplete signature. letters outside of parenthesis are ignored
        msg = "core_sig: incomplete signature"
        try:
            ret = umt.test_signature(2, 1, "(i),->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: incomplete signature. 2 output arguments are specified
        msg = "core_sig: incomplete signature"
        try:
            ret = umt.test_signature(2, 2, "(i),(i)->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # more complicated names for variables
        assert_equal(umt.test_signature(2, 1, "(i1,i2),(J_1)->(_kAB)"), 1) 
Example 14
Project: mxnet-lambda   Author: awslabs   File: test_ufunc.py    Apache License 2.0 4 votes vote down vote up
def test_signature(self):
        # the arguments to test_signature are: nin, nout, core_signature
        # pass
        assert_equal(umt.test_signature(2, 1, "(i),(i)->()"), 1)

        # pass. empty core signature; treat as plain ufunc (with trivial core)
        assert_equal(umt.test_signature(2, 1, "(),()->()"), 0)

        # in the following calls, a ValueError should be raised because
        # of error in core signature
        # FIXME These should be using assert_raises

        # error: extra parenthesis
        msg = "core_sig: extra parenthesis"
        try:
            ret = umt.test_signature(2, 1, "((i)),(i)->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: parenthesis matching
        msg = "core_sig: parenthesis matching"
        try:
            ret = umt.test_signature(2, 1, "(i),)i(->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: incomplete signature. letters outside of parenthesis are ignored
        msg = "core_sig: incomplete signature"
        try:
            ret = umt.test_signature(2, 1, "(i),->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: incomplete signature. 2 output arguments are specified
        msg = "core_sig: incomplete signature"
        try:
            ret = umt.test_signature(2, 2, "(i),(i)->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # more complicated names for variables
        assert_equal(umt.test_signature(2, 1, "(i1,i2),(J_1)->(_kAB)"), 1) 
Example 15
Project: wine-ml-on-aws-lambda   Author: pierreant   File: test_ufunc.py    Apache License 2.0 4 votes vote down vote up
def test_signature(self):
        # the arguments to test_signature are: nin, nout, core_signature
        # pass
        assert_equal(umt.test_signature(2, 1, "(i),(i)->()"), 1)

        # pass. empty core signature; treat as plain ufunc (with trivial core)
        assert_equal(umt.test_signature(2, 1, "(),()->()"), 0)

        # in the following calls, a ValueError should be raised because
        # of error in core signature
        # FIXME These should be using assert_raises

        # error: extra parenthesis
        msg = "core_sig: extra parenthesis"
        try:
            ret = umt.test_signature(2, 1, "((i)),(i)->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: parenthesis matching
        msg = "core_sig: parenthesis matching"
        try:
            ret = umt.test_signature(2, 1, "(i),)i(->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: incomplete signature. letters outside of parenthesis are ignored
        msg = "core_sig: incomplete signature"
        try:
            ret = umt.test_signature(2, 1, "(i),->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: incomplete signature. 2 output arguments are specified
        msg = "core_sig: incomplete signature"
        try:
            ret = umt.test_signature(2, 2, "(i),(i)->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # more complicated names for variables
        assert_equal(umt.test_signature(2, 1, "(i1,i2),(J_1)->(_kAB)"), 1) 
Example 16
Project: linux-cross-gcc   Author: nmercier   File: test_ufunc.py    BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
def test_signature(self):
        # the arguments to test_signature are: nin, nout, core_signature
        # pass
        assert_equal(umt.test_signature(2, 1, "(i),(i)->()"), 1)

        # pass. empty core signature; treat as plain ufunc (with trivial core)
        assert_equal(umt.test_signature(2, 1, "(),()->()"), 0)

        # in the following calls, a ValueError should be raised because
        # of error in core signature
        # FIXME These should be using assert_raises

        # error: extra parenthesis
        msg = "core_sig: extra parenthesis"
        try:
            ret = umt.test_signature(2, 1, "((i)),(i)->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: parenthesis matching
        msg = "core_sig: parenthesis matching"
        try:
            ret = umt.test_signature(2, 1, "(i),)i(->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: incomplete signature. letters outside of parenthesis are ignored
        msg = "core_sig: incomplete signature"
        try:
            ret = umt.test_signature(2, 1, "(i),->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: incomplete signature. 2 output arguments are specified
        msg = "core_sig: incomplete signature"
        try:
            ret = umt.test_signature(2, 2, "(i),(i)->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # more complicated names for variables
        assert_equal(umt.test_signature(2, 1, "(i1,i2),(J_1)->(_kAB)"), 1) 
Example 17
Project: sarah   Author: ChonchoFronto   File: test_ufunc.py    MIT License 4 votes vote down vote up
def test_signature(self):
        # the arguments to test_signature are: nin, nout, core_signature
        # pass
        assert_equal(umt.test_signature(2, 1, "(i),(i)->()"), 1)

        # pass. empty core signature; treat as plain ufunc (with trivial core)
        assert_equal(umt.test_signature(2, 1, "(),()->()"), 0)

        # in the following calls, a ValueError should be raised because
        # of error in core signature
        # FIXME These should be using assert_raises

        # error: extra parenthesis
        msg = "core_sig: extra parenthesis"
        try:
            ret = umt.test_signature(2, 1, "((i)),(i)->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: parenthesis matching
        msg = "core_sig: parenthesis matching"
        try:
            ret = umt.test_signature(2, 1, "(i),)i(->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: incomplete signature. letters outside of parenthesis are ignored
        msg = "core_sig: incomplete signature"
        try:
            ret = umt.test_signature(2, 1, "(i),->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: incomplete signature. 2 output arguments are specified
        msg = "core_sig: incomplete signature"
        try:
            ret = umt.test_signature(2, 2, "(i),(i)->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # more complicated names for variables
        assert_equal(umt.test_signature(2, 1, "(i1,i2),(J_1)->(_kAB)"), 1) 
Example 18
Project: honours_project   Author: JFriel   File: test_ufunc.py    GNU General Public License v3.0 4 votes vote down vote up
def test_signature(self):
        # the arguments to test_signature are: nin, nout, core_signature
        # pass
        assert_equal(umt.test_signature(2, 1, "(i),(i)->()"), 1)

        # pass. empty core signature; treat as plain ufunc (with trivial core)
        assert_equal(umt.test_signature(2, 1, "(),()->()"), 0)

        # in the following calls, a ValueError should be raised because
        # of error in core signature
        # FIXME These should be using assert_raises

        # error: extra parenthesis
        msg = "core_sig: extra parenthesis"
        try:
            ret = umt.test_signature(2, 1, "((i)),(i)->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: parenthesis matching
        msg = "core_sig: parenthesis matching"
        try:
            ret = umt.test_signature(2, 1, "(i),)i(->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: incomplete signature. letters outside of parenthesis are ignored
        msg = "core_sig: incomplete signature"
        try:
            ret = umt.test_signature(2, 1, "(i),->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: incomplete signature. 2 output arguments are specified
        msg = "core_sig: incomplete signature"
        try:
            ret = umt.test_signature(2, 2, "(i),(i)->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # more complicated names for variables
        assert_equal(umt.test_signature(2, 1, "(i1,i2),(J_1)->(_kAB)"), 1) 
Example 19
Project: honours_project   Author: JFriel   File: test_ufunc.py    GNU General Public License v3.0 4 votes vote down vote up
def test_signature(self):
        # the arguments to test_signature are: nin, nout, core_signature
        # pass
        assert_equal(umt.test_signature(2, 1, "(i),(i)->()"), 1)

        # pass. empty core signature; treat as plain ufunc (with trivial core)
        assert_equal(umt.test_signature(2, 1, "(),()->()"), 0)

        # in the following calls, a ValueError should be raised because
        # of error in core signature
        # FIXME These should be using assert_raises

        # error: extra parenthesis
        msg = "core_sig: extra parenthesis"
        try:
            ret = umt.test_signature(2, 1, "((i)),(i)->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: parenthesis matching
        msg = "core_sig: parenthesis matching"
        try:
            ret = umt.test_signature(2, 1, "(i),)i(->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: incomplete signature. letters outside of parenthesis are ignored
        msg = "core_sig: incomplete signature"
        try:
            ret = umt.test_signature(2, 1, "(i),->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: incomplete signature. 2 output arguments are specified
        msg = "core_sig: incomplete signature"
        try:
            ret = umt.test_signature(2, 2, "(i),(i)->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # more complicated names for variables
        assert_equal(umt.test_signature(2, 1, "(i1,i2),(J_1)->(_kAB)"), 1) 
Example 20
Project: Blackjack-Tracker   Author: martinabeleda   File: test_ufunc.py    MIT License 4 votes vote down vote up
def test_signature(self):
        # the arguments to test_signature are: nin, nout, core_signature
        # pass
        assert_equal(umt.test_signature(2, 1, "(i),(i)->()"), 1)

        # pass. empty core signature; treat as plain ufunc (with trivial core)
        assert_equal(umt.test_signature(2, 1, "(),()->()"), 0)

        # in the following calls, a ValueError should be raised because
        # of error in core signature
        # FIXME These should be using assert_raises

        # error: extra parenthesis
        msg = "core_sig: extra parenthesis"
        try:
            ret = umt.test_signature(2, 1, "((i)),(i)->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: parenthesis matching
        msg = "core_sig: parenthesis matching"
        try:
            ret = umt.test_signature(2, 1, "(i),)i(->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: incomplete signature. letters outside of parenthesis are ignored
        msg = "core_sig: incomplete signature"
        try:
            ret = umt.test_signature(2, 1, "(i),->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: incomplete signature. 2 output arguments are specified
        msg = "core_sig: incomplete signature"
        try:
            ret = umt.test_signature(2, 2, "(i),(i)->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # more complicated names for variables
        assert_equal(umt.test_signature(2, 1, "(i1,i2),(J_1)->(_kAB)"), 1) 
Example 21
Project: PYPIC   Author: max614   File: test_ufunc.py    BSD 2-Clause "Simplified" License 4 votes vote down vote up
def test_signature(self):
        # the arguments to test_signature are: nin, nout, core_signature
        # pass
        assert_equal(umt.test_signature(2, 1, "(i),(i)->()"), 1)

        # pass. empty core signature; treat as plain ufunc (with trivial core)
        assert_equal(umt.test_signature(2, 1, "(),()->()"), 0)

        # in the following calls, a ValueError should be raised because
        # of error in core signature
        # FIXME These should be using assert_raises

        # error: extra parenthesis
        msg = "core_sig: extra parenthesis"
        try:
            ret = umt.test_signature(2, 1, "((i)),(i)->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: parenthesis matching
        msg = "core_sig: parenthesis matching"
        try:
            ret = umt.test_signature(2, 1, "(i),)i(->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: incomplete signature. letters outside of parenthesis are ignored
        msg = "core_sig: incomplete signature"
        try:
            ret = umt.test_signature(2, 1, "(i),->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: incomplete signature. 2 output arguments are specified
        msg = "core_sig: incomplete signature"
        try:
            ret = umt.test_signature(2, 2, "(i),(i)->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # more complicated names for variables
        assert_equal(umt.test_signature(2, 1, "(i1,i2),(J_1)->(_kAB)"), 1) 
Example 22
Project: offlow   Author: satwikkansal   File: test_ufunc.py    GNU General Public License v3.0 4 votes vote down vote up
def test_signature(self):
        # the arguments to test_signature are: nin, nout, core_signature
        # pass
        assert_equal(umt.test_signature(2, 1, "(i),(i)->()"), 1)

        # pass. empty core signature; treat as plain ufunc (with trivial core)
        assert_equal(umt.test_signature(2, 1, "(),()->()"), 0)

        # in the following calls, a ValueError should be raised because
        # of error in core signature
        # FIXME These should be using assert_raises

        # error: extra parenthesis
        msg = "core_sig: extra parenthesis"
        try:
            ret = umt.test_signature(2, 1, "((i)),(i)->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: parenthesis matching
        msg = "core_sig: parenthesis matching"
        try:
            ret = umt.test_signature(2, 1, "(i),)i(->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: incomplete signature. letters outside of parenthesis are ignored
        msg = "core_sig: incomplete signature"
        try:
            ret = umt.test_signature(2, 1, "(i),->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: incomplete signature. 2 output arguments are specified
        msg = "core_sig: incomplete signature"
        try:
            ret = umt.test_signature(2, 2, "(i),(i)->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # more complicated names for variables
        assert_equal(umt.test_signature(2, 1, "(i1,i2),(J_1)->(_kAB)"), 1) 
Example 23
Project: elasticintel   Author: securityclippy   File: test_ufunc.py    GNU General Public License v3.0 4 votes vote down vote up
def test_signature(self):
        # the arguments to test_signature are: nin, nout, core_signature
        # pass
        assert_equal(umt.test_signature(2, 1, "(i),(i)->()"), 1)

        # pass. empty core signature; treat as plain ufunc (with trivial core)
        assert_equal(umt.test_signature(2, 1, "(),()->()"), 0)

        # in the following calls, a ValueError should be raised because
        # of error in core signature
        # FIXME These should be using assert_raises

        # error: extra parenthesis
        msg = "core_sig: extra parenthesis"
        try:
            ret = umt.test_signature(2, 1, "((i)),(i)->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: parenthesis matching
        msg = "core_sig: parenthesis matching"
        try:
            ret = umt.test_signature(2, 1, "(i),)i(->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: incomplete signature. letters outside of parenthesis are ignored
        msg = "core_sig: incomplete signature"
        try:
            ret = umt.test_signature(2, 1, "(i),->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: incomplete signature. 2 output arguments are specified
        msg = "core_sig: incomplete signature"
        try:
            ret = umt.test_signature(2, 2, "(i),(i)->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # more complicated names for variables
        assert_equal(umt.test_signature(2, 1, "(i1,i2),(J_1)->(_kAB)"), 1) 
Example 24
Project: fund-rank-dashboard   Author: 1pani   File: test_ufunc.py    Apache License 2.0 4 votes vote down vote up
def test_signature(self):
        # the arguments to test_signature are: nin, nout, core_signature
        # pass
        assert_equal(umt.test_signature(2, 1, "(i),(i)->()"), 1)

        # pass. empty core signature; treat as plain ufunc (with trivial core)
        assert_equal(umt.test_signature(2, 1, "(),()->()"), 0)

        # in the following calls, a ValueError should be raised because
        # of error in core signature
        # FIXME These should be using assert_raises

        # error: extra parenthesis
        msg = "core_sig: extra parenthesis"
        try:
            ret = umt.test_signature(2, 1, "((i)),(i)->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: parenthesis matching
        msg = "core_sig: parenthesis matching"
        try:
            ret = umt.test_signature(2, 1, "(i),)i(->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: incomplete signature. letters outside of parenthesis are ignored
        msg = "core_sig: incomplete signature"
        try:
            ret = umt.test_signature(2, 1, "(i),->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # error: incomplete signature. 2 output arguments are specified
        msg = "core_sig: incomplete signature"
        try:
            ret = umt.test_signature(2, 2, "(i),(i)->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass

        # more complicated names for variables
        assert_equal(umt.test_signature(2, 1, "(i1,i2),(J_1)->(_kAB)"), 1)