Skip to content

Commit

Permalink
Remove unused loop variables
Browse files Browse the repository at this point in the history
This comes from flake8-bugbear branch, working towards eliminating
bugbear B007 errors there.

This PR does not address B007 errors in visualization or in the
test suite.
  • Loading branch information
benclifford committed Nov 1, 2023
1 parent eeb8952 commit ea4af8e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions parsl/executors/high_throughput/interchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def get_tasks(self, count):
eg. [{'task_id':<x>, 'buffer':<buf>} ... ]
"""
tasks = []
for i in range(0, count):
for _ in range(0, count):
try:
x = self.pending_task_queue.get(block=False)
except queue.Empty:
Expand Down Expand Up @@ -518,7 +518,7 @@ def process_results_incoming(self, interesting_managers, hub_channel):

got_result = False
m = self._ready_managers[manager_id]
for (b_message, r) in b_messages:
for (_, r) in b_messages:
assert 'type' in r, f"Message is missing type entry: {r}"
if r['type'] == 'result':
got_result = True
Expand Down
2 changes: 1 addition & 1 deletion parsl/executors/high_throughput/zmq_pipes.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def run(self, message, max_retries=3):
"""
reply = '__PARSL_ZMQ_PIPES_MAGIC__'
with self._lock:
for i in range(max_retries):
for _ in range(max_retries):
try:
self.zmq_socket.send_pyobj(message, copy=True)
reply = self.zmq_socket.recv_pyobj()
Expand Down
2 changes: 1 addition & 1 deletion parsl/executors/status_handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def scale_out(self, blocks: int = 1) -> List[str]:
raise ScalingFailed(self, "No execution provider available")
block_ids = []
logger.info(f"Scaling out by {blocks} blocks")
for i in range(blocks):
for _ in range(blocks):
block_id = str(self._block_id_counter.get_id())
logger.info(f"Allocated block ID {block_id}")
try:
Expand Down
2 changes: 1 addition & 1 deletion parsl/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def get_std_fname_mode(

@contextmanager
def wait_for_file(path: str, seconds: int = 10) -> Generator[None, None, None]:
for i in range(0, int(seconds * 100)):
for _ in range(0, int(seconds * 100)):
time.sleep(seconds / 100.)
if os.path.exists(path):
break
Expand Down

0 comments on commit ea4af8e

Please sign in to comment.