home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 567035590

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
567035590 MDU6SXNzdWU1NjcwMzU1OTA= 3777 test_open_mfdataset_list_attr is ran even when dask is not available 490531 closed 0     5 2020-02-18T17:08:23Z 2020-02-19T18:24:43Z 2020-02-19T18:24:43Z CONTRIBUTOR      

I’m currently packaging xarray (0.15.0) for ArchLinux, and I’m running the test suite with all our currently available packages (in addition to python-numpy, python-pandas and python-pytest of course):

python-netcdf4
python-scipy
python-cftime
python-bottleneck
python-matplotlib
python-seaborn
python-pint

I was greatly impressed at the automatic selection of tests depending on what is available on the system. :) I’m only seeing 10 tests failures (10 failed, 8057 passed, 1384 skipped, 518 xfailed, 277 xpassed, 5268 warnings), and amongst them one is happening because a test requiring dask is run even without it being installed: test_open_mfdataset_list_attr.

Corresponding test output: ``` ___ testopen_mfdataset_list_attr _____

@requires_netCDF4
def test_open_mfdataset_list_attr():
    """
    Case when an attribute of type list differs across the multiple files
    """
    from netCDF4 import Dataset

    with create_tmp_files(2) as nfiles:
        for i in range(2):
            f = Dataset(nfiles[i], "w") 
            f.createDimension("x", 3)
            vlvar = f.createVariable("test_var", np.int32, ("x"))
            # here create an attribute as a list 
            vlvar.test_attr = [f"string a {i}", f"string b {i}"]
            vlvar[:] = np.arange(3)
            f.close()
        ds1 = open_dataset(nfiles[0])
        ds2 = open_dataset(nfiles[1])
        original = xr.concat([ds1, ds2], dim="x")
      with xr.open_mfdataset(
            [nfiles[0], nfiles[1]], combine="nested", concat_dim="x"
        ) as actual:

xarray/tests/test_backends.py:2561:


xarray/backends/api.py:908: in open_mfdataset datasets = [open_(p, open_kwargs) for p in paths] xarray/backends/api.py:908: in <listcomp> datasets = [open_(p, open_kwargs) for p in paths] xarray/backends/api.py:538: in open_dataset ds = maybe_decode_store(store)


store = <xarray.backends.netCDF4_.NetCDF4DataStore object at 0x7f392aebc640> lock = False

def maybe_decode_store(store, lock=False):
    ds = conventions.decode_cf(
        store,
        mask_and_scale=mask_and_scale,
        decode_times=decode_times,
        concat_characters=concat_characters,
        decode_coords=decode_coords,
        drop_variables=drop_variables,
        use_cftime=use_cftime,
    )

    _protect_dataset_variables_inplace(ds, cache)

    if chunks is not None:
      from dask.base import tokenize

E ModuleNotFoundError: No module named 'dask'

xarray/backends/api.py:459: ModuleNotFoundError ``` I think this test should thus not be selected if dask is not installed. ;)

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/3777/reactions",
    "total_count": 1,
    "+1": 1,
    "-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
  • 5 rows from issue in issue_comments
Powered by Datasette · Queries took 0.706ms · About: xarray-datasette