Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion ci/asv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dependencies:
- datashader
- geoviews
- holoviews
- matplotlib-base
- matplotlib-base<3.11 # 3.11.0 breaks some plots but <3.11 is fine; see issue #1542.
- matplotlib-inline
- healpix
- netcdf4
Expand Down
2 changes: 1 addition & 1 deletion ci/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ dependencies:
- myst-nb
- sphinx-design
- nbsphinx
- matplotlib-base
- matplotlib-base<3.11 # 3.11.0 breaks some plots but <3.11 is fine; see issue #1542.
- matplotlib-inline
- shapely
- hvplot
Expand Down
2 changes: 1 addition & 1 deletion ci/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dependencies:
- holoviews
- hvplot
- hypothesis
- matplotlib-base
- matplotlib-base<3.11 # 3.11.0 breaks some plots but <3.11 is fine; see issue #1542.
- matplotlib-inline
- netcdf4
- numba
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dependencies = [
"datashader",
"geoviews",
"holoviews",
"matplotlib",
"matplotlib<3.11", # matplotlib 3.11.0 breaks some plots but <3.11 is fine; see issue #1542.
"matplotlib-inline",
"netcdf4",
"numba",
Expand Down
16 changes: 16 additions & 0 deletions test/test_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,3 +229,19 @@ def test_to_raster_pixel_ratio(gridpath, r1, r2):
f = r2 / r1
d = np.array(raster2.shape) - f * np.array(raster1.shape)
assert (d >= 0).all() and (d <= f - 1).all()

def test_plot_with_features(gridpath, datasetpath):
"""ensure can render a multiplot layout with geoviews features.
Regression test for issue #1542.
"""
gridpath = gridpath("ugrid", "geoflow-small", "grid.nc")
uxds1 = ux.open_dataset(gridpath, datasetpath("ugrid", "geoflow-small", "v1.nc"))
uxds2 = ux.open_dataset(gridpath, datasetpath("ugrid", "geoflow-small", "v2.nc"))
uxds1 = uxds1.isel(time=0, meshLayers=0) # plot currently expects 1D along n_node
uxds2 = uxds2.isel(time=0, meshLayers=0)
plot1 = uxds1["v1"].plot(features=['coastline'])
plot2 = uxds2["v2"].plot(features=['coastline'])
plot = plot1 + plot2
# the crash associated with issue #1542 only occurs when actually trying to render:
renderer = hv.renderer("matplotlib")
renderer.get_plot(plot)
Loading