Repository navigation
Closed
Labels
Description
What happened?
I am having errors on opendap access (any of them):
import xarray as xr
url = "https://erddap.emodnet.eu/erddap/griddap/bathymetry_2022"
url = "https://ihthredds.ihcantabria.com/thredds/dodsC/Bathymetry/Global/Gebco_2020.nc"
ds = xr.open_dataset(url)The point is that only ocurrs when i deploy and test the code on an ubuntu-latest machine using (pyenv+pip), see summary of the action:

my dependencies are defined on pyproject.toml file like this:
dependencies = [
"geopandas",
"xarray",
"netCDF4",
"h5netcdf",
"scipy",
"pydap",
"zarr",
"fsspec",
"cftime",
"pooch",
"dask[complete]",
"ipykernel",
"matplotlib",
"owslib",
"shapely",
"geojson",
"pytest>=7",
"lxml",
"python-dotenv",
]However, If I use conda on wsl unbuntu 20.04 LTS with this environment.yml, works fine:
name: pyteseo-dev
channels:
- conda-forge
- defaults
dependencies:
- python>=3.7
- xarray
- dask
- netcdf4
- bottleneck
- ipykernel
- matplotlib
- geopandas
- owslib
- shapely
- geojson
- pytest>=7
- coverage
- flit
- black
- sphinx
- myst-nb
- sphinx-autoapi
- sphinx_rtd_theme
- pre_commit
- flake8
- pydap
- lxml
- scipy
- python-dotenvPublic repository here: pyTESEO
What did you expect to happen?
I expect to pass all tests
Minimal Complete Verifiable Example
import xarray as xr
url = "https://erddap.emodnet.eu/erddap/griddap/bathymetry_2022"
url = "https://ihthredds.ihcantabria.com/thredds/dodsC/Bathymetry/Global/Gebco_2020.nc"
ds = xr.open_dataset(url)MVCE confirmation
- Minimal example — the example is as focused as reasonably possible to demonstrate the underlying issue in xarray.
- Complete example — the example is self-contained, including all data and the text of any traceback.
- Verifiable example — the example copy & pastes into an IPython prompt or Binder notebook, returning the result.
- New issue — a search of GitHub Issues suggests this is not a duplicate.
Relevant log output
No response
Anything else we need to know?
No response
Activity
dcherian commentedon Apr 20, 2023
Can you try with
netcdf4.Datasetto remove xarray from the equationaragong commentedon Apr 21, 2023
Sure @dcherian!
I add a simple test as you recommend, and all ubuntu tests crashed.
And also I run this code in Googlecolab. Same problem... seems that something happend with netCDF4....
aragong commentedon Apr 21, 2023
I open a new issue in netcdf github - Unidata/netcdf4-python#1246
mathause commentedon Apr 24, 2023
I am closing this as an upstream issue - feel free to reopen if you disagree.
aragong commentedon Jun 12, 2023
Please @mathause check this: Unidata/netcdf4-python#1246.
I think xarray need to fix a dependency to work with opendap in new versions
Pin NetCDF4 to less than 1.6.0 in testing due to curl issues