home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 811409317

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
811409317 MDU6SXNzdWU4MTE0MDkzMTc= 4925 OpenDAP Documentation Example failing with RunTimeError 3924836 closed 0     9 2021-02-18T19:52:24Z 2023-01-17T18:44:00Z 2023-01-17T18:44:00Z MEMBER      

What happened: Tried to follow http://xarray.pydata.org/en/stable/io.html#opendap with @wycheng-uw and ran into a massive traceback ending with RuntimeError: NetCDF: file not found

What you expected to happen: Expecting to successfully plot data as illustrated in documentation

Minimal Complete Verifiable Example:

python remote_data = xr.open_dataset("http://iridl.ldeo.columbia.edu/SOURCES/.OSU/.PRISM/.monthly/dods", decode_times=False) tmax = remote_data["tmax"][:500, ::3, ::3] tmax[0].plot()

Anything else we need to know?:

After digging through unresolved opendap issues (https://github.com/Unidata/netcdf4-python/issues/755, https://github.com/pydata/xarray/issues/3466, https://github.com/pydata/xarray/issues/4353)

https://github.com/pydata/xarray/issues/3580 provided the key workaround that netCDF4>1.5.1 seems to cause issues. Pinning netCDF4==1.5.1 is our current workaround. Not sure if this is specific to http://iridl.ldeo.columbia.edu/ or OpenDAP endpoints more generally...

Environment:

Output of <tt>xr.show_versions() </tt> INSTALLED VERSIONS ------------------ commit: None python: 3.7.8 | packaged by conda-forge | (default, Jul 31 2020, 02:37:09) [Clang 10.0.1 ] python-bits: 64 OS: Darwin OS-release: 20.3.0 machine: x86_64 processor: i386 byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: en_US.UTF-8 libhdf5: 1.10.6 libnetcdf: 4.7.4 xarray: 0.16.2 pandas: 1.2.2 numpy: 1.19.1 scipy: 1.5.3 netCDF4: 1.5.6 pydap: None h5netcdf: 0.8.1 h5py: 3.1.0 Nio: None zarr: None cftime: 1.4.1 nc_time_axis: None PseudoNetCDF: None rasterio: 1.1.7 cfgrib: None iris: None bottleneck: None dask: 2.30.0 distributed: 2.30.0 matplotlib: 3.3.4 cartopy: 0.18.0 seaborn: None numbagg: None pint: None setuptools: 49.6.0.post20210108 pip: 20.2.3 conda: installed pytest: 6.1.1 IPython: 7.20.0 sphinx: 3.2.1 None
Full Traceback ```pytb --------------------------------------------------------------------------- RuntimeError Traceback (most recent call last) <ipython-input-4-78116fdadd4b> in <module> ----> 1 tmax[0].plot() ~/miniconda3/envs/intake-stac-gui/lib/python3.7/site-packages/xarray/plot/plot.py in __call__(self, **kwargs) 444 445 def __call__(self, **kwargs): --> 446 return plot(self._da, **kwargs) 447 448 # we can't use functools.wraps here since that also modifies the name / qualname ~/miniconda3/envs/intake-stac-gui/lib/python3.7/site-packages/xarray/plot/plot.py in plot(darray, row, col, col_wrap, ax, hue, rtol, subplot_kws, **kwargs) 161 162 """ --> 163 darray = darray.squeeze().compute() 164 165 plot_dims = set(darray.dims) ~/miniconda3/envs/intake-stac-gui/lib/python3.7/site-packages/xarray/core/dataarray.py in compute(self, **kwargs) 891 """ 892 new = self.copy(deep=False) --> 893 return new.load(**kwargs) 894 895 def persist(self, **kwargs) -> "DataArray": ~/miniconda3/envs/intake-stac-gui/lib/python3.7/site-packages/xarray/core/dataarray.py in load(self, **kwargs) 865 dask.array.compute 866 """ --> 867 ds = self._to_temp_dataset().load(**kwargs) 868 new = self._from_temp_dataset(ds) 869 self._variable = new._variable ~/miniconda3/envs/intake-stac-gui/lib/python3.7/site-packages/xarray/core/dataset.py in load(self, **kwargs) 747 for k, v in self.variables.items(): 748 if k not in lazy_data: --> 749 v.load() 750 751 return self ~/miniconda3/envs/intake-stac-gui/lib/python3.7/site-packages/xarray/core/variable.py in load(self, **kwargs) 437 self._data = as_compatible_data(self._data.compute(**kwargs)) 438 elif not is_duck_array(self._data): --> 439 self._data = np.asarray(self._data) 440 return self 441 ~/miniconda3/envs/intake-stac-gui/lib/python3.7/site-packages/numpy/core/_asarray.py in asarray(a, dtype, order) 81 82 """ ---> 83 return array(a, dtype, copy=False, order=order) 84 85 ~/miniconda3/envs/intake-stac-gui/lib/python3.7/site-packages/xarray/core/indexing.py in __array__(self, dtype) 691 692 def __array__(self, dtype=None): --> 693 self._ensure_cached() 694 return np.asarray(self.array, dtype=dtype) 695 ~/miniconda3/envs/intake-stac-gui/lib/python3.7/site-packages/xarray/core/indexing.py in _ensure_cached(self) 688 def _ensure_cached(self): 689 if not isinstance(self.array, NumpyIndexingAdapter): --> 690 self.array = NumpyIndexingAdapter(np.asarray(self.array)) 691 692 def __array__(self, dtype=None): ~/miniconda3/envs/intake-stac-gui/lib/python3.7/site-packages/numpy/core/_asarray.py in asarray(a, dtype, order) 81 82 """ ---> 83 return array(a, dtype, copy=False, order=order) 84 85 ~/miniconda3/envs/intake-stac-gui/lib/python3.7/site-packages/xarray/core/indexing.py in __array__(self, dtype) 661 662 def __array__(self, dtype=None): --> 663 return np.asarray(self.array, dtype=dtype) 664 665 def __getitem__(self, key): ~/miniconda3/envs/intake-stac-gui/lib/python3.7/site-packages/numpy/core/_asarray.py in asarray(a, dtype, order) 81 82 """ ---> 83 return array(a, dtype, copy=False, order=order) 84 85 ~/miniconda3/envs/intake-stac-gui/lib/python3.7/site-packages/xarray/core/indexing.py in __array__(self, dtype) 566 def __array__(self, dtype=None): 567 array = as_indexable(self.array) --> 568 return np.asarray(array[self.key], dtype=None) 569 570 def transpose(self, order): ~/miniconda3/envs/intake-stac-gui/lib/python3.7/site-packages/numpy/core/_asarray.py in asarray(a, dtype, order) 81 82 """ ---> 83 return array(a, dtype, copy=False, order=order) 84 85 ~/miniconda3/envs/intake-stac-gui/lib/python3.7/site-packages/xarray/coding/variables.py in __array__(self, dtype) 68 69 def __array__(self, dtype=None): ---> 70 return self.func(self.array) 71 72 def __repr__(self): ~/miniconda3/envs/intake-stac-gui/lib/python3.7/site-packages/xarray/coding/variables.py in _scale_offset_decoding(data, scale_factor, add_offset, dtype) 216 217 def _scale_offset_decoding(data, scale_factor, add_offset, dtype): --> 218 data = np.array(data, dtype=dtype, copy=True) 219 if scale_factor is not None: 220 data *= scale_factor ~/miniconda3/envs/intake-stac-gui/lib/python3.7/site-packages/xarray/coding/variables.py in __array__(self, dtype) 68 69 def __array__(self, dtype=None): ---> 70 return self.func(self.array) 71 72 def __repr__(self): ~/miniconda3/envs/intake-stac-gui/lib/python3.7/site-packages/xarray/coding/variables.py in _apply_mask(data, encoded_fill_values, decoded_fill_value, dtype) 136 ) -> np.ndarray: 137 """Mask all matching values in a NumPy arrays.""" --> 138 data = np.asarray(data, dtype=dtype) 139 condition = False 140 for fv in encoded_fill_values: ~/miniconda3/envs/intake-stac-gui/lib/python3.7/site-packages/numpy/core/_asarray.py in asarray(a, dtype, order) 81 82 """ ---> 83 return array(a, dtype, copy=False, order=order) 84 85 ~/miniconda3/envs/intake-stac-gui/lib/python3.7/site-packages/xarray/core/indexing.py in __array__(self, dtype) 566 def __array__(self, dtype=None): 567 array = as_indexable(self.array) --> 568 return np.asarray(array[self.key], dtype=None) 569 570 def transpose(self, order): ~/miniconda3/envs/intake-stac-gui/lib/python3.7/site-packages/xarray/backends/netCDF4_.py in __getitem__(self, key) 71 def __getitem__(self, key): 72 return indexing.explicit_indexing_adapter( ---> 73 key, self.shape, indexing.IndexingSupport.OUTER, self._getitem 74 ) 75 ~/miniconda3/envs/intake-stac-gui/lib/python3.7/site-packages/xarray/core/indexing.py in explicit_indexing_adapter(key, shape, indexing_support, raw_indexing_method) 851 """ 852 raw_key, numpy_indices = decompose_indexer(key, shape, indexing_support) --> 853 result = raw_indexing_method(raw_key.tuple) 854 if numpy_indices.tuple: 855 # index the loaded np.ndarray ~/miniconda3/envs/intake-stac-gui/lib/python3.7/site-packages/xarray/backends/netCDF4_.py in _getitem(self, key) 83 with self.datastore.lock: 84 original_array = self.get_array(needs_lock=False) ---> 85 array = getitem(original_array, key) 86 except IndexError: 87 # Catch IndexError in netCDF4 and return a more informative ~/miniconda3/envs/intake-stac-gui/lib/python3.7/site-packages/xarray/backends/common.py in robust_getitem(array, key, catch, max_retries, initial_delay) 50 for n in range(max_retries + 1): 51 try: ---> 52 return array[key] 53 except catch: 54 if n == max_retries: src/netCDF4/_netCDF4.pyx in netCDF4._netCDF4.Variable.__getitem__() src/netCDF4/_netCDF4.pyx in netCDF4._netCDF4.Variable._get() src/netCDF4/_netCDF4.pyx in netCDF4._netCDF4._ensure_nc_success() RuntimeError: NetCDF: file not found ```
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/4925/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

  • 1 row from issues_id in issues_labels
  • 9 rows from issue in issue_comments
Powered by Datasette · Queries took 0.858ms · About: xarray-datasette