Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/boututils/showdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,9 +423,9 @@
# Generate grids for plotting
# Try to use provided grids where possible
# If x and/or y are not lists, apply to all variables
if not isinstance(x, (list, tuple)):

Check failure on line 426 in src/boututils/showdata.py

View workflow job for this annotation

GitHub Actions / lint

Ruff (UP038)

src/boututils/showdata.py:426:12: UP038 Use `X | Y` in `isinstance` call instead of `(X, Y)`

Check failure on line 426 in src/boututils/showdata.py

View workflow job for this annotation

GitHub Actions / lint

Ruff (UP038)

src/boututils/showdata.py:426:12: UP038 Use `X | Y` in `isinstance` call instead of `(X, Y)`
x = [x] * Nvar # Make list of x with length Nvar
if not isinstance(y, (list, tuple)):

Check failure on line 428 in src/boututils/showdata.py

View workflow job for this annotation

GitHub Actions / lint

Ruff (UP038)

src/boututils/showdata.py:428:12: UP038 Use `X | Y` in `isinstance` call instead of `(X, Y)`

Check failure on line 428 in src/boututils/showdata.py

View workflow job for this annotation

GitHub Actions / lint

Ruff (UP038)

src/boututils/showdata.py:428:12: UP038 Use `X | Y` in `isinstance` call instead of `(X, Y)`
y = [y] * Nvar # Make list of x with length Nvar
xnew = []
ynew = []
Expand All @@ -446,7 +446,7 @@
+ ", the shape of x is not compatible with the shape of the "
"variable. Shape of x should be (Nx), (Nx,Ny) or (Nt,Nx,Ny)."
)
except ValueError:
except (ValueError, IndexError):
for j in range(0, Nlines[i]):
xnew[i].append(linspace(0, Nx[i][j] - 1, Nx[i][j]))

Expand All @@ -468,7 +468,7 @@
+ ", the shape of y is not compatible with the shape of the "
"variable. Shape of y should be (Ny), (Nx,Ny) or (Nt,Nx,Ny)."
)
except ValueError:
except (ValueError, IndexError):
ynew.append(linspace(0, Ny[i][0] - 1, Ny[i][0]))
else:
ynew.append(0)
Expand Down
Loading