Skip to content

Commit

Permalink
Apply ruff/bugbear rule
Browse files Browse the repository at this point in the history
B007 Loop control variable `i` not used within loop body
  • Loading branch information
DimitriPapadopoulos authored and FrancescAlted committed Apr 1, 2024
1 parent 7b7ba2e commit 4fcc352
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
3 changes: 0 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,3 @@ extend-select = [
"I",
"UP",
]
ignore = [
"B007",
]
4 changes: 2 additions & 2 deletions tests/test_schunk_delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def test_schunk_delete_numpy(contiguous, urlpath, nchunks, ndeletes):
nchunks_ = schunk.append_data(buffer)
assert nchunks_ == (i + 1)

for i in range(ndeletes):
for _ in range(ndeletes):
pos = random.randint(0, nchunks - 1)
if pos != (nchunks - 1):
buff = schunk.decompress_chunk(pos + 1)
Expand Down Expand Up @@ -84,7 +84,7 @@ def test_schunk_delete(contiguous, urlpath, nchunks, ndeletes):
nchunks_ = schunk.append_data(bytes_obj)
assert nchunks_ == (i + 1)

for i in range(ndeletes):
for _ in range(ndeletes):
pos = random.randint(0, nchunks - 1)
if pos != (nchunks - 1):
buff = schunk.decompress_chunk(pos + 1)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_schunk_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def test_schunk_update_numpy(contiguous, urlpath, nchunks, nupdates, copy, creat
nchunks_ = schunk.append_data(buffer)
assert nchunks_ == (i + 1)

for i in range(nupdates):
for _ in range(nupdates):
pos = random.randint(0, nchunks - 1)
buffer = pos * np.arange(200 * 1000, dtype="int32")
if create_chunk:
Expand Down Expand Up @@ -95,7 +95,7 @@ def test_update(contiguous, urlpath, nchunks, nupdates, copy, create_chunk, gil)
nchunks_ = schunk.append_data(bytes_obj)
assert nchunks_ == (i + 1)

for i in range(nupdates):
for _ in range(nupdates):
pos = random.randint(0, nchunks - 1)
bytes_obj = b"i " * nbytes
if create_chunk:
Expand Down

0 comments on commit 4fcc352

Please sign in to comment.