def test_reprArray(self, numPoints=200): def evalArray(arrRepr): from numpy import array, zeros, dtype return eval(arrRepr) for _ in range(numPoints): shape = shapeRand(ranks=[0, 1, 2, 3]) arr = randn(*shape) arrRepr = mathhelp.reprArray(arr) arrAgain = evalArray(arrRepr) assert_allclose(arrAgain, arr)
def test_reprArray(self, numPoints = 200): def evalArray(arrRepr): from numpy import array, zeros, dtype return eval(arrRepr) for _ in range(numPoints): shape = shapeRand(ranks = [0, 1, 2, 3]) arr = randn(*shape) arrRepr = mathhelp.reprArray(arr) arrAgain = evalArray(arrRepr) assert_allclose(arrAgain, arr)
def __repr__(self): return 'LinearTransform(%s, tag=%r)' % (reprArray(self.mat), self.tag)