From 990d01ce9dbee457b5a6155cc61b9792ad7299ea Mon Sep 17 00:00:00 2001 From: ignis Date: Mon, 5 Aug 2019 02:12:45 +0900 Subject: [PATCH] python3 print function --- code/pycompact/pycompact.py | 39 ++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/code/pycompact/pycompact.py b/code/pycompact/pycompact.py index 1934a80..dd553a2 100644 --- a/code/pycompact/pycompact.py +++ b/code/pycompact/pycompact.py @@ -75,7 +75,6 @@ class CompactScheme: else: for i in range(nz): xsrc[:] = src[i] - print xsrc.shape dst[i] = compact.dfnonp(self.hx, xsrc, 1) # return np.swapaxes(dst, 1, 2) @@ -142,23 +141,23 @@ def read_old_data (fname): dummy = f1.read(dummy_len) #dummy = f1.read(4) - print t, nx, ny, nz + print (t, nx, ny, nz) #raw_field = f1.read(4+bSize*5+4)[4:-4] V = np.fromfile(f1, dtype=np.float64, count=(3*count)).reshape((3,nz,ny,nx)) s = np.fromfile(f1, dtype=np.float64, count=(2*count)).reshape((nz,ny,nx,2)) - print V.order - print s.order + print (V.order) + print (s.order) - print V.shape - print s.shape + print (V.shape) + print (s.shape) V.order="F" s.order="F" - print V.shape - print s.shape + print (V.shape) + print (s.shape) u = V[0] v = V[1] @@ -192,17 +191,17 @@ def read_data (fname): V = np.fromfile(f1, dtype=np.float64, count=(3*count)).reshape((3,nz,ny,nx)) s = np.fromfile(f1, dtype=np.float64, count=(2*count)).reshape((2,nz,ny,nx)) - print V.order - print s.order + print (V.order) + print (s.order) - print V.shape - print s.shape + print (V.shape) + print (s.shape) V.order="F" s.order="F" - print V.shape - print s.shape + print (V.shape) + print (s.shape) u = V[0] v = V[1] @@ -222,7 +221,7 @@ def validate_trigonometric(): pi8 = np.arccos(-1.) - print pi8 + print (pi8) l_0 = 2.0 hyp=l_0*pi8/ny @@ -257,12 +256,12 @@ def validate_trigonometric(): dydx[:] = cs.ddx(Y1)[:] - print dydx.min(), dydx.max() - print dydxtrue.min(), dydxtrue.max() + print (dydx.min(), dydx.max()) + print (dydxtrue.min(), dydxtrue.max()) relerr = (dydx - dydxtrue) / dydxtrue - print np.nanmin(relerr), np.nanmax(relerr) + print (np.nanmin(relerr), np.nanmax(relerr)) # cs.verify_nonp_coef() @@ -281,7 +280,7 @@ def test_dns_data(): y[:] = Y1[:] - print y.min(), y.max() + print (y.min(), y.max()) dydx = np.memmap("dyr", dtype=np.float64, mode="w+", shape=cs.shape) @@ -289,7 +288,7 @@ def test_dns_data(): dydx.flush() - print dydx.min(), dydx.max() + print (dydx.min(), dydx.max())