Skip to content

Commit ca6153f

Browse files
authored
Inline list and dictionary creation (#3836)
# Description This is mostly to satisfy the IDE linter, which didn't like the piecemeal creation of the dictionary. Go ahead and inline the list as well. # Changed Behaviour None. ## Type of change - Code maintenance/cleanup
1 parent a6b159a commit ca6153f

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

parsl/executors/status_handling.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -289,20 +289,20 @@ def send_monitoring_info(self, status: Dict) -> None:
289289
logger.debug("Sending block monitoring message: %r", msg)
290290
self.submit_monitoring_radio.send((MessageType.BLOCK_INFO, msg))
291291

292-
def create_monitoring_info(self, status: Dict[str, JobStatus]) -> Sequence[object]:
292+
def create_monitoring_info(self, status: Dict[str, JobStatus]) -> Sequence[Dict[str, Any]]:
293293
"""Create a monitoring message for each block based on the poll status.
294294
"""
295-
msg = []
296-
for bid, s in status.items():
297-
d: Dict[str, Any] = {}
298-
d['run_id'] = self.run_id
299-
d['status'] = s.status_name
300-
d['timestamp'] = datetime.datetime.now()
301-
d['executor_label'] = self.label
302-
d['job_id'] = self.blocks_to_job_id.get(bid, None)
303-
d['block_id'] = bid
304-
msg.append(d)
305-
return msg
295+
return [
296+
{
297+
"run_id": self.run_id,
298+
"status": s.status_name,
299+
"timestamp": datetime.datetime.now(),
300+
"executor_label": self.label,
301+
"job_id": self.blocks_to_job_id.get(bid, None),
302+
"block_id": bid
303+
}
304+
for bid, s in status.items()
305+
]
306306

307307
def poll_facade(self) -> None:
308308
now = time.time()

0 commit comments

Comments
 (0)