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

Cannot import ndpyramid v0.3.1 with xarray v2024.10.0 #151

Closed
droumis opened this issue Nov 15, 2024 · 5 comments · Fixed by #152
Closed

Cannot import ndpyramid v0.3.1 with xarray v2024.10.0 #151

droumis opened this issue Nov 15, 2024 · 5 comments · Fixed by #152

Comments

@droumis
Copy link

droumis commented Nov 15, 2024

ndpyramid v0.3.1
xarray v2024.10.0

MRE: import ndpyramid

ImportError                               Traceback (most recent call last)
Cell In[7], line 1
----> 1 import ndpyramid

~/src/examples/multichannel_timeseries/envs/default/lib/python3.11/site-packages/ndpyramid/__init__.py:3      1 # flake8: noqa
----> 3 from .create import pyramid_create
      4 from .coarsen import pyramid_coarsen
      5 from .reproject import pyramid_reproject

~/src/examples/multichannel_timeseries/envs/default/lib/python3.11/site-packages/ndpyramid/create.py:5      1 from __future__ import annotations  # noqa: F401
      3 from typing import Callable
----> 5 import datatree as dt
      6 import xarray as xr
      8 from .utils import get_version, multiscales_template

~/src/examples/multichannel_timeseries/envs/default/lib/python3.11/site-packages/datatree/__init__.py:2
      1 # import public API
----> 2 from .datatree import DataTree
      3 from .extensions import register_datatree_accessor
      4 from .io import open_datatree

~/src/examples/multichannel_timeseries/envs/default/lib/python3.11/site-packages/datatree/datatree.py:33
     31 from xarray.core.merge import dataset_update_method
     32 from xarray.core.options import OPTIONS as XR_OPTS
---> 33 from xarray.core.utils import (
     34     Default,
     35     Frozen,
     36     HybridMappingProxy,
     37     _default,
     38     either_dict_or_kwargs,
     39     maybe_wrap_array,
     40 )
     41 from xarray.core.variable import Variable
     43 from . import formatting, formatting_html

ImportError: cannot import name 'HybridMappingProxy' from 'xarray.core.utils'
@droumis droumis closed this as completed Nov 15, 2024
@droumis droumis reopened this Nov 15, 2024
@droumis
Copy link
Author

droumis commented Nov 15, 2024

Datatree has been merged upstream into pydata/xarray, and released as of xarray version 2024.10.0.

https://github.com/pydata/xarray/blob/main/DATATREE_MIGRATION_GUIDE.md

@willem0boone
Copy link

Would be very cool if ndpyramid could implement xarray.DataTree 👍 👍 👍

@norlandrhagen
Copy link
Contributor

Hey @willem0boone and @droumis, thanks for raising this issue. With #152 , this should be fixed.

@norlandrhagen
Copy link
Contributor

I'll release a new version once the PR lands.

@norlandrhagen
Copy link
Contributor

https://github.com/carbonplan/ndpyramid/releases/tag/v0.3.2

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

Successfully merging a pull request may close this issue.

3 participants