Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opendap access fails only in ubuntu machines #7773

Closed
1 of 4 tasks
aragong opened this issue Apr 20, 2023 · 5 comments
Closed
1 of 4 tasks

opendap access fails only in ubuntu machines #7773

aragong opened this issue Apr 20, 2023 · 5 comments
Labels
bug needs triage Issue that has not been reviewed by xarray team member

Comments

@aragong
Copy link

aragong commented Apr 20, 2023

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:
image

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-dotenv

Public 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

Environment

@aragong aragong added bug needs triage Issue that has not been reviewed by xarray team member labels Apr 20, 2023
@dcherian
Copy link
Contributor

Can you try with netcdf4.Dataset to remove xarray from the equation

@aragong
Copy link
Author

aragong commented Apr 21, 2023

Sure @dcherian!

I add a simple test as you recommend, and all ubuntu tests crashed.

def test_only_netCDF4_access():
    dataset = Dataset(
        "https://ihthredds.ihcantabria.com/thredds/dodsC/Bathymetry/Global/Gebco_2020.nc"
    )
    assert isinstance(dataset, Dataset)

And also I run this code in Googlecolab. Same problem... seems that something happend with netCDF4....

image

@aragong
Copy link
Author

aragong commented Apr 21, 2023

I open a new issue in netcdf github - Unidata/netcdf4-python#1246

@mathause
Copy link
Collaborator

I am closing this as an upstream issue - feel free to reopen if you disagree.

@aragong
Copy link
Author

aragong commented 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

abkfenris added a commit to xpublish-community/xpublish-opendap that referenced this issue May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug needs triage Issue that has not been reviewed by xarray team member
Projects
None yet
Development

No branches or pull requests

3 participants