Skip to content
Open
Changes from 2 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
2 changes: 1 addition & 1 deletion neural_lam/datastore/plot_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def plot_example_from_datastore(
transform=crs,
size=4,
)
for ax in g.axes.flat:
for ax in g.axs.flat:
ax.coastlines()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

g.axs was added in xarray 2022.11. xarray has no lower bound in pyproject.toml, so older installs will get an AttributeError rather than just a warning. A one-line shim covers both old and new xarray without touching dependencies:

Suggested change
ax.coastlines()
for ax in getattr(g, "axs", g.axes).flat:

ax.gridlines(draw_labels=["left", "bottom"])
ax.set_extent(datastore.get_xy_extent(category=category), crs=crs)
Expand Down