Example #1
0
def test_par_vector2dict():
    v = [0,  1, -1, -1,  0,  1, -1, -2]
    pars = ['alpha', 'beta']
    dims = [[2, 3], [2]]
    rslt = misc._par_vector2dict(v, pars, dims)
    rslt['alpha'] = np.array([0,  1, -1, -1, 0,  1]).reshape(dims[0])
    rslt['beta'] = np.array([-1, -2])
Example #2
0
def test_par_vector2dict():
    v = [0, 1, -1, -1, 0, 1, -1, -2]
    pars = ["alpha", "beta"]
    dims = [[2, 3], [2]]
    rslt = _par_vector2dict(v, pars, dims)
    rslt["alpha"] = np.array([0, 1, -1, -1, 0, 1]).reshape(dims[0])
    rslt["beta"] = np.array([-1, -2])
Example #3
0
 def test_par_vector2dict(self):
     v = [0, 1, -1, -1, 0, 1, -1, -2]
     pars = ['alpha', 'beta']
     dims = [[2, 3], [2]]
     rslt = misc._par_vector2dict(v, pars, dims)
     np.testing.assert_equal(rslt['alpha'], np.array([0, 1, -1, -1, 0, 1]).reshape(dims[0], order='F'))
     np.testing.assert_equal(rslt['beta'], np.array([-1, -2]))
Example #4
0
def test_par_vector2dict():
    v = [0, 1, -1, -1, 0, 1, -1, -2]
    pars = ['alpha', 'beta']
    dims = [[2, 3], [2]]
    rslt = misc._par_vector2dict(v, pars, dims)
    rslt['alpha'] = np.array([0, 1, -1, -1, 0, 1]).reshape(dims[0])
    rslt['beta'] = np.array([-1, -2])
Example #5
0
 def test_par_vector2dict(self):
     v = [0, 1, -1, -1, 0, 1, -1, -2]
     pars = ['alpha', 'beta']
     dims = [[2, 3], [2]]
     rslt = misc._par_vector2dict(v, pars, dims)
     np.testing.assert_equal(
         rslt['alpha'],
         np.array([0, 1, -1, -1, 0, 1]).reshape(dims[0], order='F'))
     np.testing.assert_equal(rslt['beta'], np.array([-1, -2]))