Skip to content

Commit d1b60b3

Browse files
committed
Satisfy mypy
1 parent 95ba17c commit d1b60b3

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

yt/utilities/parallel_tools/parallel_analysis_interface.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,12 +1003,14 @@ def all_concat(self, data: dict[Any, np.ndarray | dict[str, np.ndarray]]):
10031003
}
10041004
else:
10051005
# Otherwise, we assume our values can be concatenated
1006+
# NOTE: mypy complains about incompatible types here
10061007
all_values = np.concatenate(
1007-
[np.atleast_1d(value) for value in data.values()]
1008+
[np.atleast_1d(value) for value in data.values()] # type: ignore[arg-type]
10081009
)
10091010

10101011
if self._distributed:
1011-
all_values = np.concatenate(self.comm.allgather(all_values))
1012+
# NOTE: mypy thinks this statement is unreachable (it is not)
1013+
all_values = np.concatenate(self.comm.allgather(all_values)) # type: ignore[unreachable]
10121014

10131015
return all_values
10141016

@@ -1037,12 +1039,14 @@ def concat(
10371039
}
10381040
else:
10391041
# Otherwise, we assume our values can be concatenated
1042+
# NOTE: mypy complains about incompatible types here
10401043
all_values = np.concatenate(
1041-
[np.atleast_1d(value) for value in data.values()]
1044+
[np.atleast_1d(value) for value in data.values()] # type: ignore[arg-type]
10421045
)
10431046

10441047
if self._distributed:
1045-
tmp = self.comm.gather(all_values, root=root)
1048+
# NOTE: mypy thinks this statement is unreachable (it is not)
1049+
tmp = self.comm.gather(all_values, root=root) # type: ignore[unreachable]
10461050
if self.comm.rank == root:
10471051
return np.concatenate(tmp)
10481052
else:

0 commit comments

Comments
 (0)