Skip to content

opendap access fails only in ubuntu machines #7773

Closed

Description

@aragong

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

Details

Activity

  1. added
    needs triage
    on Apr 20, 2023
  2. dcherian commented on Apr 20, 2023

    @dcherian
    Contributor

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

  3. aragong commented on Apr 21, 2023

    @aragong
    Author

    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

  4. aragong commented on Apr 21, 2023

    @aragong
    Author

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

  5. mathause commented on Apr 24, 2023

    @mathause
    Collaborator

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

  6. aragong commented on Jun 12, 2023

    @aragong
    Author

    Please @mathause check this: Unidata/netcdf4-python#1246.

    I think xarray need to fix a dependency to work with opendap in new versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugneeds triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions