darothen/xbpch

Incompatibility with xarray 0.10.2

Closed this issue · 2 comments

xbpch 0.3.0 is not compatible with xarray 0.10.2:

In [1]: import xbpch
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-659176cbe09c> in <module>()
----> 1 import xbpch

~/Research/Computing/miniconda3/envs/geo/lib/python3.6/site-packages/xbpch/__init__.py in <module>()
      5     pass
      6
----> 7 from . bpch import BPCHFile
      8 from . core import open_bpchdataset, open_mfbpchdataset

~/Research/Computing/miniconda3/envs/geo/lib/python3.6/site-packages/xbpch/bpch.py in <module>()
     12
     13 from . uff import FortranFile
---> 14 from . util import cf
     15 from . util.diaginfo import get_diaginfo, get_tracerinfo
     16

~/Research/Computing/miniconda3/envs/geo/lib/python3.6/site-packages/xbpch/util/cf.py in <module>()
     12
     13 from xarray.core.variable import as_variable, Variable
---> 14 from xarray.core.indexing import LazilyIndexedArray
     15 from xarray.conventions import MaskedAndScaledArray
     16

ImportError: cannot import name 'LazilyIndexedArray'

Those import commands no longer work in xarray 0.10.2:

In [2]: from xarray.core.indexing import LazilyIndexedArray
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-2-247a23d0f2bf> in <module>()
----> 1 from xarray.core.indexing import LazilyIndexedArray

ImportError: cannot import name 'LazilyIndexedArray'

In [3]: from xarray.conventions import MaskedAndScaledArray
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-3-6f922ed71e58> in <module>()
----> 1 from xarray.conventions import MaskedAndScaledArray

ImportError: cannot import name 'MaskedAndScaledArray'

This is about xarray.core so is not documented in xarray change log

Please try darothen/xbpch/#9 and let me know that it works. I tested on all my local data and it was fine.

Should be fixed now; included as part of v0.3.3 release and will be available on PyPI and conda-forge shortly.