xarray-contrib / pint-xarray

Interface for using pint with xarray, providing convenience accessors
https://pint-xarray.readthedocs.io/en/latest/
Apache License 2.0
105 stars 12 forks source link

Failing to quantify on real CMIP6 data #117

Closed TomNicholas closed 3 years ago

TomNicholas commented 3 years ago

The example gist here, run on pangeo's cloud (staging - environment below), is an attempt to use pint-xarray with cf-xarray on some real CMIP6 data.

Unfortunately I think it fails to .quantify the lev dataarray properly:

I need to look into this more to work out what is actually going wrong...

Environment:

Output of mamba list packages in environment at /srv/conda/envs/notebook: # # Name Version Build Channel _libgcc_mutex 0.1 conda_forge conda-forge _openmp_mutex 4.5 1_gnu conda-forge abseil-cpp 20210324.0 h9c3ff4c_0 conda-forge adal 1.2.7 pyhd8ed1ab_0 conda-forge adlfs 0.7.3 pyhd8ed1ab_1 conda-forge affine 2.3.0 py_0 conda-forge aiobotocore 1.3.0 pyhd8ed1ab_0 conda-forge aiohttp 3.7.4 py38h497a2fe_0 conda-forge aioitertools 0.7.1 pyhd8ed1ab_0 conda-forge alembic 1.5.8 pyhd8ed1ab_0 conda-forge alsa-lib 1.2.3 h516909a_0 conda-forge amqp 5.0.6 pyhd8ed1ab_0 conda-forge anyio 2.2.0 py38h578d9bd_0 conda-forge appdirs 1.4.4 pyh9f0ad1d_0 conda-forge argon2-cffi 20.1.0 py38h497a2fe_2 conda-forge arrow-cpp 3.0.0 py38hd6878d3_11_cpu conda-forge asciitree 0.3.3 py_2 conda-forge asn1crypto 1.4.0 pyh9f0ad1d_0 conda-forge astropy 4.2.1 py38h497a2fe_0 conda-forge async-timeout 3.0.1 py_1000 conda-forge async_generator 1.10 py_0 conda-forge atk-1.0 2.36.0 h3371d22_4 conda-forge attrs 20.3.0 pyhd3deb0d_0 conda-forge av 8.0.3 py38hcaf3a0b_0 conda-forge aws-c-cal 0.4.5 h76129ab_8 conda-forge aws-c-common 0.5.2 h7f98852_0 conda-forge aws-c-event-stream 0.2.7 h6bac3ce_1 conda-forge aws-c-io 0.9.1 ha5b09cb_1 conda-forge aws-checksums 0.1.11 h99e32c3_3 conda-forge aws-sdk-cpp 1.8.151 hceb1b1e_1 conda-forge awscli 1.19.49 py38h578d9bd_0 conda-forge azure-core 1.12.0 pyhd8ed1ab_0 conda-forge azure-datalake-store 0.0.51 pyh9f0ad1d_0 conda-forge azure-identity 1.5.0 pyhd8ed1ab_0 conda-forge azure-storage-blob 12.8.1 pyhd8ed1ab_0 conda-forge babel 2.9.0 pyhd3deb0d_0 conda-forge backcall 0.2.0 pyh9f0ad1d_0 conda-forge backports 1.0 py_2 conda-forge backports.functools_lru_cache 1.6.4 pyhd8ed1ab_0 conda-forge bcrypt 3.2.0 py38h497a2fe_1 conda-forge beautifulsoup4 4.9.3 pyhb0f4dca_0 conda-forge billiard 3.6.4.0 py38h497a2fe_0 conda-forge binutils_impl_linux-64 2.35.1 h193b22a_2 conda-forge binutils_linux-64 2.35 h67ddf6f_30 conda-forge bleach 3.3.0 pyh44b312d_0 conda-forge blinker 1.4 py_1 conda-forge blosc 1.21.0 h9c3ff4c_0 conda-forge bokeh 2.3.1 py38h578d9bd_0 conda-forge boost-cpp 1.74.0 hc6e9bd1_2 conda-forge boto3 1.17.49 pyhd8ed1ab_0 conda-forge botocore 1.20.49 pyhd8ed1ab_0 conda-forge bottleneck 1.3.2 py38h5c078b8_3 conda-forge branca 0.4.2 pyhd8ed1ab_0 conda-forge brotli 1.0.9 h9c3ff4c_4 conda-forge brotlipy 0.7.0 py38h497a2fe_1001 conda-forge brunsli 0.1 h9c3ff4c_0 conda-forge bzip2 1.0.8 h7f98852_4 conda-forge c-ares 1.17.1 h7f98852_1 conda-forge ca-certificates 2020.12.5 ha878542_0 conda-forge cached-property 1.5.2 hd8ed1ab_1 conda-forge cached_property 1.5.2 pyha770c72_1 conda-forge cachetools 4.2.1 pyhd8ed1ab_0 conda-forge cachey 0.2.1 pyh9f0ad1d_0 conda-forge cairo 1.16.0 h6cf1ce9_1008 conda-forge cartopy 0.19.0 py38hc9c980b_0 conda-forge celery 5.0.5 pyhd8ed1ab_0 conda-forge certifi 2020.12.5 py38h578d9bd_1 conda-forge certipy 0.1.3 py_0 conda-forge cf_xarray 0.5.1 pyh44b312d_0 conda-forge cffi 1.14.5 py38ha65f79e_0 conda-forge cfgrib 0.9.9.0 pyhd8ed1ab_1 conda-forge cfitsio 3.470 hb418390_7 conda-forge cftime 1.4.1 py38h5c078b8_0 conda-forge cgen 2020.1 py_0 conda-forge chardet 4.0.0 py38h578d9bd_1 conda-forge charls 2.2.0 h9c3ff4c_0 conda-forge ciso 0.1.0 py38h5c078b8_2 conda-forge click 7.1.2 pyh9f0ad1d_0 conda-forge click-didyoumean 0.0.3 pyh8c360ce_0 conda-forge click-plugins 1.1.1 py_0 conda-forge click-repl 0.1.6 py_0 conda-forge cligj 0.7.1 pyhd8ed1ab_0 conda-forge cloudpickle 1.6.0 py_0 conda-forge cmip6_preprocessing 0.2.0 pyhd8ed1ab_0 conda-forge cmocean 2.0 py_3 conda-forge colorama 0.4.3 py_0 conda-forge colorcet 2.0.6 pyhd8ed1ab_0 conda-forge colorspacious 1.1.2 pyh24bf2e0_0 conda-forge configobj 5.0.6 py_0 conda-forge croniter 0.3.36 pyhd8ed1ab_0 conda-forge cryptography 3.4.7 py38ha5dfef3_0 conda-forge curl 7.76.1 h979ede3_1 conda-forge cycler 0.10.0 py_2 conda-forge cytoolz 0.11.0 py38h497a2fe_3 conda-forge dask 2021.4.1 pyhd8ed1ab_0 conda-forge dask-core 2021.4.1 pyhd8ed1ab_0 conda-forge dask-gateway 0.9.0 py38h578d9bd_0 conda-forge dask-glm 0.2.0 py_1 conda-forge dask-kubernetes 2021.3.1 pyhd8ed1ab_0 conda-forge dask-labextension 5.0.1 pyhd8ed1ab_1 conda-forge dask-ml 1.8.0 pyhd8ed1ab_0 conda-forge datacube 1.8.3 py_1 conda-forge datashader 0.12.1 pyh44b312d_1 conda-forge datashape 0.5.4 py_1 conda-forge dbus 1.13.6 h48d8840_2 conda-forge decorator 5.0.7 pyhd8ed1ab_0 conda-forge defusedxml 0.7.1 pyhd8ed1ab_0 conda-forge deprecation 2.1.0 pyh9f0ad1d_0 conda-forge descartes 1.1.0 py_4 conda-forge distributed 2021.4.1 py38h578d9bd_0 conda-forge docker-py 5.0.0 py38h578d9bd_0 conda-forge docker-pycreds 0.4.0 py_0 conda-forge docopt 0.6.2 py_1 conda-forge docrep 0.2.7 py_0 conda-forge docutils 0.15.2 py38h578d9bd_1 conda-forge donfig 0.6.0 pyhd8ed1ab_0 conda-forge eccodes 2.21.0 ha0e6eb6_0 conda-forge entrypoints 0.3 pyhd8ed1ab_1003 conda-forge eofs 1.4.0 py_0 conda-forge erddapy 1.0.0 pyhd8ed1ab_0 conda-forge esmf 8.1.0 mpi_mpich_h224d73f_100 conda-forge esmpy 8.1.0 mpi_mpich_py38h7f78e9f_100 conda-forge expat 2.3.0 h9c3ff4c_0 conda-forge fastapi 0.63.0 pyhd8ed1ab_0 conda-forge fasteners 0.14.1 py_3 conda-forge fastjmd95 0.2.1 pyh44b312d_0 conda-forge fastprogress 1.0.0 py_0 conda-forge ffmpeg 4.3.1 hca11adc_2 conda-forge fiona 1.8.18 py38h58f84aa_1 conda-forge font-ttf-dejavu-sans-mono 2.37 hab24e00_0 conda-forge font-ttf-inconsolata 2.001 hab24e00_0 conda-forge font-ttf-source-code-pro 2.030 hab24e00_0 conda-forge font-ttf-ubuntu 0.83 hab24e00_0 conda-forge fontconfig 2.13.1 hba837de_1005 conda-forge fonts-conda-ecosystem 1 0 conda-forge fonts-conda-forge 1 0 conda-forge freetype 2.10.4 h0708190_1 conda-forge freexl 1.0.6 h7f98852_0 conda-forge fribidi 1.0.10 h36c2ea0_0 conda-forge fsspec 2021.4.0 pyhd8ed1ab_0 conda-forge future 0.18.2 py38h578d9bd_3 conda-forge gcc_impl_linux-64 9.3.0 h70c0ae5_19 conda-forge gcc_linux-64 9.3.0 hf25ea35_30 conda-forge gcsfs 2021.4.0 pyhd8ed1ab_0 conda-forge gdal 3.2.1 py38hc0b2d6b_7 conda-forge gdk-pixbuf 2.42.6 h04a7f16_0 conda-forge geocube 0.0.16 pyhd8ed1ab_0 conda-forge geopandas 0.9.0 pyhd8ed1ab_0 conda-forge geos 3.9.1 h9c3ff4c_2 conda-forge geotiff 1.6.0 h2b14fbe_4 conda-forge geoviews-core 1.9.1 pyha770c72_0 conda-forge gettext 0.19.8.1 h0b5b191_1005 conda-forge gflags 2.2.2 he1b5a44_1004 conda-forge gh 1.9.0 ha8f183a_0 conda-forge giflib 5.2.1 h36c2ea0_2 conda-forge glib 2.68.1 h9c3ff4c_0 conda-forge glib-tools 2.68.1 h9c3ff4c_0 conda-forge glog 0.4.0 h49b9bf7_3 conda-forge gmp 6.2.1 h58526e2_0 conda-forge gnutls 3.6.13 h85f3911_1 conda-forge google-auth 1.28.0 pyh44b312d_0 conda-forge google-auth-oauthlib 0.4.4 pyhd8ed1ab_0 conda-forge graphite2 1.3.13 h58526e2_1001 conda-forge graphviz 2.47.1 hebd9034_0 conda-forge greenlet 1.0.0 py38h709712a_0 conda-forge grpc-cpp 1.37.0 h36de60a_1 conda-forge gst-plugins-base 1.18.4 hf529b03_2 conda-forge gstreamer 1.18.4 h76c114f_2 conda-forge gsw 3.4.0 py38h5c078b8_1 conda-forge gtk2 2.24.33 hab0c2f8_0 conda-forge gts 0.7.6 h64030ff_2 conda-forge h11 0.12.0 pyhd8ed1ab_0 conda-forge h5netcdf 0.11.0 pyhd8ed1ab_0 conda-forge h5py 3.2.1 nompi_py38h9915d05_100 conda-forge harfbuzz 2.8.0 h83ec7ef_1 conda-forge hdf4 4.2.13 h10796ff_1005 conda-forge hdf5 1.10.6 mpi_mpich_h996c276_1014 conda-forge heapdict 1.0.1 py_0 conda-forge holoviews 1.14.3 pyhd8ed1ab_0 conda-forge httptools 0.1.1 py38h497a2fe_2 conda-forge hvplot 0.7.1 pyh44b312d_0 conda-forge icu 68.1 h58526e2_0 conda-forge idna 2.10 pyh9f0ad1d_0 conda-forge imagecodecs 2021.3.31 py38h1455ab2_0 conda-forge imageio 2.9.0 py_0 conda-forge importlib-metadata 4.0.1 py38h578d9bd_0 conda-forge importlib_metadata 4.0.1 hd8ed1ab_0 conda-forge importlib_resources 5.1.2 py38h578d9bd_0 conda-forge intake 0.6.2 pyhd8ed1ab_0 conda-forge intake-esm 2021.1.15 pyhd8ed1ab_0 conda-forge intake-geopandas 0.2.4 pyhd8ed1ab_0 conda-forge intake-stac 0.3.0 py_0 conda-forge intake-xarray 0.5.0 pyhd8ed1ab_0 conda-forge ipykernel 5.5.3 py38hd0cf306_0 conda-forge ipyleaflet 0.13.6 pyhd8ed1ab_1 conda-forge ipyspin 0.1.5 pyhd8ed1ab_0 conda-forge ipython 7.22.0 py38hd0cf306_0 conda-forge ipython_genutils 0.2.0 py_1 conda-forge ipywidgets 7.6.3 pyhd3deb0d_0 conda-forge isodate 0.6.0 py_1 conda-forge jasper 1.900.1 h07fcdf6_1006 conda-forge jdcal 1.4.1 py_0 conda-forge jedi 0.18.0 py38h578d9bd_2 conda-forge jinja2 2.11.3 pyh44b312d_0 conda-forge jmespath 0.10.0 pyh9f0ad1d_0 conda-forge joblib 1.0.1 pyhd8ed1ab_0 conda-forge jpeg 9d h36c2ea0_0 conda-forge json-c 0.15 h98cffda_0 conda-forge json5 0.9.5 pyh9f0ad1d_0 conda-forge jsonschema 3.2.0 pyhd8ed1ab_3 conda-forge jupyter-packaging 0.9.2 pyhd8ed1ab_0 conda-forge jupyter-panel-proxy 0.1.0 py_0 conda-forge jupyter-resource-usage 0.5.1 pyhd8ed1ab_0 conda-forge jupyter-server-proxy 3.0.2 pyhd8ed1ab_0 conda-forge jupyter_client 6.1.12 pyhd8ed1ab_0 conda-forge jupyter_core 4.7.1 py38h578d9bd_0 conda-forge jupyter_server 1.6.4 py38h578d9bd_0 conda-forge jupyter_telemetry 0.1.0 pyhd8ed1ab_1 conda-forge jupyterhub-base 1.4.0 py38h578d9bd_0 conda-forge jupyterhub-singleuser 1.4.0 py38h578d9bd_0 conda-forge jupyterlab 3.0.14 pyhd8ed1ab_0 conda-forge jupyterlab_pygments 0.1.2 pyh9f0ad1d_0 conda-forge jupyterlab_server 2.4.0 pyhd8ed1ab_0 conda-forge jupyterlab_widgets 1.0.0 pyhd8ed1ab_1 conda-forge jxrlib 1.1 h7f98852_2 conda-forge kealib 1.4.14 hcc255d8_2 conda-forge kernel-headers_linux-64 2.6.32 h77966d4_13 conda-forge kiwisolver 1.3.1 py38h1fd1430_1 conda-forge kombu 5.0.2 py38h578d9bd_2 conda-forge krb5 1.17.2 h926e7f8_0 conda-forge kubernetes_asyncio 12.1.0 pyhd8ed1ab_0 conda-forge lame 3.100 h7f98852_1001 conda-forge lark-parser 0.11.2 pyh44b312d_0 conda-forge lcms2 2.12 hddcbb42_0 conda-forge ld_impl_linux-64 2.35.1 hea4e1c9_2 conda-forge lerc 2.2.1 h9c3ff4c_0 conda-forge libaec 1.0.4 h9c3ff4c_1 conda-forge libblas 3.9.0 8_openblas conda-forge libcblas 3.9.0 8_openblas conda-forge libclang 11.1.0 default_ha53f305_0 conda-forge libcurl 7.76.1 hc4aaa36_1 conda-forge libdap4 3.20.6 hd7c4107_2 conda-forge libdeflate 1.7 h7f98852_5 conda-forge libedit 3.1.20191231 he28a2e2_2 conda-forge libev 4.33 h516909a_1 conda-forge libevent 2.1.10 hcdb4288_3 conda-forge libffi 3.3 h58526e2_2 conda-forge libgcc-devel_linux-64 9.3.0 h7864c58_19 conda-forge libgcc-ng 9.3.0 h2828fa1_19 conda-forge libgd 2.3.2 h78a0170_0 conda-forge libgdal 3.2.1 h38ff51b_7 conda-forge libgfortran-ng 9.3.0 hff62375_19 conda-forge libgfortran5 9.3.0 hff62375_19 conda-forge libglib 2.68.1 h3e27bee_0 conda-forge libgomp 9.3.0 h2828fa1_19 conda-forge libiconv 1.16 h516909a_0 conda-forge libkml 1.3.0 h238a007_1013 conda-forge liblapack 3.9.0 8_openblas conda-forge libllvm10 10.0.1 he513fc3_3 conda-forge libllvm11 11.1.0 hf817b99_2 conda-forge libnetcdf 4.7.4 mpi_mpich_hdef422e_7 conda-forge libnghttp2 1.43.0 h812cca2_0 conda-forge libogg 1.3.4 h7f98852_1 conda-forge libopenblas 0.3.12 pthreads_h4812303_1 conda-forge libopus 1.3.1 h7f98852_1 conda-forge libpng 1.6.37 h21135ba_2 conda-forge libpq 13.2 hfd2b0eb_2 conda-forge libprotobuf 3.15.8 h780b84a_0 conda-forge librsvg 2.50.3 hfa39831_1 conda-forge librttopo 1.1.0 h1185371_6 conda-forge libsodium 1.0.18 h36c2ea0_1 conda-forge libspatialindex 1.9.3 h9c3ff4c_3 conda-forge libspatialite 5.0.1 he52d314_3 conda-forge libssh2 1.9.0 ha56f1ee_6 conda-forge libstdcxx-ng 9.3.0 h6de172a_19 conda-forge libthrift 0.14.1 he6d91bd_1 conda-forge libtiff 4.2.0 hdc55705_1 conda-forge libtool 2.4.6 h58526e2_1007 conda-forge libutf8proc 2.6.1 h7f98852_0 conda-forge libuuid 2.32.1 h7f98852_1000 conda-forge libuv 1.41.0 h7f98852_0 conda-forge libvorbis 1.3.7 h9c3ff4c_0 conda-forge libwebp 1.2.0 h3452ae3_0 conda-forge libwebp-base 1.2.0 h7f98852_2 conda-forge libxcb 1.13 h7f98852_1003 conda-forge libxkbcommon 1.0.3 he3ba5ed_0 conda-forge libxml2 2.9.10 h72842e0_4 conda-forge libzopfli 1.0.3 h9c3ff4c_0 conda-forge llvmlite 0.36.0 py38h4630a5e_0 conda-forge locket 0.2.0 py_2 conda-forge lz4 3.1.3 py38hebdc3cf_0 conda-forge lz4-c 1.9.3 h9c3ff4c_0 conda-forge mako 1.1.4 pyh44b312d_0 conda-forge markdown 3.3.4 pyhd8ed1ab_0 conda-forge markupsafe 1.1.1 py38h497a2fe_3 conda-forge marshmallow 3.11.1 pyhd8ed1ab_0 conda-forge marshmallow-oneofschema 2.1.0 pyhd8ed1ab_0 conda-forge matplotlib 3.4.1 py38h578d9bd_0 conda-forge matplotlib-base 3.4.1 py38hcc49a3a_0 conda-forge mercantile 1.2.1 pyhd8ed1ab_0 conda-forge metpy 1.0 pyhd8ed1ab_0 conda-forge mistune 0.8.4 py38h497a2fe_1003 conda-forge monotonic 1.5 py_0 conda-forge mpi 1.0 mpich conda-forge mpi4py 3.0.3 py38he865349_5 conda-forge mpich 3.4.1 h846660c_104 conda-forge msal 1.11.0 pyh44b312d_0 conda-forge msal_extensions 0.3.0 pyh9f0ad1d_0 conda-forge msgpack-python 1.0.2 py38h1fd1430_1 conda-forge msrest 0.6.21 pyh44b312d_0 conda-forge msrestazure 0.6.4 pyhd8ed1ab_0 conda-forge multidict 5.1.0 py38h497a2fe_1 conda-forge multipledispatch 0.6.0 py_0 conda-forge munch 2.5.0 py_0 conda-forge mypy_extensions 0.4.3 py38h578d9bd_3 conda-forge mysql-common 8.0.23 ha770c72_1 conda-forge mysql-libs 8.0.23 h935591d_1 conda-forge natsort 7.1.1 pyhd8ed1ab_0 conda-forge nb_conda_kernels 2.3.1 py38h578d9bd_0 conda-forge nbclassic 0.2.7 pyhd8ed1ab_0 conda-forge nbclient 0.5.3 pyhd8ed1ab_0 conda-forge nbconvert 6.0.7 py38h578d9bd_3 conda-forge nbformat 5.1.3 pyhd8ed1ab_0 conda-forge nbgitpuller 0.9.0 py_0 conda-forge nbstripout 0.4.0 pyhd8ed1ab_0 conda-forge nc-time-axis 1.2.0 py_1 conda-forge ncurses 6.2 h58526e2_4 conda-forge nest-asyncio 1.5.1 pyhd8ed1ab_0 conda-forge netcdf-fortran 4.5.3 mpi_mpich_hafa3f36_3 conda-forge netcdf4 1.5.6 nompi_py38hf887595_102 conda-forge nettle 3.6 he412f7d_0 conda-forge networkx 2.5 py_0 conda-forge nomkl 1.0 h5ca1d4c_0 conda-forge notebook 6.3.0 pyha770c72_1 conda-forge nspr 4.30 h9c3ff4c_0 conda-forge nss 3.64 hb5efdd6_0 conda-forge numba 0.53.1 py38h0e12cce_0 conda-forge numcodecs 0.7.3 py38h709712a_0 conda-forge numpy 1.20.2 py38h9894fe3_0 conda-forge oauthlib 3.0.1 py_0 conda-forge olefile 0.46 pyh9f0ad1d_1 conda-forge openh264 2.1.1 h780b84a_0 conda-forge openjpeg 2.4.0 hf7af979_0 conda-forge openssl 1.1.1k h7f98852_0 conda-forge orc 1.6.7 heec2584_1 conda-forge packaging 20.9 pyh44b312d_0 conda-forge pamela 1.0.0 py_0 conda-forge pandas 1.2.4 py38h1abd341_0 conda-forge pandoc 2.12 h7f98852_0 conda-forge pandocfilters 1.4.2 py_1 conda-forge panel 0.11.3 pyhd8ed1ab_0 conda-forge pangeo-dask 2021.04.26 hd8ed1ab_0 conda-forge pangeo-notebook 2021.04.26 hd8ed1ab_0 conda-forge pango 1.42.4 h69149e4_5 conda-forge param 1.10.1 pyhd3deb0d_0 conda-forge paramiko 2.7.2 pyh9f0ad1d_0 conda-forge parcels 2.2.2 py38h578d9bd_0 conda-forge parquet-cpp 1.5.1 2 conda-forge parso 0.8.2 pyhd8ed1ab_0 conda-forge partd 1.2.0 pyhd8ed1ab_0 conda-forge pcre 8.44 he1b5a44_0 conda-forge pendulum 2.1.2 pyhd8ed1ab_1 conda-forge pexpect 4.8.0 pyh9f0ad1d_2 conda-forge pickleshare 0.7.5 py_1003 conda-forge pillow 8.1.2 py38ha0e1e83_1 conda-forge pint 0.17 pyhd8ed1ab_0 conda-forge pint-xarray 0.3.dev7+g6ee1bf9 dev_0 pip 20.3.4 pyhd8ed1ab_0 conda-forge pixman 0.40.0 h36c2ea0_0 conda-forge pooch 1.3.0 pyhd8ed1ab_0 conda-forge poppler 0.89.0 h2de54a5_5 conda-forge poppler-data 0.4.10 0 conda-forge portalocker 1.7.0 py38h578d9bd_1 conda-forge postgresql 13.2 h6303168_2 conda-forge prefect 0.14.16 pyhd8ed1ab_0 conda-forge progressbar2 3.53.1 pyh9f0ad1d_0 conda-forge proj 7.2.0 h277dcde_2 conda-forge prometheus_client 0.10.1 pyhd8ed1ab_0 conda-forge prompt-toolkit 3.0.18 pyha770c72_0 conda-forge prompt_toolkit 3.0.18 hd8ed1ab_0 conda-forge psutil 5.8.0 py38h497a2fe_1 conda-forge psycopg2 2.8.6 py38h497a2fe_2 conda-forge pthread-stubs 0.4 h36c2ea0_1001 conda-forge ptyprocess 0.7.0 pyhd3deb0d_0 conda-forge pyarrow 3.0.0 py38hc9229eb_11_cpu conda-forge pyasn1 0.4.8 py_0 conda-forge pyasn1-modules 0.2.7 py_0 conda-forge pycamhd 0.7.0 py_0 conda-forge pycparser 2.20 pyh9f0ad1d_2 conda-forge pyct 0.4.6 py_0 conda-forge pyct-core 0.4.6 py_0 conda-forge pycurl 7.43.0.6 py38h996a351_1 conda-forge pydantic 1.8.1 py38h497a2fe_1 conda-forge pydap 3.2.2 pyh9f0ad1d_1001 conda-forge pyerfa 1.7.3 py38h497a2fe_0 conda-forge pygments 2.8.1 pyhd8ed1ab_0 conda-forge pyjwt 2.0.1 pyhd8ed1ab_1 conda-forge pykdtree 1.3.4 py38h0b5ebd8_0 conda-forge pymbolic 2021.1 pyhd8ed1ab_0 conda-forge pynacl 1.4.0 py38h497a2fe_2 conda-forge pyopenssl 20.0.1 pyhd8ed1ab_0 conda-forge pyorbital 1.6.1 pyhd8ed1ab_0 conda-forge pyparsing 2.4.7 pyh9f0ad1d_0 conda-forge pyproj 3.0.1 py38h16ecdd7_0 conda-forge pyqt 5.12.3 py38h578d9bd_7 conda-forge pyqt-impl 5.12.3 py38h7400c14_7 conda-forge pyqt5-sip 4.19.18 py38h709712a_7 conda-forge pyqtchart 5.12 py38h7400c14_7 conda-forge pyqtwebengine 5.12.1 py38h7400c14_7 conda-forge pyresample 1.19.0 py38h1abd341_0 conda-forge pyrsistent 0.17.3 py38h497a2fe_2 conda-forge pyshp 2.1.3 pyh44b312d_0 conda-forge pysocks 1.7.1 py38h578d9bd_3 conda-forge pyspectral 0.10.4 pyhd8ed1ab_0 conda-forge pystac 0.5.6 pyhd8ed1ab_0 conda-forge python 3.8.8 hffdb5ce_0_cpython conda-forge python-blosc 1.10.2 py38h1abd341_0 conda-forge python-box 5.3.0 pyhd8ed1ab_0 conda-forge python-dateutil 2.7.5 py_0 conda-forge python-dotenv 0.17.0 pyhd8ed1ab_0 conda-forge python-eccodes 2021.03.0 py38hb5d20a5_1 conda-forge python-editor 1.0.4 py_0 conda-forge python-geotiepoints 1.2.1 py38h5c078b8_1 conda-forge python-gist 0.10.3 pyhd8ed1ab_0 conda-forge python-gnupg 0.4.7 pyhd8ed1ab_0 conda-forge python-graphviz 0.16 pyh243d235_2 conda-forge python-json-logger 2.0.1 pyh9f0ad1d_0 conda-forge python-kubernetes 12.0.1 pyhd3deb0d_0 conda-forge python-slugify 4.0.1 pyh9f0ad1d_0 conda-forge python-utils 2.5.6 pyh44b312d_0 conda-forge python_abi 3.8 1_cp38 conda-forge pytools 2021.2.6 pyhd8ed1ab_0 conda-forge pytz 2021.1 pyhd8ed1ab_0 conda-forge pytzdata 2020.1 pyh9f0ad1d_0 conda-forge pyviz_comms 2.0.1 pyhd3deb0d_0 conda-forge pywavelets 1.1.1 py38h5c078b8_3 conda-forge pyyaml 5.4.1 py38h497a2fe_0 conda-forge pyzmq 22.0.3 py38h2035c66_1 conda-forge qt 5.12.9 hda022c4_4 conda-forge rasterio 1.2.2 py38h56add21_0 conda-forge re2 2021.04.01 h9c3ff4c_0 conda-forge readline 8.1 h46c0cb4_0 conda-forge rechunker 0.4 pyhd8ed1ab_0 conda-forge redis-py 3.5.3 pyh9f0ad1d_0 conda-forge requests 2.25.1 pyhd3deb0d_0 conda-forge requests-oauthlib 1.3.0 pyh9f0ad1d_0 conda-forge rio-cogeo 2.0.1 py_0 conda-forge rioxarray 0.3.1 pyhd8ed1ab_0 conda-forge rsa 4.7.2 pyh44b312d_0 conda-forge rtree 0.9.7 py38h02d302b_1 conda-forge ruamel.yaml 0.16.12 py38h497a2fe_2 conda-forge ruamel.yaml.clib 0.2.2 py38h497a2fe_2 conda-forge s2n 1.0.0 h9b69904_0 conda-forge s3fs 2021.4.0 pyhd8ed1ab_0 conda-forge s3transfer 0.3.7 pyhd8ed1ab_0 conda-forge sat-search 0.3.0 py_0 conda-forge sat-stac 0.4.1 pyh44b312d_0 conda-forge satpy 0.27.0 pyhd8ed1ab_0 conda-forge scikit-image 0.18.1 py38h51da96c_0 conda-forge scikit-learn 0.24.1 py38h658cfdd_0 conda-forge scipy 1.6.2 py38h7b17777_0 conda-forge send2trash 1.5.0 py_0 conda-forge setuptools 49.6.0 py38h578d9bd_3 conda-forge shapely 1.7.1 py38h4fc1155_4 conda-forge simpervisor 0.4 pyhd8ed1ab_0 conda-forge six 1.15.0 pyh9f0ad1d_0 conda-forge snappy 1.1.8 he1b5a44_3 conda-forge sniffio 1.2.0 py38h578d9bd_1 conda-forge snuggs 1.4.7 py_0 conda-forge sortedcontainers 2.3.0 pyhd8ed1ab_0 conda-forge soupsieve 2.0.1 py_1 conda-forge sparse 0.12.0 pyhd8ed1ab_0 conda-forge sqlalchemy 1.4.11 py38h497a2fe_0 conda-forge sqlite 3.35.5 h74cdb3f_0 conda-forge sshtunnel 0.3.1 pyhd8ed1ab_0 conda-forge starlette-base 0.13.6 py_0 conda-forge strict-rfc3339 0.7 py_1 conda-forge supermercado 0.2.0 pyh9f0ad1d_0 conda-forge sysroot_linux-64 2.12 h77966d4_13 conda-forge tabulate 0.8.9 pyhd8ed1ab_0 conda-forge tblib 1.7.0 pyhd8ed1ab_0 conda-forge terminado 0.9.4 py38h578d9bd_0 conda-forge testpath 0.4.4 py_0 conda-forge text-unidecode 1.3 py_0 conda-forge threadpoolctl 2.1.0 pyh5ca1d4c_0 conda-forge tifffile 2021.4.8 pyhd8ed1ab_0 conda-forge tiledb 2.2.7 h91fcb0e_0 conda-forge tiledb-py 0.8.7 py38h6688ea9_1 conda-forge tk 8.6.10 h21135ba_1 conda-forge toml 0.10.2 pyhd8ed1ab_0 conda-forge tomlkit 0.7.0 py38h578d9bd_3 conda-forge toolz 0.11.1 py_0 conda-forge tornado 6.1 py38h497a2fe_1 conda-forge tqdm 4.60.0 pyhd8ed1ab_0 conda-forge traitlets 5.0.5 py_0 conda-forge traittypes 0.2.1 pyh9f0ad1d_2 conda-forge trollimage 1.15.0 pyhd8ed1ab_0 conda-forge trollsift 0.3.5 pyh44b312d_0 conda-forge typing-extensions 3.7.4.3 0 conda-forge typing_extensions 3.7.4.3 py_0 conda-forge tzcode 2021a h7f98852_1 conda-forge tzdata 2021a he74cb21_0 conda-forge unidecode 1.2.0 pyhd8ed1ab_0 conda-forge urllib3 1.26.4 pyhd8ed1ab_0 conda-forge uvicorn 0.13.4 py38h578d9bd_0 conda-forge uvloop 0.15.2 py38h497a2fe_0 conda-forge vine 5.0.0 pyhd8ed1ab_1 conda-forge watchgod 0.6 py_0 conda-forge wcwidth 0.2.5 pyh9f0ad1d_2 conda-forge webencodings 0.5.1 py_1 conda-forge webob 1.8.7 pyhd8ed1ab_0 conda-forge websocket-client 0.57.0 py38h578d9bd_4 conda-forge websockets 8.1 py38h497a2fe_3 conda-forge wheel 0.36.2 pyhd3deb0d_0 conda-forge widgetsnbextension 3.5.1 py38h578d9bd_4 conda-forge wrapt 1.12.1 py38h497a2fe_3 conda-forge x264 1!161.3030 h7f98852_0 conda-forge xarray 0.17.0 pyhd8ed1ab_0 conda-forge xarray-spatial 0.1.8 pyhd8ed1ab_0 conda-forge xarray_leaflet 0.1.13 pyhd8ed1ab_0 conda-forge xarrayutils 0.1.3 pyh9f0ad1d_0 conda-forge xcape 0.1.2 py38he1ac83b_2 conda-forge xcube 0.7.2 pyhd8ed1ab_0 conda-forge xerces-c 3.2.3 h9d8b166_2 conda-forge xesmf 0.5.3 pyhd8ed1ab_0 conda-forge xgcm 0.5.1 py_0 conda-forge xhistogram 0.1.3 pyhd8ed1ab_0 conda-forge xlayers 0.2.2 py38hb1f05c6_1 conda-forge xmitgcm 0.5.1 pyhd8ed1ab_0 conda-forge xorg-kbproto 1.0.7 h7f98852_1002 conda-forge xorg-libice 1.0.10 h7f98852_0 conda-forge xorg-libsm 1.2.3 hd9c2040_1000 conda-forge xorg-libx11 1.7.0 h7f98852_0 conda-forge xorg-libxau 1.0.9 h7f98852_0 conda-forge xorg-libxdmcp 1.1.3 h7f98852_0 conda-forge xorg-libxext 1.3.4 h7f98852_1 conda-forge xorg-libxrender 0.9.10 h7f98852_1003 conda-forge xorg-renderproto 0.11.1 h7f98852_1002 conda-forge xorg-xextproto 7.3.0 h7f98852_1002 conda-forge xorg-xproto 7.0.31 h7f98852_1007 conda-forge xpublish 0.1.0 py_0 conda-forge xrft 0.3.0 pyhd8ed1ab_0 conda-forge xz 5.2.5 h516909a_1 conda-forge yaml 0.2.5 h516909a_0 conda-forge yarl 1.6.3 py38h497a2fe_1 conda-forge zarr 2.7.1 pyhd8ed1ab_0 conda-forge zeromq 4.3.4 h9c3ff4c_0 conda-forge zfp 0.5.5 h9c3ff4c_5 conda-forge zict 2.0.0 py_0 conda-forge zipp 3.4.1 pyhd8ed1ab_0 conda-forge zlib 1.2.11 h516909a_1010 conda-forge zstd 1.4.9 ha95c52a_0 conda-forge
keewis commented 3 years ago

if I understand correctly, lev is a dimension coordinate? To support those, pint-xarray will convert the string to a unit object and save that as a attribute (.pint.sel and other methods that use indexes use that to work around the no-units-on-indexes restriction).

I'm not sure why degrees_east does not work, could you check whether the unit registry at pint_xarray.unit_registry supports it? Otherwise you might have to update cf-xarray, you need cf-xarray>=0.6.0.

dcherian commented 3 years ago

I think you have to import cf_xarray.units

keewis commented 3 years ago

it's both, actually, the environment lists cf-xarray=0.5.1 and the import is import cf_xarray not import cf_xarray.units

TomNicholas commented 3 years ago

Thanks guys, those seem to have fixed my issues!