Remove W391

parent 44a75715
......@@ -11,5 +11,5 @@ master:
- su user -c 'gpaw install-data --register gpaw-datasets'
- su user -c 'gpaw -P 1 info'
- su user -c 'gpaw test --range linalg/gemm_complex.py,lcao/dos.py'
- flake8 --ignore E722,E222,E701,E731,E114,E402,E502,W391,E262,E266,E203,E305,E128,E221,E127,E202,E303,E302,E201,E241,E225,E251,E261,E265,E231,E226,W291,E501,E129,E741,W293,W504,W503,W605 --exclude "doc/platforms/*" gpaw doc
- flake8 --ignore E722,E222,E701,E731,E114,E402,E502,E262,E266,E203,E305,E128,E221,E127,E202,E303,E302,E201,E241,E225,E251,E261,E265,E231,E226,W291,E501,E129,E741,W293,W504,W503,W605 --exclude "doc/platforms/*" gpaw doc
- python -We:invalid -m compileall -f -q gpaw/
......@@ -144,4 +144,3 @@ else:
"""
mpi_debug('result: %s' % result)
......@@ -53,4 +53,3 @@ if __name__=='__main__':
print(np.around(H.real, 2))
print(np.around(V.real ,2))
print(np.around(ion_shift.diagonal().real, 2))
......@@ -39,5 +39,3 @@ if world.rank == 0:
lr2.diagonalize()
ex_lr = lr2[1].get_energy() * Hartree
equal(e_singlet_lr, e_singlet, 0.05)
......@@ -32,5 +32,3 @@ co.set_calculator(calc)
co.get_potential_energy()
(eps_homo, eps_lumo) = calc.get_homo_lumo()
equal(eps_homo, -IP, 0.15)
......@@ -11,4 +11,3 @@ if exitcode != 0:
raise RuntimeError(('Octopus exited with exit code: %d. ' +
'Check %s.log for more information.') %
(exitcode, label))
......@@ -14,4 +14,3 @@ calc.write('si.gpw', 'all') # Use 'all' option to write wavefunctio
df = DielectricFunction(calc='si.gpw', # Ground state gpw file (with wavefunction) as input
domega0=0.05) # Using nonlinear frequency grid
df.get_dielectric_function() # By default, a file called 'df.csv' is generated
......@@ -38,6 +38,3 @@ for i in range(result['iqp'].shape[0]):
'Gap:',
np.min(result['iqp'][i, 0, :, 3]) -
np.max(result['iqp'][i, 0, :, 2]))
......@@ -15,7 +15,3 @@ plt.ylabel('Band gap (eV)')
plt.xlabel('Iteration')
plt.savefig('BN_GW0.png')
plt.show()
......@@ -14,4 +14,3 @@ gw = G0W0(calc='MoS2_fulldiag.gpw',
savepckl=True)
gw.calculate()
......@@ -38,4 +38,3 @@ ee, ev = HS.get_exciton_binding_energies(eff_mass=inter_mass,
h_distr=hl_array)
print('The interlayer exciton binding energy is:', -ee[0])
......@@ -443,4 +443,3 @@ if __name__ == '__main__':
do.run()
finally:
os.chdir(home)
\ No newline at end of file
......@@ -489,5 +489,3 @@ def convex_hull_volume(pts):
vol = np.sum(tetrahedron_volume(tets[:, 0], tets[:, 1],
tets[:, 2], tets[:, 3]))
return vol
......@@ -62,4 +62,3 @@ class LinearSolver:
psin[:] = psi
#self.timer.stop('Solve Sternheimer preconditioner')
'''
......@@ -210,9 +210,3 @@ class Phonons(phonons.Phonons):
# Move this member function to the ASE class
raise NotImplementedError
......@@ -22,4 +22,3 @@ def read_cc1(fileobj, index=-1):
images.append(Atoms(symbols=symbols, positions=positions))
del lines[:natoms + 1]
return images[index]
......@@ -437,6 +437,3 @@ class LRiPairDensity:
rhot_g[:] = nt_g[:]
self.density.ghat.add(rhot_g, Q_aL)
#print 'dens', self.density.finegd.integrate(rhot_g)
......@@ -662,5 +662,3 @@ class LrResponse:
self.C_im *= 1./np.pi
return (self.C_re,self.C_im)
......@@ -576,4 +576,3 @@ class LrtddftTransitions:
self.lr_comms.parent_comm.sum(f2)
return f2
......@@ -159,4 +159,3 @@ def get_magnetic_integrals_new(self, rgd, phi_jg, phit_jg):
i1 += 1
return rxnabla_iiv
......@@ -261,4 +261,3 @@ class PairDensity:
# np.zeros(self.na))
return nij_g
......@@ -445,8 +445,3 @@ class ProjectorPairOverlap(Overlap, GridPairOverlap):
return Q_axi
else:
return P_axi
......@@ -124,4 +124,3 @@ def calculate_kernel(self, nG, ns, iq, cut_G=None):
fv = np.eye(nG)
return fv
......@@ -239,4 +239,3 @@ class GWBands:
'vbm': vbm,
'cbm': cbm}
return results
......@@ -38,4 +38,3 @@ def lmiter(lmax, full=True, comm=None, cost=None):
assert np.abs(np.sum(parts_r)-1) < 1e-9, (parts_r,np.sum(parts_r))
comm.barrier()
return iter(lm_j[ja:jb+1])
......@@ -234,4 +234,3 @@ def intYdYdphi_ey(l1, m1, l2, m2):
def intYdYdphi_ez(l1, m1, l2, m2): #XXX this is silly
return 0.0
This diff is collapsed.
......@@ -363,4 +363,3 @@ if __name__ == '__main__':
e = np.abs(f_g-f0_g).max()
equal(e, 0, tol, 'lmax=%02d, dR=%g: ' % (lmax, dR))
del R, dR, npts, tol, r_g, theta_g, phi_g, r_vg, rm_g, thetam_g, phim_g, rm_vg, w_g, f0_g, f_g, e
......@@ -340,4 +340,3 @@ def intYgradY(l1, m1, l2, m2, r_g, dr_g, A_g, B_g, dBdr_g, v=None):
raise ValueError
return D * np.vdot(A_g, dBdr_g * r_g**2 * dr_g) \
+ G * np.vdot(A_g, B_g * r_g * dr_g)
......@@ -280,5 +280,3 @@ class PML:
def isPML(self):
return True
......@@ -234,4 +234,3 @@ class BiCGStab:
return self.iterations
#print self.iterations
......@@ -197,4 +197,3 @@ class CSCG:
return self.iterations
#print self.iterations
......@@ -305,4 +305,3 @@ class DensityFourierTransform(Observer):
self.omega_w = np.load(filename+'_omega') # crude but easy
self.gamma_w = np.load(filename+'_gamma') # crude but easy
......@@ -188,4 +188,3 @@ class DynamicOverlapWriter(DynamicOverlapMonitor):
def __del__(self):
self.fileobj.close()
......@@ -14,5 +14,3 @@ for i in range(3):
i1, i2 = test_derivatives((1.0, -3.4, 1.2),
(0, 2, 0), (1, 0, 1), 1.4, 3.0, i)
equal(i1, i2, 6e-10)
......@@ -45,4 +45,3 @@ pes.save_folded_pes('CO-td.dat', folding=None)
pes = DOSPES(m_c, d_c, shift=True)
pes.save_folded_pes('CO-dos.dat', folding=None)
......@@ -47,4 +47,3 @@ pes.save_folded_pes('NH3-td.dat', folding=None)
pes = DOSPES(m_c, d_c, shift=True)
pes.save_folded_pes('NH3-dos.dat', folding=None)
......@@ -126,4 +126,3 @@ ube_d = np.unique(np.round(be_d,1))[:len(peaks)]
for t, d, ref in zip(ube_t, ube_d, peaks):
equal(t, ref, etol)
equal(t, d, etol)
......@@ -35,4 +35,3 @@ plt.plot(d, (e + de - 2 * e0 - 2 * de0) / (kcal/mol))
plt.xlim(3, 4.9)
plt.ylim(-4, 5)
plt.show()
......@@ -63,4 +63,3 @@ calc.attach(stopcalc, 1)
e = si.get_potential_energy()
niter = calc.get_number_of_iterations()
calc.write('si_hch2p.gpw')
......@@ -76,4 +76,3 @@ if mpi.size == 1:
# assert (np.sum(abs(y1-y2)[0,:] ** 2 ) < 5e-9)
# assert (np.sum(abs(y1-y2)[1,:] ** 2 ) < 5e-9)
# assert (np.sum(abs(y1-y2)[2,:] ** 2 ) < 5e-9)
......@@ -43,4 +43,3 @@ E_es = CO.get_potential_energy()
dE = E_es - E_gs
print(dE)
equal(dE, 5.7595110076, 0.011)
......@@ -38,6 +38,3 @@ d2 = TestSetup().get_derivative_integrals(rgd, g, np.zeros_like(g))
if 0 in d1:
print(abs(d1[0] - d2).max())
assert abs(d1[0] - d2).max() < 2e-6
......@@ -46,5 +46,3 @@ for k in [2, 4, 6, 8]:
restr = Transformer(gd, gd2, k // 2, complex).apply
restr(a, b, phase)
assert abs(gd.integrate(a) - gd2.integrate(b)) < 1e-14
......@@ -53,4 +53,3 @@ qsfdtd.time_propagation('td.gpw', kick_strength=None, time_step=10, iterations=5
ref_cl_dipole_moment = [ -1.01218549e-04, -3.03603883e-05, 1.86063875e-01]
tol = 1e-6
equal(qsfdtd.td_calc.hamiltonian.poisson.get_classical_dipole_moment(), ref_cl_dipole_moment, tol)
......@@ -142,4 +142,3 @@ print('+gaussCKA: %8.5f s' % (time.time()-t))
assert np.abs(gs0_G-gs1_G).max() < 1e-12, 'Max error %g' % np.abs(gs0_G-gs1_G).max()
del gs0_G, gs1_G
......@@ -35,4 +35,3 @@ print("""References:
[1] Self-consistent approximation to the Kohn-Sham exchange potential
Gritsenko, Oleg; Leeuwen, Robert van; Lenthe, Erik van; Baerends, Evert Jan
Phys. Rev. A Vol. 51 p. 1944""")
......@@ -40,4 +40,3 @@ calc2 = GPAW('Li')
calc2.initialize_positions()
wf2 = calc2.get_pseudo_wave_function(kpt=3, band=0)
equal(abs(wf1 - wf2).max(), 0, 1e-9)
......@@ -46,6 +46,3 @@ for v in range(3):
C0_n /= -2 * eps
assert abs(C0_n - d_aniv[0][:, 0, v]).max() < 1e-8
pos_av[0, v] += eps
......@@ -41,7 +41,3 @@ for v in range(3):
pos_av[0, v] += eps
if 0 in d_avv:
assert np.abs(d_avv[0]).max() < 1e-10
......@@ -171,4 +171,3 @@ performance = numflop*numreps/t
print('gemvN : %8.5f s, %8.5f Mflops' % (t,performance/1024**2.))
assert np.abs(nx0_q-nx4_q).max()<5e-12
del nT_gq, nx4_q
......@@ -41,4 +41,3 @@ expected=[ -1.14670206, -11.02164441]
res=d2Excdnsdnt(dup,ddn)
if out: print(res)
equiv(res[isp][ksp],expected)
......@@ -100,4 +100,3 @@ al = Albrecht(H2, KSSingles, gsname=gsname, exname=exname,
approximation='Albrecht BC', txt=txt)
ali = al.absolute_intensity(omega=om)[-1]
equal(pri, ali, 3)
......@@ -61,4 +61,3 @@ if world.size > 1 and world.rank == 0:
comm=comm, verbose=True,)
isi = pzsi.intensity(omega=om)[-1]
equal(isi, i, 1e-11)
......@@ -68,4 +68,3 @@ alam = Albrecht(H2, KSSingles, gsname=gsname, exname=exname,
# single excitation energies should agree
equal(ints, alam.intensity(omega=om)[0] , 1e-11)
alam.summary(omega=5, method='frederiksen')
......@@ -14,4 +14,3 @@ sys.stderr = _stderr
if not result.wasSuccessful():
print("numpy_test%02d.out" % rank, result.errors, result.failures, file=sys.stderr)
assert result.wasSuccessful()
......@@ -176,4 +176,3 @@ if compiled_with_sl():
# do last test plus buffer_size keyword
parallel['buffer_size'] = 150
run(**OH_kwargs)
......@@ -126,5 +126,3 @@ if __name__ in ['__main__', '__builtin__']:
else:
main(dtype=float)
main(dtype=complex)
......@@ -74,4 +74,3 @@ if check and rank == 0:
if np.abs(A[i,:] - B[i,:]).sum() > 1e-6:
if np.abs(A[i,:] + B[i,:]).sum() > 1e-6:
raise ValueError('Check !')
......@@ -34,4 +34,3 @@ if world.rank == 0:
xa = a0[ia:ia + M, ja:ja + N]
xb = b0[ib:ib + M, jb:jb + N]
assert (xa == xb).all()
......@@ -497,4 +497,3 @@ if __name__ in ['__main__', '__builtin__']:
# Provide feedback on failed tests if imported by test.py
if __name__ == '__builtin__' and not testresult.wasSuccessful():
raise SystemExit('Test failed. Check ut_invops.log for details.')
......@@ -334,4 +334,3 @@ class ParallelTestProgram(TestProgram):
TestProgram.runTests(self)
main = ParallelTestProgram
......@@ -18,4 +18,3 @@ fmax = np.abs(f).max()
print('maxforce', fmax)
assert fmax < 0.05 # 0.03 normally, 2.7 with bug
# fmax can be converged much closer to 0 with better grid/SCF convergence.
......@@ -51,4 +51,3 @@ equal(a,b, 1e-5)
c = MGGA_fail()
d = MGGA_work()
equal(c,d, 1e-5)
......@@ -3,5 +3,3 @@ weight0_n, Y0_nL, R0_nv = run()
assert (abs(weight0_n - weight_n).sum() +
abs(Y0_nL - Y_nL).sum() +
abs(R0_nv - R_nv).sum()) < 1e-13
......@@ -83,4 +83,3 @@ for GSkwargs in GSsettings:
print('DFkwargs2:', DFkwargs)
print(np.max(np.abs((df - df2) / df)))
raise AssertionError
......@@ -45,5 +45,3 @@ if world.rank == 0:
lr2.diagonalize()
ex_lr = lr2[1].get_energy() * Hartree
equal(e_singlet_lr, ex_lr, 0.15)
......@@ -2,5 +2,3 @@ from myqueue.task import task
def create_tasks():
return [task('[email protected]:1m')]
......@@ -14,4 +14,3 @@ sys.stderr = _stderr
if not result.wasSuccessful():
print("scipy_test%02d.out" % rank, result.errors, result.failures, file=sys.stderr)
assert result.wasSuccessful()
......@@ -31,6 +31,3 @@ for poiss in [None, PoissonSolver(nn=c2.hamiltonian.poisson.nn)]:
lr = LrTDDFT(c2, poisson=poiss)
print(lr)
print(Overlap(c1).pseudo(c2))
......@@ -264,4 +264,3 @@ if __name__ in ['__main__', '__builtin__']:
# Provide feedback on failed tests if imported by test.py
if __name__ == '__builtin__' and not testresult.wasSuccessful():
raise SystemExit('Test failed. Check ut_tddft.log for details.')
......@@ -89,5 +89,3 @@ mol.translate(-mol[0].position)
mol.translate([-1.e-24, 0, 0])
calc.calculate(mol)
run()
......@@ -77,4 +77,3 @@ for img1, img2 in zip(images, images_ref):
assert norm <1e-11
print("Speedup", Pyversion / Cversion)
......@@ -72,4 +72,3 @@ for name in ['LDA', 'PBE']:
ns[:] = n / 2
Es = xc.calculate(gd, ns, 0 * ns)
equal(E, Es, 1e-13)
......@@ -609,4 +609,3 @@ def dscf_collapse_orbitals(paw, nbands_max='occupied', f_tol=1e-4,
if debug: mpi_debug('delta-D_asp: %g' % max([0]+[np.abs(D_sp-old_D_asp[a]).max() for a,D_sp in paw.density.D_asp.items()]))
for a,D_sp in paw.density.D_asp.items():
assert np.abs(D_sp-old_D_asp[a]).max() < D_tol, 'Atom %d changed!' % a
......@@ -125,5 +125,3 @@ def construct_symmetry_operators(wfs, spos_ac, K):
if __name__ == '__main__':
import sys
ibz2bz(sys.argv[1])
......@@ -527,4 +527,3 @@ def pblas_simple_rk(desca, descc, a, c):
beta = 0.0
pblas_rk(alpha, a, beta, c,
desca, descc)
......@@ -253,4 +253,3 @@ def write_viewmol(pt, filename, mode='w'):
for atoms in pt:
vt.add(atoms)
del(vt)
......@@ -113,5 +113,3 @@ class FixBondLengthsWaterModel(FixBondLengths):
def index_shuffle(self, atoms, ind):
raise NotImplementedError
......@@ -275,6 +275,3 @@ class C_GLLBScr(Contribution):
def write(self, writer):
# GLLBScr has no special data to be written
pass
......@@ -33,4 +33,3 @@ class Contribution:
def add_extra_setup_date(self, dict):
raise NotImplementedError
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment