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

Xarray's open_mfdataset function does not work without dask: ValueError: unrecognized chunk manager dask - must be one of: [] #122

Open
ashwinvis opened this issue Oct 8, 2024 · 3 comments

Comments

@ashwinvis
Copy link
Member

Workaround: pip install dask

@ashwinvis ashwinvis changed the title Xarray's open_mfdataset function does not work: FAILED tests/test_mfdataset.py::test_xr_open_mfdataset - ValueError: unrecognized chunk manager dask - must be one of: [] Xarray's open_mfdataset function does not work: ValueError: unrecognized chunk manager dask - must be one of: [] Oct 8, 2024
@ashwinvis
Copy link
Member Author

For example see this test case tests/test_mfdataset.py::test_xr_open_mfdataset

@ashwinvis ashwinvis changed the title Xarray's open_mfdataset function does not work: ValueError: unrecognized chunk manager dask - must be one of: [] Xarray's open_mfdataset function does not work without dask: ValueError: unrecognized chunk manager dask - must be one of: [] Oct 8, 2024
@ashwinvis
Copy link
Member Author

>>> import pymech as pm
>>> pm.open_dataset("/tmp/channel3D_0.f00001")
<xarray.Dataset> Size: 15MB
Dimensions:   (z: 64, y: 64, x: 64)
Coordinates:
  * x         (x) float64 512B 0.0 0.05037 0.1603 0.3105 ... 6.123 6.233 6.283
  * y         (y) float64 512B -1.0 -0.9974 -0.9918 ... 0.9918 0.9974 1.0
  * z         (z) float64 512B 0.0 0.02518 0.08017 0.1553 ... 3.061 3.116 3.142
    time      float64 8B 0.2
Data variables:
    xmesh     (z, y, x) float64 2MB 0.0 0.05037 0.1603 ... 6.123 6.233 6.283
    ymesh     (z, y, x) float64 2MB -1.0 -1.0 -1.0 -1.0 -1.0 ... 1.0 1.0 1.0 1.0
    zmesh     (z, y, x) float64 2MB 0.0 0.0 0.0 0.0 ... 3.142 3.142 3.142 3.142
    ux        (z, y, x) float64 2MB 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0
    uy        (z, y, x) float64 2MB 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0
    uz        (z, y, x) float64 2MB 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0
    pressure  (z, y, x) float64 2MB 0.004913 0.0467 0.0195 ... 0.03768 0.0761
>>> ds = pm.open_dataset("/tmp/channel3D_0.f00001")
>>> import xarray as xr
>>> xr.open_dataset("/tmp/channel3D_0.f00001", engine="pymech")
<xarray.Dataset> Size: 15MB
Dimensions:   (z: 64, y: 64, x: 64)
Coordinates:
  * x         (x) float64 512B 0.0 0.05037 0.1603 0.3105 ... 6.123 6.233 6.283
  * y         (y) float64 512B -1.0 -0.9974 -0.9918 ... 0.9918 0.9974 1.0
  * z         (z) float64 512B 0.0 0.02518 0.08017 0.1553 ... 3.061 3.116 3.142
    time      float64 8B ...
Data variables:
    xmesh     (z, y, x) float64 2MB ...
    ymesh     (z, y, x) float64 2MB ...
    zmesh     (z, y, x) float64 2MB ...
    ux        (z, y, x) float64 2MB ...
    uy        (z, y, x) float64 2MB ...
    uz        (z, y, x) float64 2MB ...
    pressure  (z, y, x) float64 2MB ...
>>> xr.open_mfdataset("/tmp/channel3D_0.f00001", engine="pymech")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/avmo/Sources/snek5000/pymech/.nox/release-tests-dist_type-only-binary/lib/python3.9/site-packages/xarray/backends/api.py", line 1077, in open_mfdataset
    datasets = [open_(p, **open_kwargs) for p in paths]
  File "/home/avmo/Sources/snek5000/pymech/.nox/release-tests-dist_type-only-binary/lib/python3.9/site-packages/xarray/backends/api.py", line 1077, in <listcomp>
    datasets = [open_(p, **open_kwargs) for p in paths]
  File "/home/avmo/Sources/snek5000/pymech/.nox/release-tests-dist_type-only-binary/lib/python3.9/site-packages/xarray/backends/api.py", line 594, in open_dataset
    ds = _dataset_from_backend_dataset(
  File "/home/avmo/Sources/snek5000/pymech/.nox/release-tests-dist_type-only-binary/lib/python3.9/site-packages/xarray/backends/api.py", line 370, in _dataset_from_backend_dataset
    ds = _chunk_ds(
  File "/home/avmo/Sources/snek5000/pymech/.nox/release-tests-dist_type-only-binary/lib/python3.9/site-packages/xarray/backends/api.py", line 318, in _chunk_ds
    chunkmanager = guess_chunkmanager(chunked_array_type)
  File "/home/avmo/Sources/snek5000/pymech/.nox/release-tests-dist_type-only-binary/lib/python3.9/site-packages/xarray/namedarray/parallelcompat.py", line 117, in guess_chunkmanager
    raise ValueError(
ValueError: unrecognized chunk manager dask - must be one of: []

@ashwinvis
Copy link
Member Author

Further reading:

We need to check if this is an upstream issue or the way we implement pymech as a xarray backend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant