Skip to content

Commit 7f78688

Browse files
committed
Fix some linter warnings on isinstance calls
1 parent 88793c2 commit 7f78688

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/boutdata/collect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def _convert_to_nice_slice(r, N, name="range"):
8383
temp_slice = slice(N)
8484
elif isinstance(r, slice):
8585
temp_slice = r
86-
elif isinstance(r, (int, np.integer)):
86+
elif isinstance(r, int | np.integer):
8787
if r >= N or r < -N:
8888
# raise out of bounds error as if we'd tried to index the array with r
8989
# without this, would return an empty array instead

src/boututils/datafile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def read(self, name, ranges=None, asBoutArray=True):
182182
"""
183183
if ranges is not None:
184184
for x in ranges:
185-
if isinstance(x, (list, tuple)):
185+
if isinstance(x, list | tuple):
186186
x = slice(*x)
187187
return self.impl.read(name, ranges=ranges, asBoutArray=asBoutArray)
188188

src/boututils/showdata.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,9 +423,9 @@ def showdata(
423423
# Generate grids for plotting
424424
# Try to use provided grids where possible
425425
# If x and/or y are not lists, apply to all variables
426-
if not isinstance(x, (list, tuple)):
426+
if not isinstance(x, list | tuple):
427427
x = [x] * Nvar # Make list of x with length Nvar
428-
if not isinstance(y, (list, tuple)):
428+
if not isinstance(y, list | tuple):
429429
y = [y] * Nvar # Make list of x with length Nvar
430430
xnew = []
431431
ynew = []

0 commit comments

Comments
 (0)