Skip to content

Commit 1fb6416

Browse files
authored
#573: verified that no bug is actually present but made stylistic changes (#580)
* #573: verified that no bug is actually present but made stylistic changes nonetheless * #573: whitespace cleanup
1 parent c575f9b commit 1fb6416

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/lbaf/IO/lbsVTDataReader.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,9 @@ def __init__(
134134

135135
def _get_n_ranks(self):
136136
"""Determine the number of ranks automatically.
137-
138-
This use the first applicable method in the following methods:
139-
List all data file names matching {file_prefix}.{rank_id}.{file_suffix} pattern and return max(rank_id) + 1.
137+
This uses the first applicable method in the following methods:
138+
List all data file names matching {file_prefix}.{rank_id}.{file_suffix}
139+
pattern and return max(rank_id) + 1.
140140
"""
141141

142142
# or default detect data files with pattern
@@ -224,9 +224,9 @@ def _populate_rank(self, phase_id: int, rank_id: int) -> Tuple[Rank,dict]:
224224
self.__logger.debug(
225225
f"Loading phase {curr_phase_id} for rank {rank_id}")
226226

227-
# Add communications to the object
227+
# Add communications when available
228228
rank_comm = {}
229-
if (communications := phase.get("communications")): # pylint:disable=W0631:undefined-loop-variable
229+
if (communications := phase.get("communications")):
230230
if phase_id in self.__communications_dict:
231231
self.__communications_dict[phase_id][rank_id] = communications
232232
else:
@@ -263,6 +263,7 @@ def _populate_rank(self, phase_id: int, rank_id: int) -> Tuple[Rank,dict]:
263263
for k, v in comm.items():
264264
self.__logger.debug(f"{k}: {v}")
265265
else:
266+
# No communications for this phase
266267
self.__communications_dict.setdefault(phase_id, {rank_id: {}})
267268

268269
# Instantiante rank for current phase
@@ -273,11 +274,11 @@ def _populate_rank(self, phase_id: int, rank_id: int) -> Tuple[Rank,dict]:
273274
rank_blocks, task_user_defined = {}, {}
274275

275276
# Iterate over tasks
276-
for task in phase.get("tasks", []): # pylint:disable=W0631:undefined-loop-variable
277+
for task in phase.get("tasks", []):
277278
# Retrieve required values
278279
task_entity = task.get("entity")
279-
task_id = task_entity.get("id", None)
280-
task_seq_id = task_entity.get("seq_id", None)
280+
task_id = task_entity.get("id")
281+
task_seq_id = task_entity.get("seq_id")
281282
task_load = task.get("time")
282283
task_user_defined = task.get("user_defined", {})
283284
subphases = task.get("subphases")

0 commit comments

Comments
 (0)