@@ -303,12 +303,16 @@ def get_slice(self, selection: np.ndarray[bool | int]):
303303 assert selection .shape == (n ,), (
304304 f"if array of bool given it must be the same size " "as the number of contacts {selection.shape} != {n}"
305305 )
306- selection_indices , = np .nonzero (selection )
306+ ( selection_indices ,) = np .nonzero (selection )
307307 elif selection .dtype .kind == "i" :
308308 assert np .unique (selection ).size == selection .size
309309 if len (selection ) > 0 :
310- assert 0 <= np .min (selection ) < n , f"An index within your selection is out of bounds { np .min (selection )} "
311- assert 0 <= np .max (selection ) < n , f"An index within your selection is out of bounds { np .max (selection )} "
310+ assert (
311+ 0 <= np .min (selection ) < n
312+ ), f"An index within your selection is out of bounds { np .min (selection )} "
313+ assert (
314+ 0 <= np .max (selection ) < n
315+ ), f"An index within your selection is out of bounds { np .max (selection )} "
312316 selection_indices = selection
313317 else :
314318 selection_indices = []
@@ -327,7 +331,9 @@ def get_slice(self, selection: np.ndarray[bool | int]):
327331 probe_limits = (ind , ind + n )
328332 ind += n
329333
330- probe_selection_indices = selection_indices [(selection_indices >= probe_limits [0 ]) & (selection_indices < probe_limits [1 ])]
334+ probe_selection_indices = selection_indices [
335+ (selection_indices >= probe_limits [0 ]) & (selection_indices < probe_limits [1 ])
336+ ]
331337 if len (probe_selection_indices ) == 0 :
332338 continue
333339 sliced_probe = probe .get_slice (probe_selection_indices - probe_limits [0 ])
0 commit comments