pmlmodelling/nctoolkit

[JOSS] Error running matchpoint.ipynb

Closed this issue · 5 comments

Describe the bug
I'm getting a plotting issue when I try this: https://nctoolkit.readthedocs.io/en/latest/matchpoint.html
I tried both the latest and the stable version of nctoolkit, and I'm using Jupyter Lab.

To Reproduce

import nctoolkit as nc
ds = nc.open_thredds('https://data.nodc.noaa.gov/thredds/dodsC/ncei/woa/nitrate/all/1.00/woa18_all_n01_01.nc', checks = False)
ds.crop(lon =  [-40, 20], lat = [40, 70], nco = True)
ds.subset(variables = "n_an")
ds.run()

ds.plot()
Checking if nctoolkit is available
Warning: xarray could not decode times!
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
File ~/mambaforge/envs/nctoolkit/lib/python3.11/site-packages/IPython/core/formatters.py:974, in MimeBundleFormatter.__call__(self, obj, include, exclude)
    971     method = get_real_method(obj, self.print_method)
    973     if method is not None:
--> 974         return method(include=include, exclude=exclude)
    975     return None
    976 else:

File ~/mambaforge/envs/nctoolkit/lib/python3.11/site-packages/holoviews/core/dimension.py:1290, in Dimensioned._repr_mimebundle_(self, include, exclude)
   1283 def _repr_mimebundle_(self, include=None, exclude=None):
   1284     """
   1285     Resolves the class hierarchy for the class rendering the
   1286     object using any display hooks registered on Store.display
   1287     hooks.  The output of all registered display_hooks is then
   1288     combined and returned.
   1289     """
-> 1290     return Store.render(self)

File ~/mambaforge/envs/nctoolkit/lib/python3.11/site-packages/holoviews/core/options.py:1425, in Store.render(cls, obj)
   1423 data, metadata = {}, {}
   1424 for hook in hooks:
-> 1425     ret = hook(obj)
   1426     if ret is None:
   1427         continue

File ~/mambaforge/envs/nctoolkit/lib/python3.11/site-packages/holoviews/ipython/display_hooks.py:280, in pprint_display(obj)
    278 if not ip.display_formatter.formatters['text/plain'].pprint:
    279     return None
--> 280 return display(obj, raw_output=True)

File ~/mambaforge/envs/nctoolkit/lib/python3.11/site-packages/holoviews/ipython/display_hooks.py:248, in display(obj, raw_output, **kwargs)
    246 elif isinstance(obj, (CompositeOverlay, ViewableElement)):
    247     with option_state(obj):
--> 248         output = element_display(obj)
    249 elif isinstance(obj, (Layout, NdLayout, AdjointLayout)):
    250     with option_state(obj):

File ~/mambaforge/envs/nctoolkit/lib/python3.11/site-packages/holoviews/ipython/display_hooks.py:142, in display_hook.<locals>.wrapped(element)
    140 try:
    141     max_frames = OutputSettings.options['max_frames']
--> 142     mimebundle = fn(element, max_frames=max_frames)
    143     if mimebundle is None:
    144         return {}, {}

File ~/mambaforge/envs/nctoolkit/lib/python3.11/site-packages/holoviews/ipython/display_hooks.py:188, in element_display(element, max_frames)
    185 if type(element) not in Store.registry[backend]:
    186     return None
--> 188 return render(element)

File ~/mambaforge/envs/nctoolkit/lib/python3.11/site-packages/holoviews/ipython/display_hooks.py:69, in render(obj, **kwargs)
     66 if renderer.fig == 'pdf':
     67     renderer = renderer.instance(fig='png')
---> 69 return renderer.components(obj, **kwargs)

File ~/mambaforge/envs/nctoolkit/lib/python3.11/site-packages/holoviews/plotting/renderer.py:399, in Renderer.components(self, obj, fmt, comm, **kwargs)
    396 embed = (not (dynamic or streams or self.widget_mode == 'live') or config.embed)
    398 if embed or config.comms == 'default':
--> 399     return self._render_panel(plot, embed, comm)
    400 return self._render_ipywidget(plot)

File ~/mambaforge/envs/nctoolkit/lib/python3.11/site-packages/holoviews/plotting/renderer.py:406, in Renderer._render_panel(self, plot, embed, comm)
    404 doc = Document()
    405 with config.set(embed=embed):
--> 406     model = plot.layout._render_model(doc, comm)
    407 if embed:
    408     return render_model(model, comm)

File ~/mambaforge/envs/nctoolkit/lib/python3.11/site-packages/panel/viewable.py:736, in Viewable._render_model(self, doc, comm)
    734 if comm is None:
    735     comm = state._comm_manager.get_server_comm()
--> 736 model = self.get_root(doc, comm)
    738 if self._design and self._design.theme.bokeh_theme:
    739     doc.theme = self._design.theme.bokeh_theme

File ~/mambaforge/envs/nctoolkit/lib/python3.11/site-packages/panel/layout/base.py:289, in Panel.get_root(self, doc, comm, preprocess)
    285 def get_root(
    286     self, doc: Optional[Document] = None, comm: Optional[Comm] = None,
    287     preprocess: bool = True
    288 ) -> Model:
--> 289     root = super().get_root(doc, comm, preprocess)
    290     # ALERT: Find a better way to handle this
    291     if hasattr(root, 'styles') and 'overflow-x' in root.styles:

File ~/mambaforge/envs/nctoolkit/lib/python3.11/site-packages/panel/viewable.py:658, in Renderable.get_root(self, doc, comm, preprocess)
    656 wrapper = self._design._wrapper(self)
    657 if wrapper is self:
--> 658     root = self._get_model(doc, comm=comm)
    659     if preprocess:
    660         self._preprocess(root)

File ~/mambaforge/envs/nctoolkit/lib/python3.11/site-packages/panel/layout/base.py:173, in Panel._get_model(self, doc, root, parent, comm)
    171 root = root or model
    172 self._models[root.ref['id']] = (model, parent)
--> 173 objects, _ = self._get_objects(model, [], doc, root, comm)
    174 props = self._get_properties(doc)
    175 props[self._property_mapping['objects']] = objects

File ~/mambaforge/envs/nctoolkit/lib/python3.11/site-packages/panel/layout/base.py:155, in Panel._get_objects(self, model, old_objects, doc, root, comm)
    153 else:
    154     try:
--> 155         child = pane._get_model(doc, root, model, comm)
    156     except RerenderError as e:
    157         if e.layout is not None and e.layout is not self:

File ~/mambaforge/envs/nctoolkit/lib/python3.11/site-packages/panel/pane/holoviews.py:411, in HoloViews._get_model(self, doc, root, parent, comm)
    409     plot = self.object
    410 else:
--> 411     plot = self._render(doc, comm, root)
    413 plot.pane = self
    414 backend = plot.renderer.backend

File ~/mambaforge/envs/nctoolkit/lib/python3.11/site-packages/panel/pane/holoviews.py:506, in HoloViews._render(self, doc, comm, root)
    503     if comm:
    504         kwargs['comm'] = comm
--> 506 return renderer.get_plot(self.object, **kwargs)

File ~/mambaforge/envs/nctoolkit/lib/python3.11/site-packages/holoviews/plotting/bokeh/renderer.py:70, in BokehRenderer.get_plot(self_or_cls, obj, doc, renderer, **kwargs)
     63 @bothmethod
     64 def get_plot(self_or_cls, obj, doc=None, renderer=None, **kwargs):
     65     """
     66     Given a HoloViews Viewable return a corresponding plot instance.
     67     Allows supplying a document attach the plot to, useful when
     68     combining the bokeh model with another plot.
     69     """
---> 70     plot = super().get_plot(obj, doc, renderer, **kwargs)
     71     if plot.document is None:
     72         plot.document = Document() if self_or_cls.notebook_context else curdoc()

File ~/mambaforge/envs/nctoolkit/lib/python3.11/site-packages/holoviews/plotting/renderer.py:241, in Renderer.get_plot(self_or_cls, obj, doc, renderer, comm, **kwargs)
    238     defaults = [kd.default for kd in plot.dimensions]
    239     init_key = tuple(v if d is None else d for v, d in
    240                      zip(plot.keys[0], defaults))
--> 241     plot.update(init_key)
    242 else:
    243     plot = obj

File ~/mambaforge/envs/nctoolkit/lib/python3.11/site-packages/holoviews/plotting/plot.py:936, in DimensionedPlot.update(self, key)
    934 def update(self, key):
    935     if len(self) == 1 and ((key == 0) or (key == self.keys[0])) and not self.drawn:
--> 936         return self.initialize_plot()
    937     item = self.__getitem__(key)
    938     self.traverse(lambda x: setattr(x, '_updated', True))

File ~/mambaforge/envs/nctoolkit/lib/python3.11/site-packages/holoviews/plotting/bokeh/element.py:1527, in ElementPlot.initialize_plot(self, ranges, plot, plots, source)
   1525 if self.autorange:
   1526     self._setup_autorange()
-> 1527 self._init_glyphs(plot, element, ranges, source)
   1528 if not self.overlaid:
   1529     self._update_plot(key, plot, style_element)

File ~/mambaforge/envs/nctoolkit/lib/python3.11/site-packages/holoviews/plotting/bokeh/element.py:1469, in ElementPlot._init_glyphs(self, plot, element, ranges, source)
   1467 else:
   1468     style = self.style[self.cyclic_index]
-> 1469     data, mapping, style = self.get_data(element, ranges, style)
   1470     current_id = element._plot_id
   1472 with abbreviated_exception():

File ~/mambaforge/envs/nctoolkit/lib/python3.11/site-packages/holoviews/plotting/bokeh/raster.py:114, in RasterPlot.get_data(self, element, ranges, style)
    112 if i > 2 and 'hover' not in self.handles:
    113     break
--> 114 img = element.dimension_values(i, flat=False)
    115 if img.dtype.kind == 'b':
    116     img = img.astype(np.int8)

File ~/mambaforge/envs/nctoolkit/lib/python3.11/site-packages/holoviews/core/data/__init__.py:199, in PipelineMeta.pipelined.<locals>.pipelined_fn(*args, **kwargs)
    196     inst._in_method = True
    198 try:
--> 199     result = method_fn(*args, **kwargs)
    200     if PipelineMeta.disable:
    201         return result

File ~/mambaforge/envs/nctoolkit/lib/python3.11/site-packages/holoviews/core/data/__init__.py:1093, in Dataset.dimension_values(self, dimension, expanded, flat)
   1077 """Return the values along the requested dimension.
   1078 
   1079 Args:
   (...)
   1090     NumPy array of values along the requested dimension
   1091 """
   1092 dim = self.get_dimension(dimension, strict=True)
-> 1093 values = self.interface.values(self, dim, expanded, flat)
   1094 if dim.nodata is not None:
   1095     # Ensure nodata applies to boolean data in py2
   1096     values = np.where(values==dim.nodata, np.NaN, values)

File ~/mambaforge/envs/nctoolkit/lib/python3.11/site-packages/holoviews/core/data/xarray.py:421, in XArrayInterface.values(cls, dataset, dim, expanded, flat, compute, keep_index)
    419         data = cupy.asnumpy(data)
    420     if not keep_index:
--> 421         data = cls.canonicalize(dataset, data, data_coords=data_coords,
    422                                 virtual_coords=virtual_coords)
    423     return data.T.flatten() if flat and not keep_index else data
    424 elif expanded:

File ~/mambaforge/envs/nctoolkit/lib/python3.11/site-packages/holoviews/core/data/grid.py:329, in GridInterface.canonicalize(cls, dataset, data, data_coords, virtual_coords)
    327         data = data.flatten()
    328     else:
--> 329         data = np.squeeze(data, axis=tuple(dropped))
    331 if not any(cls.irregular(dataset, d) for d in dataset.kdims):
    332     inds = [dims.index(kd.name) for kd in dataset.kdims]

File ~/mambaforge/envs/nctoolkit/lib/python3.11/site-packages/numpy/core/fromnumeric.py:1558, in squeeze(a, axis)
   1556     return squeeze()
   1557 else:
-> 1558     return squeeze(axis=axis)

ValueError: cannot select an axis to squeeze out which has size not equal to one

Expected behavior
Reproduce documentation plot.

Desktop (please complete the following information):

  • OS: macOS
  • Browser Chrome

Additional context
Add any other context about the problem here.

conda list
# packages in environment at /Users/mattia/mambaforge/envs/nctoolkit:
#
# Name                    Version                   Build  Channel
anyio                     3.7.0              pyhd8ed1ab_1    conda-forge
appnope                   0.1.3              pyhd8ed1ab_0    conda-forge
argon2-cffi               21.3.0             pyhd8ed1ab_0    conda-forge
argon2-cffi-bindings      21.2.0          py311h5547dcb_3    conda-forge
asttokens                 2.2.1              pyhd8ed1ab_0    conda-forge
async-lru                 2.0.2              pyhd8ed1ab_0    conda-forge
attrs                     23.1.0             pyh71513ae_1    conda-forge
babel                     2.12.1             pyhd8ed1ab_1    conda-forge
backcall                  0.2.0              pyh9f0ad1d_0    conda-forge
backports                 1.0                pyhd8ed1ab_3    conda-forge
backports.functools_lru_cache 1.6.4              pyhd8ed1ab_0    conda-forge
beautifulsoup4            4.12.2             pyha770c72_0    conda-forge
bleach                    6.0.0              pyhd8ed1ab_0    conda-forge
blosc                     1.21.4               heccf04b_0    conda-forge
bokeh                     3.1.1              pyhd8ed1ab_0    conda-forge
brotli                    1.0.9                hb7f2c08_8    conda-forge
brotli-bin                1.0.9                hb7f2c08_8    conda-forge
bzip2                     1.0.8                h0d85af4_4    conda-forge
c-ares                    1.19.1               h0dc2134_0    conda-forge
ca-certificates           2023.5.7             h8857fd0_0    conda-forge
cairo                     1.16.0            h09dd18c_1016    conda-forge
cartopy                   0.21.1          py311hb21c73c_1    conda-forge
cdo                       2.2.0                h9d92bdb_4    conda-forge
certifi                   2023.5.7           pyhd8ed1ab_0    conda-forge
cffi                      1.15.1          py311ha86e640_3    conda-forge
cftime                    1.6.2           py311hd5badaa_1    conda-forge
charset-normalizer        3.1.0              pyhd8ed1ab_0    conda-forge
colorama                  0.4.6              pyhd8ed1ab_0    conda-forge
colorcet                  3.0.1              pyhd8ed1ab_0    conda-forge
comm                      0.1.3              pyhd8ed1ab_0    conda-forge
contourpy                 1.1.0           py311h5fe6e05_0    conda-forge
curl                      8.1.2                hbee3ae8_0    conda-forge
cycler                    0.11.0             pyhd8ed1ab_0    conda-forge
debugpy                   1.6.7           py311h814d153_0    conda-forge
decorator                 5.1.1              pyhd8ed1ab_0    conda-forge
defusedxml                0.7.1              pyhd8ed1ab_0    conda-forge
dill                      0.3.6              pyhd8ed1ab_1    conda-forge
eccodes                   2.30.2               hecd1f2b_0    conda-forge
entrypoints               0.4                pyhd8ed1ab_0    conda-forge
esmf                      8.4.2           mpi_mpich_h39d0f2c_100    conda-forge
exceptiongroup            1.1.1              pyhd8ed1ab_0    conda-forge
executing                 1.2.0              pyhd8ed1ab_0    conda-forge
expat                     2.5.0                hf0c8a7f_1    conda-forge
fftw                      3.3.10          nompi_h4fa670e_108    conda-forge
findlibs                  0.0.5              pyhd8ed1ab_0    conda-forge
flit-core                 3.9.0              pyhd8ed1ab_0    conda-forge
font-ttf-dejavu-sans-mono 2.37                 hab24e00_0    conda-forge
font-ttf-inconsolata      3.000                h77eed37_0    conda-forge
font-ttf-source-code-pro  2.038                h77eed37_0    conda-forge
font-ttf-ubuntu           0.83                 hab24e00_0    conda-forge
fontconfig                2.14.2               h5bb23bf_0    conda-forge
fonts-conda-ecosystem     1                             0    conda-forge
fonts-conda-forge         1                             0    conda-forge
fonttools                 4.40.0          py311h2725bcf_0    conda-forge
freetype                  2.12.1               h3f81eb7_1    conda-forge
fribidi                   1.0.10               hbcb3906_0    conda-forge
geos                      3.11.2               hf0c8a7f_0    conda-forge
gettext                   0.21.1               h8a4c099_0    conda-forge
graphite2                 1.3.13            h2e338ed_1001    conda-forge
gsl                       2.7                  h93259b0_0    conda-forge
harfbuzz                  7.3.0                h413ba03_0    conda-forge
hdf4                      4.2.15               h9804679_6    conda-forge
hdf5                      1.14.0          mpi_mpich_h18663c6_3    conda-forge
holoviews                 1.16.2             pyhd8ed1ab_0    conda-forge
hvplot                    0.8.4              pyhd8ed1ab_1    conda-forge
icu                       72.1                 h7336db1_0    conda-forge
idna                      3.4                pyhd8ed1ab_0    conda-forge
importlib-metadata        6.7.0              pyha770c72_0    conda-forge
importlib_metadata        6.7.0                hd8ed1ab_0    conda-forge
importlib_resources       5.12.0             pyhd8ed1ab_0    conda-forge
ipykernel                 6.23.1             pyh736e0ef_0    conda-forge
ipython                   8.14.0             pyhd1c38e8_0    conda-forge
jasper                    4.0.0                h794afb9_1    conda-forge
jedi                      0.18.2             pyhd8ed1ab_0    conda-forge
jinja2                    3.1.2              pyhd8ed1ab_1    conda-forge
json5                     0.9.5              pyh9f0ad1d_0    conda-forge
jsonschema                4.17.3             pyhd8ed1ab_0    conda-forge
jupyter-lsp               2.2.0              pyhd8ed1ab_0    conda-forge
jupyter_client            8.2.0              pyhd8ed1ab_0    conda-forge
jupyter_core              5.3.1           py311h6eed73b_0    conda-forge
jupyter_events            0.6.3              pyhd8ed1ab_0    conda-forge
jupyter_server            2.6.0              pyhd8ed1ab_0    conda-forge
jupyter_server_terminals  0.4.4              pyhd8ed1ab_1    conda-forge
jupyterlab                4.0.2              pyhd8ed1ab_0    conda-forge
jupyterlab_pygments       0.2.2              pyhd8ed1ab_0    conda-forge
jupyterlab_server         2.23.0             pyhd8ed1ab_0    conda-forge
kiwisolver                1.4.4           py311hd2070f0_1    conda-forge
krb5                      1.20.1               h049b76e_0    conda-forge
lcms2                     2.15                 h2dcdeff_1    conda-forge
lerc                      4.0.0                hb486fe8_0    conda-forge
libaec                    1.0.6                hf0c8a7f_1    conda-forge
libblas                   3.9.0           17_osx64_openblas    conda-forge
libbrotlicommon           1.0.9                hb7f2c08_8    conda-forge
libbrotlidec              1.0.9                hb7f2c08_8    conda-forge
libbrotlienc              1.0.9                hb7f2c08_8    conda-forge
libcblas                  3.9.0           17_osx64_openblas    conda-forge
libcurl                   8.1.2                hbee3ae8_0    conda-forge
libcxx                    16.0.6               hd57cbcb_0    conda-forge
libdeflate                1.18                 hac1461d_0    conda-forge
libedit                   3.1.20191231         h0678c8f_2    conda-forge
libev                     4.33                 haf1e3a3_1    conda-forge
libexpat                  2.5.0                hf0c8a7f_1    conda-forge
libffi                    3.4.2                h0d85af4_5    conda-forge
libgfortran               5.0.0           11_3_0_h97931a8_31    conda-forge
libgfortran5              12.2.0              he409387_31    conda-forge
libglib                   2.76.3               hc62aa5d_0    conda-forge
libiconv                  1.17                 hac89ed1_0    conda-forge
libjpeg-turbo             2.1.5.1              hb7f2c08_0    conda-forge
liblapack                 3.9.0           17_osx64_openblas    conda-forge
libnetcdf                 4.9.2           mpi_mpich_h4b56550_5    conda-forge
libnghttp2                1.52.0               he2ab024_0    conda-forge
libopenblas               0.3.23          openmp_h429af6e_0    conda-forge
libpng                    1.6.39               ha978bb4_0    conda-forge
libsodium                 1.0.18               hbcb3906_1    conda-forge
libsqlite                 3.42.0               h58db7d2_0    conda-forge
libssh2                   1.11.0               hd019ec5_0    conda-forge
libtiff                   4.5.1                hf955e92_0    conda-forge
libuuid                   2.38.1               hb7f2c08_0    conda-forge
libwebp-base              1.3.0                hb7f2c08_0    conda-forge
libxcb                    1.15                 hb7f2c08_0    conda-forge
libxml2                   2.11.4               hd95e348_0    conda-forge
libzip                    1.9.2                h6db710c_1    conda-forge
libzlib                   1.2.13               h8a1eda9_5    conda-forge
linkify-it-py             2.0.0              pyhd8ed1ab_0    conda-forge
llvm-openmp               16.0.6               hff08bdf_0    conda-forge
lz4-c                     1.9.4                hf0c8a7f_0    conda-forge
magics                    4.13.0               hb1c45c1_5    conda-forge
magics-python             1.5.8              pyhd8ed1ab_1    conda-forge
markdown                  3.4.3              pyhd8ed1ab_0    conda-forge
markdown-it-py            2.2.0              pyhd8ed1ab_0    conda-forge
markupsafe                2.1.3           py311h2725bcf_0    conda-forge
matplotlib-base           3.7.1           py311h2bf763f_0    conda-forge
matplotlib-inline         0.1.6              pyhd8ed1ab_0    conda-forge
mdit-py-plugins           0.4.0              pyhd8ed1ab_0    conda-forge
mdurl                     0.1.0              pyhd8ed1ab_0    conda-forge
metpy                     1.5.0              pyhd8ed1ab_0    conda-forge
mistune                   3.0.0              pyhd8ed1ab_0    conda-forge
mpi                       1.0                       mpich    conda-forge
mpich                     4.1.1              hd33e60e_100    conda-forge
multiprocess              0.70.14         py311h5547dcb_3    conda-forge
munkres                   1.1.4              pyh9f0ad1d_0    conda-forge
nbclient                  0.8.0              pyhd8ed1ab_0    conda-forge
nbconvert-core            7.6.0              pyhd8ed1ab_0    conda-forge
nbformat                  5.9.0              pyhd8ed1ab_0    conda-forge
nco                       5.1.6                h0317220_0    conda-forge
ncplot                    0.3.4           py311h9bdd199_0    conda-forge
nctoolkit                 0.9.4                     dev_0    <develop>
ncurses                   6.4                  hf0c8a7f_0    conda-forge
nest-asyncio              1.5.6              pyhd8ed1ab_0    conda-forge
netcdf-fortran            4.6.1           mpi_mpich_h2786e36_0    conda-forge
netcdf4                   1.6.4           nompi_py311h6222480_100    conda-forge
notebook-shim             0.2.3              pyhd8ed1ab_0    conda-forge
numpy                     1.25.0          py311hc44ba51_0    conda-forge
openjpeg                  2.5.0                h13ac156_2    conda-forge
openssl                   3.1.1                h8a1eda9_1    conda-forge
overrides                 7.3.1              pyhd8ed1ab_0    conda-forge
packaging                 23.1               pyhd8ed1ab_0    conda-forge
pandas                    2.0.2           py311hab14417_0    conda-forge
pandocfilters             1.5.0              pyhd8ed1ab_0    conda-forge
panel                     1.1.0              pyhd8ed1ab_2    conda-forge
pango                     1.50.14              hbce5e75_1    conda-forge
parallelio                2.5.10          mpi_mpich_hda3997c_102    conda-forge
param                     1.13.0             pyh1a96a4e_0    conda-forge
parso                     0.8.3              pyhd8ed1ab_0    conda-forge
pcre2                     10.40                h1c4e4bc_0    conda-forge
pexpect                   4.8.0              pyh1a96a4e_2    conda-forge
pickleshare               0.7.5                   py_1003    conda-forge
pillow                    9.5.0           py311h7cb0e2d_1    conda-forge
pint                      0.22               pyhd8ed1ab_1    conda-forge
pip                       23.1.2             pyhd8ed1ab_0    conda-forge
pixman                    0.40.0               hbcb3906_0    conda-forge
pkgutil-resolve-name      1.3.10             pyhd8ed1ab_0    conda-forge
platformdirs              3.6.0              pyhd8ed1ab_0    conda-forge
pooch                     1.7.0              pyha770c72_3    conda-forge
proj                      9.2.1                hc8d59c9_0    conda-forge
prometheus_client         0.17.0             pyhd8ed1ab_0    conda-forge
prompt-toolkit            3.0.38             pyha770c72_0    conda-forge
prompt_toolkit            3.0.38               hd8ed1ab_0    conda-forge
psutil                    5.9.5           py311h5547dcb_0    conda-forge
pthread-stubs             0.4               hc929b4f_1001    conda-forge
ptyprocess                0.7.0              pyhd3deb0d_0    conda-forge
pure_eval                 0.2.2              pyhd8ed1ab_0    conda-forge
pycparser                 2.21               pyhd8ed1ab_0    conda-forge
pyct                      0.4.6                      py_0    conda-forge
pyct-core                 0.4.6                      py_0    conda-forge
pygments                  2.15.1             pyhd8ed1ab_0    conda-forge
pyobjc-core               9.2             py311hf110eff_0    conda-forge
pyobjc-framework-cocoa    9.2             py311hf110eff_0    conda-forge
pyparsing                 3.1.0              pyhd8ed1ab_0    conda-forge
pyproj                    3.6.0           py311h854a015_1    conda-forge
pyrsistent                0.19.3          py311h5547dcb_0    conda-forge
pyshp                     2.3.1              pyhd8ed1ab_0    conda-forge
pysocks                   1.7.1              pyha2e5f31_6    conda-forge
python                    3.11.4          h30d4d87_0_cpython    conda-forge
python-dateutil           2.8.2              pyhd8ed1ab_0    conda-forge
python-fastjsonschema     2.17.1             pyhd8ed1ab_0    conda-forge
python-json-logger        2.0.7              pyhd8ed1ab_0    conda-forge
python-tzdata             2023.3             pyhd8ed1ab_0    conda-forge
python_abi                3.11                    3_cp311    conda-forge
pytz                      2023.3             pyhd8ed1ab_0    conda-forge
pyviz_comms               2.3.2              pyhd8ed1ab_0    conda-forge
pyyaml                    6.0             py311h5547dcb_5    conda-forge
pyzmq                     25.1.0          py311h5dacc12_0    conda-forge
readline                  8.2                  h9e318b2_1    conda-forge
requests                  2.31.0             pyhd8ed1ab_0    conda-forge
rfc3339-validator         0.1.4              pyhd8ed1ab_0    conda-forge
rfc3986-validator         0.1.1              pyh9f0ad1d_0    conda-forge
scipy                     1.10.1          py311h16c3c4d_3    conda-forge
send2trash                1.8.2              pyhd1c38e8_0    conda-forge
setuptools                67.7.2             pyhd8ed1ab_0    conda-forge
shapely                   2.0.1           py311heb7bb94_1    conda-forge
simplejson                3.19.1          py311h5547dcb_0    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
snappy                    1.1.10               h225ccf5_0    conda-forge
sniffio                   1.3.0              pyhd8ed1ab_0    conda-forge
soupsieve                 2.3.2.post1        pyhd8ed1ab_0    conda-forge
sqlite                    3.42.0               h2b0dec6_0    conda-forge
stack_data                0.6.2              pyhd8ed1ab_0    conda-forge
tempest-remap             2.2.0                he127c65_0    conda-forge
terminado                 0.17.1             pyhd1c38e8_0    conda-forge
tinycss2                  1.2.1              pyhd8ed1ab_0    conda-forge
tk                        8.6.12               h5dbffcc_0    conda-forge
tomli                     2.0.1              pyhd8ed1ab_0    conda-forge
tornado                   6.3.2           py311h2725bcf_0    conda-forge
tqdm                      4.65.0             pyhd8ed1ab_1    conda-forge
traitlets                 5.9.0              pyhd8ed1ab_0    conda-forge
typing-extensions         4.6.3                hd8ed1ab_0    conda-forge
typing_extensions         4.6.3              pyha770c72_0    conda-forge
typing_utils              0.1.0              pyhd8ed1ab_0    conda-forge
tzdata                    2023c                h71feb2d_0    conda-forge
uc-micro-py               1.0.1              pyhd8ed1ab_0    conda-forge
udunits2                  2.2.28               h06ef574_0    conda-forge
urllib3                   2.0.3              pyhd8ed1ab_0    conda-forge
wcwidth                   0.2.6              pyhd8ed1ab_0    conda-forge
webencodings              0.5.1                      py_1    conda-forge
websocket-client          1.6.0              pyhd8ed1ab_0    conda-forge
wheel                     0.40.0             pyhd8ed1ab_0    conda-forge
xarray                    2023.5.0           pyhd8ed1ab_0    conda-forge
xorg-libxau               1.0.11               h0dc2134_0    conda-forge
xorg-libxdmcp             1.1.3                h35c211d_0    conda-forge
xyzservices               2023.5.0           pyhd8ed1ab_1    conda-forge
xz                        5.2.6                h775f41a_0    conda-forge
yaml                      0.2.5                h0d85af4_2    conda-forge
zeromq                    4.3.4                he49afe7_1    conda-forge
zipp                      3.15.0             pyhd8ed1ab_0    conda-forge
zlib                      1.2.13               h8a1eda9_5    conda-forge
zstd                      1.5.2                hbc0c0cd_6    conda-forge

openjournals/joss-reviews#5494

Hi @malmans2. I am able to reproduce this. I've pinned it down to an upgrade to numpy 3 days ago breaking something within hvplot. Downgrading numpy to 1.24.3 seems to fix the problem.

I'll put together a reproducible example and raise an issue over at hvplot. It seems to only apply to cases with multiple depths, and the numpy change appears to be changing the behaviour of xarray which is causing the problem in hvplot.

Did you end up opening an issue? If yes, I would add the reference here.

I thought I had closed this off. My bad. This should now work fine.

Updates to panel broke ncplot in web browsers in May, and my "fixes" meant files like this weren't plotting. But it should be fine in ncplot v0.3.5.

This is now working, so I'm closing the issue.

A couple of things I noticed tho:

  • There's a few xarray's deprecation warnings:
Warning: xarray could not decode times!
Calling int on a single element Series is deprecated and will raise a TypeError in the future. Use int(ser.iloc[0]) instead
Calling int on a single element Series is deprecated and will raise a TypeError in the future. Use int(ser.iloc[0]) instead
  • nc.open_data("~/Downloads/tas_day_GFDL-CM4_historical_r1i1p1f1_gr1_18500101-18691231.nc", checks = False) did not work, I had to provide the absolute path. I suggest to add support for it.

Thanks. I've just raised an issue. This only impacts macOS, and I've been meaning to fix it for a while. #92

I'll double check the deprecation warnings. Last time I looked there was nothing within nctoolkit itself throwing the warnings, it was purely hvplot. So little that could be done in nctoolkit itself.