Skip to content

Commit 51f48ff

Browse files
committed
Fix flake8 complaints
What: 1. Add exception for E203 whitespace before ':' 2. Ignore use of bad variable name "l" 3. Remove unused import Why: 1. There seems to be a discrepancy between the use of ':' within a slice: PyCQA/pycodestyle#373. Since black can handle the whitespace regarding ':' for both in and out of slices, we ignore this error and trust black to format it. 2. Because l is comonly used in equations for density matrices
1 parent 4480cf3 commit 51f48ff

File tree

5 files changed

+5
-4
lines changed

5 files changed

+5
-4
lines changed

tests/test_ham_unrestricted_base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def test_orb_rotate_jacobi():
114114

115115
theta = 2 * np.pi * (np.random.random() - 0.5)
116116

117-
Test = disable_abstract(BaseUnrestrictedHamiltonian)
117+
Test = disable_abstract(BaseUnrestrictedHamiltonian) # noqa: N806
118118
ham = Test([one_int_alpha, one_int_beta], [two_int_aaaa, two_int_abab, two_int_bbbb])
119119

120120
with pytest.raises(TypeError):

tests/test_solver_equation.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def template_params(self):
5151
def check_cma():
5252
"""Check if cma module is available."""
5353
try:
54-
import cma
54+
import cma # noqa: F401
5555
except ModuleNotFoundError:
5656
return False
5757
else:

tox.ini

+2
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ ignore =
123123
W503,
124124
# W504 : Line break occurred after a binary operator
125125
W504,
126+
# E203 : Whitespace before ':'
127+
E203,
126128

127129
# pylintrc
128130
[FORMAT]

wfns/ham/density.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ def density_matrix(
335335
# if double excitation
336336
elif len(left_diff) == 2:
337337
i, j = left_diff
338-
k, l = right_diff
338+
k, l = right_diff # noqa: E741
339339
add_two_density(two_densities, i, j, k, l, val, orbtype=orbtype)
340340
add_two_density(two_densities, j, i, l, k, val, orbtype=orbtype)
341341
add_two_density(two_densities, k, l, i, j, val, orbtype=orbtype)

wfns/ham/unrestricted_chemical.py

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import numpy as np
33
from wfns.backend import slater, math_tools
44
from wfns.ham.unrestricted_base import BaseUnrestrictedHamiltonian
5-
from wfns.ham.generalized_chemical import GeneralizedChemicalHamiltonian
65

76

87
class UnrestrictedChemicalHamiltonian(BaseUnrestrictedHamiltonian):

0 commit comments

Comments
 (0)