disable pycompact test write to file and ignore .so files

This commit is contained in:
ignis 2019-08-05 13:02:24 +09:00
parent b7af4002ba
commit c650f61ea3
2 changed files with 19 additions and 12 deletions

1
code/.gitignore vendored
View file

@ -1,3 +1,4 @@
*.o *.o
*.so
*.pyc *.pyc
*.ipynb *.ipynb

View file

@ -215,6 +215,8 @@ def read_data (fname):
def validate_trigonometric(): def validate_trigonometric():
writeToFile = False
shape = (256, 256, 512) shape = (256, 256, 512)
nz, ny, nx = shape nz, ny, nx = shape
@ -245,24 +247,28 @@ def validate_trigonometric():
Y1[:] = np.sin(1.1 * xx) * np.sin(3.0 * yy) * np.sin(2.0 * zz)[:] Y1[:] = np.sin(1.1 * xx) * np.sin(3.0 * yy) * np.sin(2.0 * zz)[:]
true[:] = (1.1 * np.cos(1.1 * xx) * np.sin(3.0 * yy) * np.sin(2.0 * zz))[:] true[:] = (1.1 * np.cos(1.1 * xx) * np.sin(3.0 * yy) * np.sin(2.0 * zz))[:]
dY1 = cs.ddx(Y1)[:]
y = np.memmap("phi", dtype=np.float64, mode="w+", shape=cs.shape) print (dY1.min(), dY1.max())
y[:] = Y1[:]
dydxtrue = np.memmap("dphitrue", dtype=np.float64, mode="w+", shape=cs.shape)
dydxtrue[:] = true[:]
dydx = np.memmap("dphi", dtype=np.float64, mode="w+", shape=cs.shape) print (true.min(), true.max())
dydx[:] = cs.ddx(Y1)[:]
relerr = (dY1 - true) / true
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))
if writeToFile:
y = np.memmap("phi", dtype=np.float64, mode="w+", shape=cs.shape)
y[:] = Y1[:]
dydxtrue = np.memmap("dphitrue", dtype=np.float64, mode="w+", shape=cs.shape)
dydxtrue[:] = true[:]
dydx = np.memmap("dphi", dtype=np.float64, mode="w+", shape=cs.shape)
dydx[:] = dY1[:]
# cs.verify_nonp_coef() # cs.verify_nonp_coef()