diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index bf0cb8dec..5b7a2ff43 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -40,6 +40,9 @@ jobs: os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] # Run on the full set on schedule, workflow_dispatch and push&tags events, otherwise on a subset. python-version: ${{ ( github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || ( github.event_name == 'push' && github.ref_type == 'tag' ) ) && fromJSON('["3.7", "3.8", "3.9", "3.10", "3.11"]') || fromJSON('["3.7", "3.9", "3.11"]') }} + exclude: + - os: macos-latest + python-version: 3.7 timeout-minutes: 90 defaults: run: @@ -56,11 +59,11 @@ jobs: conda-update: true conda-mamba: mamba id: install - - name: patch fiona/geostack on Python 3.7 / Macos - if: steps.install.outputs.cache-hit != 'true' && contains(matrix.os, 'macos') && matrix.python-version == '3.7' + - name: Add Holoviews branch run: | conda activate test-environment - mamba install "fiona=1.8" "gdal=3.3" + conda uninstall holoviews -y --offline --force || echo already uninstalled + pip install "git+https://github.com/holoviz/holoviews.git@xarray_improve" - name: doit test_unit run: | conda activate test-environment diff --git a/hvplot/converter.py b/hvplot/converter.py index 3c2e72eef..64706e68a 100644 --- a/hvplot/converter.py +++ b/hvplot/converter.py @@ -754,7 +754,9 @@ def _process_data(self, kind, data, x, y, by, groupby, row, col, raise ValueError("Cannot plot an empty xarray.Dataset object.") if z is None: if isinstance(data, xr.Dataset): - z = list(data.data_vars)[0] + z = [k for k in data.data_vars if k not in (x, y)] + if len(z) > 0: + z = z[0] else: z = data.name or label or value_label if gridded and isinstance(data, xr.Dataset) and not isinstance(z, list): @@ -1236,7 +1238,9 @@ def method_wrapper(ds, x, y): elif self.datatype == 'xarray': import xarray as xr if isinstance(data, xr.Dataset): - dataset = Dataset(data, self.indexes) + kdims = self.indexes + vdims = [vd for vd in data.data_vars.variables if vd not in kdims] + dataset = Dataset(data, kdims=kdims, vdims=vdims) else: name = data.name or self.label or self.value_label dataset = Dataset(data, self.indexes, name) @@ -2241,7 +2245,7 @@ def _geom_plot(self, x=None, y=None, data=None, kind='polygons'): redim = self._merge_redim({self._color_dim: self._dim_ranges['c']} if self._color_dim else {}) kdims, vdims = self._get_dimensions([x, y], []) if self.gridded_data: - vdims = Dataset(data).vdims + vdims = [vd for vd in Dataset(data).vdims if vd not in kdims] element = self._get_element(kind) cur_opts, compat_opts = self._get_compat_opts(element.name) for opts_ in [cur_opts, compat_opts]: