Skip to content

Commit 396f420

Browse files
committed
Merge branch 'ig/simplify_tuple_creation' of github.com:ilan-gold/zarrs-python into ig/simplify_tuple_creation
2 parents d4c5940 + 9d0d3c4 commit 396f420

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

python/zarrs/utils.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
def get_max_threads() -> int:
2222
return (os.cpu_count() or 1) + 4
2323

24+
2425
class UnsupportedIndexTypeError(Exception):
2526
pass
2627

@@ -29,9 +30,12 @@ def selector_tuple_to_slice_selection(selector_tuple: SelectorTuple) -> list[sli
2930
if isinstance(selector_tuple, slice):
3031
return [selector_tuple]
3132
if all(
32-
isinstance(s, slice) and (s.step is None or s.step == 1) or isinstance(s, int) for s in selector_tuple
33+
isinstance(s, slice) and (s.step is None or s.step == 1) or isinstance(s, int)
34+
for s in selector_tuple
3335
):
34-
return list(s if isinstance(s, slice) else slice(s, s + 1) for s in selector_tuple)
36+
return list(
37+
s if isinstance(s, slice) else slice(s, s + 1) for s in selector_tuple
38+
)
3539
raise UnsupportedIndexTypeError(
3640
f"Invalid index type detected among indexes: {selector_tuple}"
3741
)

0 commit comments

Comments
 (0)