yt-project / yt

Main yt repository
http://yt-project.org
Other
469 stars 280 forks source link

failing nosetests (Failed to decode variable 'time') #5047

Closed chrishavlin closed 1 week ago

chrishavlin commented 1 week ago

Both #5045 and #5046 failed the nose tests with unrelated failures:

Traceback (most recent call last):
  File "/home/fido/workspace/yt_py310_git/.venv/lib/python3.10/site-packages/nose/failure.py", line 39, in runTest
    raise self.exc_val.with_traceback(self.tb)
  File "/home/fido/workspace/yt_py310_git/.venv/lib/python3.10/site-packages/nose/loader.py", line 417, in loadTestsFromName
    module = self.importer.importFromPath(
  File "/home/fido/workspace/yt_py310_git/.venv/lib/python3.10/site-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/home/fido/workspace/yt_py310_git/.venv/lib/python3.10/site-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/usr/lib/python3.10/imp.py", line 235, in load_module
    return load_source(name, filename, file)
  File "/usr/lib/python3.10/imp.py", line 172, in load_source
    module = _load(spec)
  File "<frozen importlib._bootstrap>", line 719, in _load
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/fido/workspace/yt_py310_git/yt/frontends/cf_radial/tests/test_outputs.py", line 176, in <module>
    @requires_ds(cf)
  File "/home/fido/workspace/yt_py310_git/yt/utilities/answer_testing/framework.py", line 1094, in requires_ds
    condition = (big_data and not run_big_data) or not can_run_ds(ds_fn, file_check)
  File "/home/fido/workspace/yt_py310_git/yt/utilities/answer_testing/framework.py", line 315, in can_run_ds
    load(ds_fn)
  File "/home/fido/workspace/yt_py310_git/yt/_maintenance/deprecation.py", line 68, in inner
    return func(*args, **kwargs)
  File "/home/fido/workspace/yt_py310_git/yt/loaders.py", line 141, in load
    return cls(fn, *args, **kwargs)
  File "/home/fido/workspace/yt_py310_git/yt/frontends/cf_radial/data_structures.py", line 128, in __init__
    with self._handle(filename=filename) as xr_ds_handle:
  File "/usr/lib/python3.10/contextlib.py", line 135, in __enter__
    return next(self.gen)
  File "/home/fido/workspace/yt_py310_git/yt/frontends/cf_radial/data_structures.py", line 204, in _handle
    with xr.open_dataset(filename) as xrds:
  File "/home/fido/workspace/yt_py310_git/.venv/lib/python3.10/site-packages/xarray/backends/api.py", line 588, in open_dataset
    backend_ds = backend.open_dataset(
  File "/home/fido/workspace/yt_py310_git/.venv/lib/python3.10/site-packages/xarray/backends/netCDF4_.py", line 659, in open_dataset
    ds = store_entrypoint.open_dataset(
  File "/home/fido/workspace/yt_py310_git/.venv/lib/python3.10/site-packages/xarray/backends/store.py", line 46, in open_dataset
    vars, attrs, coord_names = conventions.decode_cf_variables(
  File "/home/fido/workspace/yt_py310_git/.venv/lib/python3.10/site-packages/xarray/conventions.py", line 461, in decode_cf_variables
    raise type(e)(f"Failed to decode variable {k!r}: {e}") from e
TypeError: Failed to decode variable 'time': cannot inherit frozen dataclass from a non-frozen one
chrishavlin commented 1 week ago

weirdly I was JUST looking at this exact error locally while writing a test for #5043 ... not entirely sure of its origin -- it's related to where the cf_radial frontend writes the gridded file that it creates during testing. but i think it's another confusing xarray/netcdf4/hdf/arm-pyart dependency resolution issue. and just now locally i re-created a fresh environment and the issue resolved, so I'm going to push up a PR that adjusts the xradar/arm-pyart pinning that might fix this.

chrishavlin commented 1 week ago

5048 did indeed fix it!