Example #1
0
    def test_input_none(self):

        nq = 3
        qdata_ref = np.atleast_2d(np.zeros((nq, 1)))

        qdata = inputchecks.check_constant_controls_data(None, nq)
        assert_array_equal(qdata, qdata_ref)
Example #2
0
    def test_input_columns(self):

        nq = 3
        qdata_ref = np.atleast_2d(np.random.rand(nq, 1))

        qdata = inputchecks.check_constant_controls_data(qdata_ref.T, nq)
        assert_array_equal(qdata, qdata_ref)
    def test_input_none(self):

        nq = 3
        qdata_ref = np.atleast_2d(np.zeros((nq, 1)))

        qdata = inputchecks.check_constant_controls_data(None, nq)
        assert_array_equal(qdata, qdata_ref)
    def test_input_columns(self):

        nq = 3
        qdata_ref = np.atleast_2d(np.random.rand(nq, 1))

        qdata = inputchecks.check_constant_controls_data(qdata_ref.T, nq)
        assert_array_equal(qdata, qdata_ref)
Example #5
0
    def test_zero_controls(self):

        # In this case, the input value is not used by the function, and
        # therefor irrelevant at this point

        nq = 0
        qdata_ref = ci.dmatrix(0, 1)

        qdata = inputchecks.check_constant_controls_data(None, nq)
        assert_array_equal(qdata, qdata_ref)
    def test_zero_controls(self):

        # In this case, the input value is not used by the function, and
        # therefor irrelevant at this point

        nq = 0
        qdata_ref = ci.dmatrix(0, 1)

        qdata = inputchecks.check_constant_controls_data(None, nq)
        assert_array_equal(qdata, qdata_ref)