Skip to content

Commit

Permalink
Fix style bugs; bump flake8 version requirement
Browse files Browse the repository at this point in the history
  • Loading branch information
emerali committed Feb 7, 2019
1 parent 47da669 commit 7716f1c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion qucumber/utils/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def load_data(tr_samples_path, tr_psi_path=None, tr_bases_path=None, bases_path=
for i in range(len(bases_data)):
tmp = ""
for j in range(len(bases_data[i])):
if bases_data[i][j] is not " ":
if bases_data[i][j] != " ":
tmp += bases_data[i][j]
bases.append(tmp)
data.append(bases)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
style_requires = [
"radon>=2.2.0",
"black==18.6b4; python_version>='3.6'",
"flake8>=3.5.0",
"flake8>=3.7.5",
"flake8-per-file-ignores>=0.6",
"flake8-bugbear>=18.2.0",
]
Expand Down
6 changes: 3 additions & 3 deletions tests/grads_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def transform_bases(self, bases_data):
for i in range(len(bases_data)):
tmp = ""
for j in range(len(bases_data[i])):
if bases_data[i][j] is not " ":
if bases_data[i][j] != " ":
tmp += bases_data[i][j]
bases.append(tmp)
return bases
Expand All @@ -151,15 +151,15 @@ def rotate_psi(self, basis, unitary_dict, vis):
num_nontrivial_U = 0
nontrivial_sites = []
for j in range(N):
if basis[j] is not "Z":
if basis[j] != "Z":
num_nontrivial_U += 1
nontrivial_sites.append(j)
sub_state = self.nn_state.generate_hilbert_space(num_nontrivial_U)

for xp in range(1 << num_nontrivial_U):
cnt = 0
for j in range(N):
if basis[j] is not "Z":
if basis[j] != "Z":
v[j] = sub_state[xp][cnt]
cnt += 1
else:
Expand Down

0 comments on commit 7716f1c

Please sign in to comment.