0s autopkgtest [10:31:46]: starting date and time: 2025-11-17 10:31:46+0000 0s autopkgtest [10:31:46]: git checkout: 4b346b80 nova: make wait_reboot return success even when a no-op 0s autopkgtest [10:31:46]: host juju-7f2275-prod-proposed-migration-environment-15; command line: /home/ubuntu/autopkgtest/runner/autopkgtest --output-dir /tmp/autopkgtest-work.x68qczjg/out --timeout-copy=6000 --setup-commands /home/ubuntu/autopkgtest-cloud/worker-config-production/setup-canonical.sh --apt-pocket=proposed=src:numpy,src:python3-defaults --apt-upgrade python-xarray --timeout-short=300 --timeout-copy=20000 --timeout-build=20000 '--env=ADT_TEST_TRIGGERS=numpy/1:2.3.4+ds-3ubuntu1 python3-defaults/3.13.7-2' -- ssh -s /home/ubuntu/autopkgtest/ssh-setup/nova -- --flavor autopkgtest-cpu2-ram4-disk20-amd64 --security-groups autopkgtest-juju-7f2275-prod-proposed-migration-environment-15@sto01-8.secgroup --name adt-resolute-amd64-python-xarray-20251117-103146-juju-7f2275-prod-proposed-migration-environment-15-973bb123-9a66-4769-a8fb-302bf8309423 --image adt/ubuntu-resolute-amd64-server --keyname testbed-juju-7f2275-prod-proposed-migration-environment-15 --net-id=net_prod-autopkgtest-workers-amd64 -e TERM=linux --mirror=http://ftpmaster.internal/ubuntu/ 3s Creating nova instance adt-resolute-amd64-python-xarray-20251117-103146-juju-7f2275-prod-proposed-migration-environment-15-973bb123-9a66-4769-a8fb-302bf8309423 from image adt/ubuntu-resolute-amd64-server-20251117.img (UUID 9762b0cc-7c5b-4854-acd5-cc74ad0de8c6)... 64s autopkgtest [10:32:50]: testbed dpkg architecture: amd64 64s autopkgtest [10:32:50]: testbed apt version: 3.1.11 65s autopkgtest [10:32:51]: @@@@@@@@@@@@@@@@@@@@ test bed setup 65s autopkgtest [10:32:51]: testbed release detected to be: None 65s autopkgtest [10:32:51]: updating testbed package index (apt update) 66s Get:1 http://ftpmaster.internal/ubuntu resolute-proposed InRelease [87.8 kB] 66s Hit:2 http://ftpmaster.internal/ubuntu resolute InRelease 66s Hit:3 http://ftpmaster.internal/ubuntu resolute-updates InRelease 66s Hit:4 http://ftpmaster.internal/ubuntu resolute-security InRelease 66s Get:5 http://ftpmaster.internal/ubuntu resolute-proposed/restricted Sources [9848 B] 66s Get:6 http://ftpmaster.internal/ubuntu resolute-proposed/universe Sources [881 kB] 66s Get:7 http://ftpmaster.internal/ubuntu resolute-proposed/main Sources [80.3 kB] 66s Get:8 http://ftpmaster.internal/ubuntu resolute-proposed/multiverse Sources [22.9 kB] 66s Get:9 http://ftpmaster.internal/ubuntu resolute-proposed/main i386 Packages [118 kB] 66s Get:10 http://ftpmaster.internal/ubuntu resolute-proposed/main amd64 Packages [158 kB] 66s Get:11 http://ftpmaster.internal/ubuntu resolute-proposed/main amd64 c-n-f Metadata [3128 B] 66s Get:12 http://ftpmaster.internal/ubuntu resolute-proposed/restricted i386 Packages [3744 B] 66s Get:13 http://ftpmaster.internal/ubuntu resolute-proposed/restricted amd64 Packages [64.6 kB] 66s Get:14 http://ftpmaster.internal/ubuntu resolute-proposed/restricted amd64 c-n-f Metadata [336 B] 66s Get:15 http://ftpmaster.internal/ubuntu resolute-proposed/universe i386 Packages [282 kB] 66s Get:16 http://ftpmaster.internal/ubuntu resolute-proposed/universe amd64 Packages [614 kB] 66s Get:17 http://ftpmaster.internal/ubuntu resolute-proposed/universe amd64 c-n-f Metadata [22.2 kB] 66s Get:18 http://ftpmaster.internal/ubuntu resolute-proposed/multiverse i386 Packages [6516 B] 66s Get:19 http://ftpmaster.internal/ubuntu resolute-proposed/multiverse amd64 Packages [13.4 kB] 66s Get:20 http://ftpmaster.internal/ubuntu resolute-proposed/multiverse amd64 c-n-f Metadata [680 B] 69s Fetched 2367 kB in 1s (2378 kB/s) 69s Reading package lists... 70s Hit:1 http://ftpmaster.internal/ubuntu resolute-proposed InRelease 70s Hit:2 http://ftpmaster.internal/ubuntu resolute InRelease 70s Hit:3 http://ftpmaster.internal/ubuntu resolute-updates InRelease 70s Hit:4 http://ftpmaster.internal/ubuntu resolute-security InRelease 70s Reading package lists... 70s Reading package lists... 71s Building dependency tree... 71s Reading state information... 71s Calculating upgrade... 71s The following packages will be upgraded: 71s libpython3-stdlib python3 python3-minimal usbutils 71s 4 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 71s Need to get 146 kB of archives. 71s After this operation, 0 B of additional disk space will be used. 71s Get:1 http://ftpmaster.internal/ubuntu resolute-proposed/main amd64 python3-minimal amd64 3.13.7-2 [27.8 kB] 71s Get:2 http://ftpmaster.internal/ubuntu resolute-proposed/main amd64 python3 amd64 3.13.7-2 [23.9 kB] 71s Get:3 http://ftpmaster.internal/ubuntu resolute-proposed/main amd64 libpython3-stdlib amd64 3.13.7-2 [10.6 kB] 71s Get:4 http://ftpmaster.internal/ubuntu resolute/main amd64 usbutils amd64 1:019-1 [83.9 kB] 71s dpkg-preconfigure: unable to re-open stdin: No such file or directory 71s Fetched 146 kB in 0s (12.9 MB/s) 71s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 83372 files and directories currently installed.) 71s Preparing to unpack .../python3-minimal_3.13.7-2_amd64.deb ... 71s Unpacking python3-minimal (3.13.7-2) over (3.13.7-1) ... 71s Setting up python3-minimal (3.13.7-2) ... 71s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 83372 files and directories currently installed.) 71s Preparing to unpack .../python3_3.13.7-2_amd64.deb ... 71s running python pre-rtupdate hooks for python3.13... 71s Unpacking python3 (3.13.7-2) over (3.13.7-1) ... 71s Preparing to unpack .../libpython3-stdlib_3.13.7-2_amd64.deb ... 71s Unpacking libpython3-stdlib:amd64 (3.13.7-2) over (3.13.7-1) ... 71s Preparing to unpack .../usbutils_1%3a019-1_amd64.deb ... 71s Unpacking usbutils (1:019-1) over (1:018-2) ... 71s Setting up usbutils (1:019-1) ... 71s Setting up libpython3-stdlib:amd64 (3.13.7-2) ... 71s Setting up python3 (3.13.7-2) ... 71s running python rtupdate hooks for python3.13... 71s running python post-rtupdate hooks for python3.13... 72s Processing triggers for man-db (2.13.1-1) ... 72s autopkgtest [10:32:58]: upgrading testbed (apt dist-upgrade and autopurge) 72s Reading package lists... 72s Building dependency tree... 72s Reading state information... 73s Calculating upgrade... 73s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 73s Reading package lists... 73s Building dependency tree... 73s Reading state information... 73s Solving dependencies... 73s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 75s autopkgtest [10:33:01]: testbed running kernel: Linux 6.17.0-5-generic #5-Ubuntu SMP PREEMPT_DYNAMIC Mon Sep 22 10:00:33 UTC 2025 75s autopkgtest [10:33:01]: @@@@@@@@@@@@@@@@@@@@ apt-source python-xarray 77s Get:1 http://ftpmaster.internal/ubuntu resolute/universe python-xarray 2025.03.1-8 (dsc) [3963 B] 77s Get:2 http://ftpmaster.internal/ubuntu resolute/universe python-xarray 2025.03.1-8 (tar) [2781 kB] 77s Get:3 http://ftpmaster.internal/ubuntu resolute/universe python-xarray 2025.03.1-8 (diff) [20.6 kB] 77s gpgv: Signature made Mon May 5 11:14:20 2025 UTC 77s gpgv: using RSA key 7E1AC3FA27A649284C323EF6695C429316C07BFE 77s gpgv: issuer "jdg@debian.org" 77s gpgv: Can't check signature: No public key 77s dpkg-source: warning: cannot verify inline signature for ./python-xarray_2025.03.1-8.dsc: no acceptable signature found 77s autopkgtest [10:33:03]: testing package python-xarray version 2025.03.1-8 77s autopkgtest [10:33:03]: build not needed 78s autopkgtest [10:33:04]: test pybuild-autopkgtest: preparing testbed 78s Reading package lists... 78s Building dependency tree... 78s Reading state information... 78s Solving dependencies... 79s The following NEW packages will be installed: 79s autoconf automake autopoint autotools-dev blt build-essential comerr-dev cpp 79s cpp-14 cpp-14-x86-64-linux-gnu cpp-15 cpp-15-x86-64-linux-gnu 79s cpp-x86-64-linux-gnu debhelper debugedit dh-autoreconf dh-python 79s dh-strip-nondeterminism docutils-common dwz fontconfig fontconfig-config 79s fonts-dejavu-core fonts-dejavu-extra fonts-dejavu-mono fonts-font-awesome 79s fonts-lato fonts-lyx fonts-mathjax fonts-open-sans fonts-urw-base35 g++ 79s g++-15 g++-15-x86-64-linux-gnu g++-x86-64-linux-gnu gcc gcc-14 gcc-14-base 79s gcc-14-x86-64-linux-gnu gcc-15 gcc-15-x86-64-linux-gnu gcc-x86-64-linux-gnu 79s gdb gettext gfortran-14 gfortran-14-x86-64-linux-gnu gfortran-15 79s gfortran-15-x86-64-linux-gnu ghostscript intltool-debian ipython3 79s krb5-multidev libaec-dev libaec0 libamd-comgr3 libamdhip64-6 79s libarchive-zip-perl libasan8 libavahi-client3 libavahi-common-data 79s libavahi-common3 libb2-1 libbabeltrace1 libblosc1 libboost-iostreams1.88.0 79s libboost-thread1.88.0 libbrotli-dev libbz2-dev libcairo2 libcares2 libcc1-0 79s libcups2t64 libcurl4-gnutls-dev libdatrie1 libdebhelper-perl libdeflate0 79s libdouble-conversion3 libdrm-intel1 libdxflib3 libeccodes-data 79s libeccodes-dev libeccodes0 libeckit-dev libeckit-utils libeckit0d 79s libegl-mesa0 libegl1 libeigen3-dev libevent-2.1-7t64 libevent-dev 79s libevent-extra-2.1-7t64 libevent-openssl-2.1-7t64 libevent-pthreads-2.1-7t64 79s libfabric1 libfile-stripnondeterminism-perl libfontconfig1 libfontenc1 79s libgbm1 libgcc-14-dev libgcc-15-dev libgeos-c1t64 libgeos3.13.1 libgeotiff5 79s libgfortran-14-dev libgfortran-15-dev libgfortran5 libgl1-mesa-dri libglvnd0 79s libglx-mesa0 libglx0 libgmp-dev libgmpxx4ldbl libgnutls-dane0t64 79s libgnutls-openssl27t64 libgnutls28-dev libgomp1 libgraphite2-3 libgs-common 79s libgs10 libgs10-common libgssrpc4t64 libharfbuzz0b libhdf5-310 79s libhdf5-hl-310 libhsa-runtime64-1 libhsakmt1 libhwasan0 libhwloc-dev 79s libhwloc-plugins libhwloc15 libibmad5 libibumad3 libibverbs-dev libice6 79s libidn12 libidn2-dev libijs-0.35 libimagequant0 libinput-bin libinput10 79s libipt2 libisl23 libitm1 libjbig0 libjbig2dec0 libjemalloc-dev libjpeg-dev 79s libjpeg-turbo8 libjpeg-turbo8-dev libjpeg8 libjpeg8-dev libjs-jquery 79s libjs-jquery-ui libjs-mathjax libjs-requirejs libjs-sphinxdoc 79s libjs-sprintf-js libjs-underscore libjson-perl libkadm5clnt-mit12 79s libkadm5srv-mit12 libkdb5-10t64 libkrb5-dev liblcms2-2 libldap-dev liblerc4 79s libllvm21 liblsan0 libltdl-dev libltdl7 liblua5.4-0 liblz4-dev liblzf1 79s libmagics++-data libmagics++-dev libmagics++-metview-dev libmagplus3v5 79s libmd4c0 libmpc3 libmtdev1t64 libmysqlclient24 libnetcdf22 libnghttp2-dev 79s libnl-3-dev libnl-route-3-dev libnode115 libnorm1t64 libnuma-dev libodc-0d 79s libodc-dev libopenblas-dev libopenblas-pthread-dev libopenblas0 79s libopenblas0-pthread libopengl0 libopenjp2-7 libopenmpi-dev libopenmpi40 79s libp11-kit-dev libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 79s libpaper2 libpciaccess0 libpcre2-16-0 libpgm-5.3-0t64 libpixman-1-0 79s libpkgconf3 libpng-dev libpq5 libproj25 libpsl-dev libpsm2-2 79s libpython3.14-minimal libpython3.14-stdlib libqhull-r8.0 libqhullcpp8.0 79s libqt6core6t64 libqt6dbus6 libqt6gui6 libqt6widgets6 libquadmath0 librados2 79s libraqm0 librdmacm1t64 librsync2t64 librtmp-dev libsharpyuv0 libsm6 79s libsnappy-dev libsnappy1v5 libsodium23 libsource-highlight-common 79s libsource-highlight4t64 libssh2-1-dev libssl-dev libstdc++-15-dev libsz2 79s libtasn1-6-dev libtcl8.6 libterralib-dev libterralib3t64 libthai-data 79s libthai0 libtiff6 libtk8.6 libtool libts0t64 libtsan2 libubsan1 libucx0 79s libunbound8 libvulkan1 libwacom-common libwacom9 libwayland-client0 libwebp7 79s libwebpdemux2 libwebpmux3 libx11-xcb1 libxcb-cursor0 libxcb-dri3-0 79s libxcb-glx0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-present0 79s libxcb-randr0 libxcb-render-util0 libxcb-render0 libxcb-shape0 libxcb-shm0 79s libxcb-sync1 libxcb-util1 libxcb-xfixes0 libxcb-xinput0 libxcb-xkb1 libxft2 79s libxkbcommon-x11-0 libxnvctrl0 libxrender1 libxshmfence1 libxslt1.1 libxss1 79s libxt6t64 libxxf86vm1 libxxhash-dev libze1 libzmq5 libzopfli1 libzstd-dev m4 79s magics++ mesa-libgallium mpi-default-dev mypy mysql-common nettle-dev 79s node-acorn node-argparse node-balanced-match node-brace-expansion 79s node-cjs-module-lexer node-corepack node-debug node-esprima 79s node-fortawesome-fontawesome-free node-js-yaml node-llhttp node-lru-cache 79s node-minimatch node-ms node-semver node-sprintf-js node-undici node-xtend 79s nodejs ocl-icd-libopencl1 odc openmpi-bin openmpi-common pandoc pandoc-data 79s pkgconf pkgconf-bin po-debconf poppler-data proj-data 79s pybuild-plugin-autopkgtest pybuild-plugin-pyproject python-cartopy-data 79s python-dask-doc python-hypothesis-doc python-matplotlib-data 79s python-pandas-doc python-scipy-doc python-tinycss2-common python-xarray-doc 79s python3-accessible-pygments python3-alabaster python3-all python3-asttokens 79s python3-autodocsumm python3-bleach python3-bottleneck python3-brotli 79s python3-bs4 python3-build python3-cartopy python3-cffi python3-cfgrib 79s python3-cftime python3-click python3-cloudpickle python3-comm 79s python3-contourpy python3-coverage python3-crc32c python3-cycler 79s python3-dask python3-debugpy python3-decorator python3-defusedxml 79s python3-doc python3-docutils python3-donfig python3-eccodes 79s python3-ecmwflibs python3-execnet python3-executing python3-fastjsonschema 79s python3-findlibs python3-flexcache python3-flexparser python3-fonttools 79s python3-fs python3-fsspec python3-h5netcdf python3-h5py python3-h5py-serial 79s python3-html5lib python3-hypothesis python3-imagesize python3-iniconfig 79s python3-installer python3-ipykernel python3-ipython python3-jedi 79s python3-jupyter-client python3-jupyter-console python3-jupyter-core 79s python3-jupyterlab-pygments python3-kiwisolver python3-locket python3-lxml 79s python3-lz4 python3-matplotlib python3-matplotlib-inline python3-mistune 79s python3-mpmath python3-mypy python3-mypy-extensions python3-nbclient 79s python3-nbconvert python3-nbformat python3-nbsphinx python3-nest-asyncio 79s python3-netcdf4 python3-numcodecs python3-numpy python3-numpy-dev 79s python3-numpydoc python3-pandas python3-pandas-lib python3-pandocfilters 79s python3-parso python3-partd python3-pickleshare python3-pil 79s python3-pil.imagetk python3-pint python3-pip python3-platformdirs 79s python3-pluggy python3-ply python3-pooch python3-prompt-toolkit 79s python3-psutil python3-pure-eval python3-pycparser 79s python3-pydata-sphinx-theme python3-pyproj python3-pyproject-hooks 79s python3-pyshp python3-pytest python3-pytest-mypy python3-pytest-xdist 79s python3-pytz python3-regex python3-roman python3-scipy python3-seaborn 79s python3-setuptools-scm python3-shapely python3-snowballstemmer 79s python3-sortedcontainers python3-soupsieve python3-sphinx 79s python3-sphinx-book-theme python3-sphinx-copybutton python3-sphinx-design 79s python3-sphinx-gallery python3-sphinx-inline-tabs 79s python3-sphinx-remove-toctrees python3-sphinx-rtd-theme 79s python3-sphinxcontrib-mermaid python3-sphinxcontrib.jquery 79s python3-sphinxext-opengraph python3-sphinxext-rediraffe python3-stack-data 79s python3-sympy python3-tinycss2 python3-tk python3-tomlkit python3-toolz 79s python3-tornado python3-traitlets python3-typeshed python3-ufolib2 79s python3-wcwidth python3-webencodings python3-wheel python3-xarray 79s python3-zarr python3-zmq python3-zopfli python3.13-doc python3.13-tk 79s python3.14 python3.14-minimal python3.14-tk sgml-base sphinx-common 79s sphinx-rtd-theme-common tk8.6-blt2.5 tzdata-legacy unicode-data x11-common 79s xfonts-encodings xfonts-utils xml-core zlib1g-dev 79s 0 upgraded, 492 newly installed, 0 to remove and 0 not upgraded. 79s Need to get 601 MB of archives. 79s After this operation, 2851 MB of additional disk space will be used. 79s Get:1 http://ftpmaster.internal/ubuntu resolute/main amd64 fonts-lato all 2.015-1 [2781 kB] 79s Get:2 http://ftpmaster.internal/ubuntu resolute/main amd64 poppler-data all 0.4.12-1 [2060 kB] 79s Get:3 http://ftpmaster.internal/ubuntu resolute-proposed/main amd64 python3-numpy-dev amd64 1:2.3.4+ds-3ubuntu1 [147 kB] 79s Get:4 http://ftpmaster.internal/ubuntu resolute/main amd64 libgfortran5 amd64 15.2.0-7ubuntu1 [939 kB] 79s Get:5 http://ftpmaster.internal/ubuntu resolute/universe amd64 libopenblas0-pthread amd64 0.3.30+ds-3 [5382 kB] 79s Get:6 http://ftpmaster.internal/ubuntu resolute-proposed/main amd64 python3-numpy amd64 1:2.3.4+ds-3ubuntu1 [8126 kB] 79s Get:7 http://ftpmaster.internal/ubuntu resolute/main amd64 libpython3.14-minimal amd64 3.14.0-4 [906 kB] 79s Get:8 http://ftpmaster.internal/ubuntu resolute/main amd64 python3.14-minimal amd64 3.14.0-4 [2559 kB] 79s Get:9 http://ftpmaster.internal/ubuntu resolute/main amd64 m4 amd64 1.4.20-2 [217 kB] 79s Get:10 http://ftpmaster.internal/ubuntu resolute/main amd64 autoconf all 2.72-3.1ubuntu1 [384 kB] 79s Get:11 http://ftpmaster.internal/ubuntu resolute/main amd64 autotools-dev all 20240727.1 [43.4 kB] 79s Get:12 http://ftpmaster.internal/ubuntu resolute/main amd64 automake all 1:1.18.1-2 [581 kB] 79s Get:13 http://ftpmaster.internal/ubuntu resolute/main amd64 autopoint all 0.23.2-1 [620 kB] 80s Get:14 http://ftpmaster.internal/ubuntu resolute/main amd64 libtcl8.6 amd64 8.6.17+dfsg-1 [1036 kB] 80s Get:15 http://ftpmaster.internal/ubuntu resolute/main amd64 fonts-dejavu-mono all 2.37-8 [502 kB] 80s Get:16 http://ftpmaster.internal/ubuntu resolute/main amd64 fonts-dejavu-core all 2.37-8 [835 kB] 80s Get:17 http://ftpmaster.internal/ubuntu resolute/main amd64 libfontenc1 amd64 1:1.1.8-1build1 [14.0 kB] 80s Get:18 http://ftpmaster.internal/ubuntu resolute/main amd64 x11-common all 1:7.7+24ubuntu1 [22.4 kB] 80s Get:19 http://ftpmaster.internal/ubuntu resolute/main amd64 xfonts-encodings all 1:1.0.5-0ubuntu2 [578 kB] 80s Get:20 http://ftpmaster.internal/ubuntu resolute/main amd64 xfonts-utils amd64 1:7.7+7 [97.1 kB] 80s Get:21 http://ftpmaster.internal/ubuntu resolute/main amd64 fonts-urw-base35 all 20200910-8 [11.0 MB] 80s Get:22 http://ftpmaster.internal/ubuntu resolute/main amd64 fontconfig-config amd64 2.15.0-2.3ubuntu1 [38.0 kB] 80s Get:23 http://ftpmaster.internal/ubuntu resolute/main amd64 libfontconfig1 amd64 2.15.0-2.3ubuntu1 [141 kB] 80s Get:24 http://ftpmaster.internal/ubuntu resolute/main amd64 libxrender1 amd64 1:0.9.12-1 [19.8 kB] 80s Get:25 http://ftpmaster.internal/ubuntu resolute/main amd64 libxft2 amd64 2.3.6-1build1 [45.3 kB] 80s Get:26 http://ftpmaster.internal/ubuntu resolute/main amd64 libxss1 amd64 1:1.2.3-1build3 [7204 B] 80s Get:27 http://ftpmaster.internal/ubuntu resolute/main amd64 libtk8.6 amd64 8.6.17-1 [823 kB] 80s Get:28 http://ftpmaster.internal/ubuntu resolute/main amd64 tk8.6-blt2.5 amd64 2.5.3+dfsg-8 [694 kB] 80s Get:29 http://ftpmaster.internal/ubuntu resolute/main amd64 blt amd64 2.5.3+dfsg-8 [4824 B] 80s Get:30 http://ftpmaster.internal/ubuntu resolute/main amd64 libisl23 amd64 0.27-1 [685 kB] 80s Get:31 http://ftpmaster.internal/ubuntu resolute/main amd64 libmpc3 amd64 1.3.1-2 [54.8 kB] 80s Get:32 http://ftpmaster.internal/ubuntu resolute/main amd64 cpp-15-x86-64-linux-gnu amd64 15.2.0-7ubuntu1 [12.9 MB] 80s Get:33 http://ftpmaster.internal/ubuntu resolute/main amd64 cpp-15 amd64 15.2.0-7ubuntu1 [1026 B] 80s Get:34 http://ftpmaster.internal/ubuntu resolute/main amd64 cpp-x86-64-linux-gnu amd64 4:15.2.0-4ubuntu1 [5746 B] 80s Get:35 http://ftpmaster.internal/ubuntu resolute/main amd64 cpp amd64 4:15.2.0-4ubuntu1 [22.4 kB] 80s Get:36 http://ftpmaster.internal/ubuntu resolute/main amd64 libcc1-0 amd64 15.2.0-7ubuntu1 [47.4 kB] 80s Get:37 http://ftpmaster.internal/ubuntu resolute/main amd64 libgomp1 amd64 15.2.0-7ubuntu1 [151 kB] 80s Get:38 http://ftpmaster.internal/ubuntu resolute/main amd64 libitm1 amd64 15.2.0-7ubuntu1 [29.7 kB] 80s Get:39 http://ftpmaster.internal/ubuntu resolute/main amd64 libasan8 amd64 15.2.0-7ubuntu1 [3071 kB] 80s Get:40 http://ftpmaster.internal/ubuntu resolute/main amd64 liblsan0 amd64 15.2.0-7ubuntu1 [1360 kB] 80s Get:41 http://ftpmaster.internal/ubuntu resolute/main amd64 libtsan2 amd64 15.2.0-7ubuntu1 [2757 kB] 80s Get:42 http://ftpmaster.internal/ubuntu resolute/main amd64 libubsan1 amd64 15.2.0-7ubuntu1 [1210 kB] 80s Get:43 http://ftpmaster.internal/ubuntu resolute/main amd64 libhwasan0 amd64 15.2.0-7ubuntu1 [1685 kB] 80s Get:44 http://ftpmaster.internal/ubuntu resolute/main amd64 libquadmath0 amd64 15.2.0-7ubuntu1 [153 kB] 80s Get:45 http://ftpmaster.internal/ubuntu resolute/main amd64 libgcc-15-dev amd64 15.2.0-7ubuntu1 [2864 kB] 80s Get:46 http://ftpmaster.internal/ubuntu resolute/main amd64 gcc-15-x86-64-linux-gnu amd64 15.2.0-7ubuntu1 [25.4 MB] 81s Get:47 http://ftpmaster.internal/ubuntu resolute/main amd64 gcc-15 amd64 15.2.0-7ubuntu1 [524 kB] 81s Get:48 http://ftpmaster.internal/ubuntu resolute/main amd64 gcc-x86-64-linux-gnu amd64 4:15.2.0-4ubuntu1 [1208 B] 81s Get:49 http://ftpmaster.internal/ubuntu resolute/main amd64 gcc amd64 4:15.2.0-4ubuntu1 [5024 B] 81s Get:50 http://ftpmaster.internal/ubuntu resolute/main amd64 libstdc++-15-dev amd64 15.2.0-7ubuntu1 [2573 kB] 81s Get:51 http://ftpmaster.internal/ubuntu resolute/main amd64 g++-15-x86-64-linux-gnu amd64 15.2.0-7ubuntu1 [14.4 MB] 81s Get:52 http://ftpmaster.internal/ubuntu resolute/main amd64 g++-15 amd64 15.2.0-7ubuntu1 [23.7 kB] 81s Get:53 http://ftpmaster.internal/ubuntu resolute/main amd64 g++-x86-64-linux-gnu amd64 4:15.2.0-4ubuntu1 [966 B] 81s Get:54 http://ftpmaster.internal/ubuntu resolute/main amd64 g++ amd64 4:15.2.0-4ubuntu1 [1100 B] 81s Get:55 http://ftpmaster.internal/ubuntu resolute/main amd64 build-essential amd64 12.12ubuntu1 [5080 B] 81s Get:56 http://ftpmaster.internal/ubuntu resolute/main amd64 gcc-14-base amd64 14.3.0-10ubuntu1 [57.2 kB] 81s Get:57 http://ftpmaster.internal/ubuntu resolute/universe amd64 cpp-14-x86-64-linux-gnu amd64 14.3.0-10ubuntu1 [11.9 MB] 81s Get:58 http://ftpmaster.internal/ubuntu resolute/universe amd64 cpp-14 amd64 14.3.0-10ubuntu1 [1032 B] 81s Get:59 http://ftpmaster.internal/ubuntu resolute/main amd64 libdebhelper-perl all 13.24.2ubuntu1 [95.7 kB] 81s Get:60 http://ftpmaster.internal/ubuntu resolute/main amd64 libgcc-14-dev amd64 14.3.0-10ubuntu1 [2813 kB] 81s Get:61 http://ftpmaster.internal/ubuntu resolute/universe amd64 gcc-14-x86-64-linux-gnu amd64 14.3.0-10ubuntu1 [23.3 MB] 82s Get:62 http://ftpmaster.internal/ubuntu resolute/universe amd64 gcc-14 amd64 14.3.0-10ubuntu1 [556 kB] 82s Get:63 http://ftpmaster.internal/ubuntu resolute/main amd64 libtool all 2.5.4-7 [169 kB] 82s Get:64 http://ftpmaster.internal/ubuntu resolute/main amd64 dh-autoreconf all 21 [12.5 kB] 82s Get:65 http://ftpmaster.internal/ubuntu resolute/main amd64 libarchive-zip-perl all 1.68-1 [90.2 kB] 82s Get:66 http://ftpmaster.internal/ubuntu resolute/main amd64 libfile-stripnondeterminism-perl all 1.15.0-1 [20.5 kB] 82s Get:67 http://ftpmaster.internal/ubuntu resolute/main amd64 dh-strip-nondeterminism all 1.15.0-1 [5090 B] 82s Get:68 http://ftpmaster.internal/ubuntu resolute/main amd64 debugedit amd64 1:5.2-3 [49.9 kB] 82s Get:69 http://ftpmaster.internal/ubuntu resolute/main amd64 dwz amd64 0.16-2 [115 kB] 82s Get:70 http://ftpmaster.internal/ubuntu resolute/main amd64 gettext amd64 0.23.2-1 [1019 kB] 82s Get:71 http://ftpmaster.internal/ubuntu resolute/main amd64 intltool-debian all 0.35.0+20060710.6 [23.2 kB] 82s Get:72 http://ftpmaster.internal/ubuntu resolute/main amd64 po-debconf all 1.0.21+nmu1 [233 kB] 82s Get:73 http://ftpmaster.internal/ubuntu resolute/main amd64 debhelper all 13.24.2ubuntu1 [896 kB] 82s Get:74 http://ftpmaster.internal/ubuntu resolute/universe amd64 dh-python all 6.20250414 [119 kB] 82s Get:75 http://ftpmaster.internal/ubuntu resolute/main amd64 sgml-base all 1.31+nmu1 [11.0 kB] 82s Get:76 http://ftpmaster.internal/ubuntu resolute/main amd64 xml-core all 0.19 [20.3 kB] 82s Get:77 http://ftpmaster.internal/ubuntu resolute/main amd64 docutils-common all 0.21.2+dfsg-2 [131 kB] 82s Get:78 http://ftpmaster.internal/ubuntu resolute/main amd64 fontconfig amd64 2.15.0-2.3ubuntu1 [180 kB] 82s Get:79 http://ftpmaster.internal/ubuntu resolute/main amd64 fonts-dejavu-extra all 2.37-8 [1947 kB] 82s Get:80 http://ftpmaster.internal/ubuntu resolute/main amd64 fonts-font-awesome all 5.0.10+really4.7.0~dfsg-4.1 [516 kB] 82s Get:81 http://ftpmaster.internal/ubuntu resolute/universe amd64 fonts-lyx all 2.4.4-2 [171 kB] 82s Get:82 http://ftpmaster.internal/ubuntu resolute/main amd64 fonts-mathjax all 2.7.9+dfsg-1 [2208 kB] 82s Get:83 http://ftpmaster.internal/ubuntu resolute/universe amd64 fonts-open-sans all 1.11-2 [635 kB] 82s Get:84 http://ftpmaster.internal/ubuntu resolute/main amd64 libbabeltrace1 amd64 1.5.11-4build3 [166 kB] 82s Get:85 http://ftpmaster.internal/ubuntu resolute/main amd64 libipt2 amd64 2.1.2-3 [49.2 kB] 82s Get:86 http://ftpmaster.internal/ubuntu resolute/main amd64 libsource-highlight-common all 3.1.9-4.3build1 [64.2 kB] 82s Get:87 http://ftpmaster.internal/ubuntu resolute/main amd64 libsource-highlight4t64 amd64 3.1.9-4.3build1 [258 kB] 82s Get:88 http://ftpmaster.internal/ubuntu resolute/main amd64 gdb amd64 16.3-1ubuntu2 [4218 kB] 82s Get:89 http://ftpmaster.internal/ubuntu resolute/universe amd64 libgfortran-14-dev amd64 14.3.0-10ubuntu1 [965 kB] 82s Get:90 http://ftpmaster.internal/ubuntu resolute/universe amd64 gfortran-14-x86-64-linux-gnu amd64 14.3.0-10ubuntu1 [12.6 MB] 83s Get:91 http://ftpmaster.internal/ubuntu resolute/universe amd64 gfortran-14 amd64 14.3.0-10ubuntu1 [15.1 kB] 83s Get:92 http://ftpmaster.internal/ubuntu resolute/main amd64 libgfortran-15-dev amd64 15.2.0-7ubuntu1 [972 kB] 83s Get:93 http://ftpmaster.internal/ubuntu resolute/main amd64 gfortran-15-x86-64-linux-gnu amd64 15.2.0-7ubuntu1 [13.6 MB] 83s Get:94 http://ftpmaster.internal/ubuntu resolute/main amd64 gfortran-15 amd64 15.2.0-7ubuntu1 [17.7 kB] 83s Get:95 http://ftpmaster.internal/ubuntu resolute/main amd64 libgs-common all 10.05.0dfsg1-0ubuntu4 [176 kB] 83s Get:96 http://ftpmaster.internal/ubuntu resolute/main amd64 libgs10-common all 10.05.0dfsg1-0ubuntu4 [490 kB] 83s Get:97 http://ftpmaster.internal/ubuntu resolute/main amd64 libavahi-common-data amd64 0.8-16ubuntu3 [31.1 kB] 83s Get:98 http://ftpmaster.internal/ubuntu resolute/main amd64 libavahi-common3 amd64 0.8-16ubuntu3 [25.3 kB] 83s Get:99 http://ftpmaster.internal/ubuntu resolute/main amd64 libavahi-client3 amd64 0.8-16ubuntu3 [28.8 kB] 83s Get:100 http://ftpmaster.internal/ubuntu resolute/main amd64 libcups2t64 amd64 2.4.12-0ubuntu3 [272 kB] 83s Get:101 http://ftpmaster.internal/ubuntu resolute/main amd64 libidn12 amd64 1.43-2 [60.1 kB] 83s Get:102 http://ftpmaster.internal/ubuntu resolute/main amd64 libijs-0.35 amd64 0.35-16 [15.6 kB] 83s Get:103 http://ftpmaster.internal/ubuntu resolute/main amd64 libjbig2dec0 amd64 0.20-1build3 [65.0 kB] 83s Get:104 http://ftpmaster.internal/ubuntu resolute/main amd64 libjpeg-turbo8 amd64 2.1.5-4ubuntu2 [152 kB] 83s Get:105 http://ftpmaster.internal/ubuntu resolute/main amd64 libjpeg8 amd64 8c-2ubuntu11 [2148 B] 83s Get:106 http://ftpmaster.internal/ubuntu resolute/main amd64 libopenjp2-7 amd64 2.5.3-2.1 [188 kB] 83s Get:107 http://ftpmaster.internal/ubuntu resolute/main amd64 libpaper2 amd64 2.2.5-0.3 [17.4 kB] 83s Get:108 http://ftpmaster.internal/ubuntu resolute/main amd64 libdeflate0 amd64 1.23-2 [49.9 kB] 83s Get:109 http://ftpmaster.internal/ubuntu resolute/main amd64 libjbig0 amd64 2.1-6.1ubuntu2 [29.7 kB] 83s Get:110 http://ftpmaster.internal/ubuntu resolute/main amd64 liblerc4 amd64 4.0.0+ds-5ubuntu1 [271 kB] 83s Get:111 http://ftpmaster.internal/ubuntu resolute/main amd64 libsharpyuv0 amd64 1.5.0-0.1 [25.9 kB] 83s Get:112 http://ftpmaster.internal/ubuntu resolute/main amd64 libwebp7 amd64 1.5.0-0.1 [378 kB] 83s Get:113 http://ftpmaster.internal/ubuntu resolute/main amd64 libtiff6 amd64 4.7.0-3ubuntu3 [209 kB] 83s Get:114 http://ftpmaster.internal/ubuntu resolute/main amd64 libice6 amd64 2:1.1.1-1 [44.1 kB] 83s Get:115 http://ftpmaster.internal/ubuntu resolute/main amd64 libsm6 amd64 2:1.2.6-1 [16.4 kB] 83s Get:116 http://ftpmaster.internal/ubuntu resolute/main amd64 libxt6t64 amd64 1:1.2.1-1.3 [173 kB] 83s Get:117 http://ftpmaster.internal/ubuntu resolute/main amd64 libgs10 amd64 10.05.0dfsg1-0ubuntu4 [3777 kB] 83s Get:118 http://ftpmaster.internal/ubuntu resolute/main amd64 ghostscript amd64 10.05.0dfsg1-0ubuntu4 [42.8 kB] 83s Get:119 http://ftpmaster.internal/ubuntu resolute/main amd64 python3-decorator all 5.2.1-2 [28.1 kB] 83s Get:120 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-parso all 0.8.5-1 [68.0 kB] 83s Get:121 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-typeshed all 0.0~git20241223.ea91db2-4 [1554 kB] 83s Get:122 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-jedi all 0.19.1+ds1-1 [693 kB] 83s Get:123 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-traitlets all 5.14.3+really5.14.3-1 [71.5 kB] 83s Get:124 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-matplotlib-inline all 0.1.7-1 [9186 B] 83s Get:125 http://ftpmaster.internal/ubuntu resolute/main amd64 python3-wcwidth all 0.2.13+dfsg1-1 [26.3 kB] 83s Get:126 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-prompt-toolkit all 3.0.52-1 [258 kB] 83s Get:127 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-asttokens all 3.0.0-2 [20.5 kB] 83s Get:128 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-executing all 2.2.0-0.2 [25.0 kB] 83s Get:129 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-pure-eval all 0.2.3-1 [11.4 kB] 83s Get:130 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-stack-data all 0.6.3-1 [22.0 kB] 83s Get:131 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-ipython all 8.35.0-2 [575 kB] 83s Get:132 http://ftpmaster.internal/ubuntu resolute/universe amd64 ipython3 all 8.35.0-2 [4908 B] 83s Get:133 http://ftpmaster.internal/ubuntu resolute/main amd64 comerr-dev amd64 2.1-1.47.2-3ubuntu2 [45.0 kB] 83s Get:134 http://ftpmaster.internal/ubuntu resolute/main amd64 libgssrpc4t64 amd64 1.21.3-5ubuntu2 [58.0 kB] 83s Get:135 http://ftpmaster.internal/ubuntu resolute/main amd64 libkadm5clnt-mit12 amd64 1.21.3-5ubuntu2 [40.0 kB] 83s Get:136 http://ftpmaster.internal/ubuntu resolute/main amd64 libkdb5-10t64 amd64 1.21.3-5ubuntu2 [41.3 kB] 83s Get:137 http://ftpmaster.internal/ubuntu resolute/main amd64 libkadm5srv-mit12 amd64 1.21.3-5ubuntu2 [54.7 kB] 83s Get:138 http://ftpmaster.internal/ubuntu resolute/main amd64 krb5-multidev amd64 1.21.3-5ubuntu2 [125 kB] 83s Get:139 http://ftpmaster.internal/ubuntu resolute/universe amd64 libaec0 amd64 1.1.4-2 [22.9 kB] 83s Get:140 http://ftpmaster.internal/ubuntu resolute/main amd64 libllvm21 amd64 1:21.1.2-2ubuntu6 [30.7 MB] 84s Get:141 http://ftpmaster.internal/ubuntu resolute/universe amd64 libamd-comgr3 amd64 7.0.2+dfsg-1 [15.2 MB] 84s Get:142 http://ftpmaster.internal/ubuntu resolute/universe amd64 libhsakmt1 amd64 6.4.3+dfsg-3 [67.5 kB] 84s Get:143 http://ftpmaster.internal/ubuntu resolute/universe amd64 libhsa-runtime64-1 amd64 6.4.3+dfsg-3 [630 kB] 84s Get:144 http://ftpmaster.internal/ubuntu resolute/universe amd64 libamdhip64-6 amd64 6.4.3-3 [10.3 MB] 84s Get:145 http://ftpmaster.internal/ubuntu resolute/universe amd64 libb2-1 amd64 0.98.1-1.1build1 [45.0 kB] 84s Get:146 http://ftpmaster.internal/ubuntu resolute/main amd64 libsnappy1v5 amd64 1.2.2-2 [30.8 kB] 84s Get:147 http://ftpmaster.internal/ubuntu resolute/universe amd64 libblosc1 amd64 1.21.5+ds-2 [35.8 kB] 84s Get:148 http://ftpmaster.internal/ubuntu resolute/main amd64 libboost-iostreams1.88.0 amd64 1.88.0-1.4ubuntu2 [262 kB] 84s Get:149 http://ftpmaster.internal/ubuntu resolute/main amd64 libboost-thread1.88.0 amd64 1.88.0-1.4ubuntu2 [273 kB] 84s Get:150 http://ftpmaster.internal/ubuntu resolute/main amd64 libbrotli-dev amd64 1.1.0-2build6 [355 kB] 84s Get:151 http://ftpmaster.internal/ubuntu resolute/main amd64 libbz2-dev amd64 1.0.8-6build1 [37.0 kB] 84s Get:152 http://ftpmaster.internal/ubuntu resolute/main amd64 libpixman-1-0 amd64 0.46.4-1 [287 kB] 84s Get:153 http://ftpmaster.internal/ubuntu resolute/main amd64 libxcb-render0 amd64 1.17.0-2build1 [17.4 kB] 84s Get:154 http://ftpmaster.internal/ubuntu resolute/main amd64 libxcb-shm0 amd64 1.17.0-2build1 [6120 B] 84s Get:155 http://ftpmaster.internal/ubuntu resolute/main amd64 libcairo2 amd64 1.18.4-1build1 [611 kB] 84s Get:156 http://ftpmaster.internal/ubuntu resolute/main amd64 libcares2 amd64 1.34.5-1 [100 kB] 84s Get:157 http://ftpmaster.internal/ubuntu resolute/main amd64 libevent-2.1-7t64 amd64 2.1.12-stable-10build1 [155 kB] 84s Get:158 http://ftpmaster.internal/ubuntu resolute/main amd64 libunbound8 amd64 1.22.0-2ubuntu4 [457 kB] 84s Get:159 http://ftpmaster.internal/ubuntu resolute/main amd64 libgnutls-dane0t64 amd64 3.8.9-3ubuntu2 [24.8 kB] 84s Get:160 http://ftpmaster.internal/ubuntu resolute/main amd64 libgnutls-openssl27t64 amd64 3.8.9-3ubuntu2 [25.4 kB] 84s Get:161 http://ftpmaster.internal/ubuntu resolute/main amd64 libidn2-dev amd64 2.3.8-4 [123 kB] 84s Get:162 http://ftpmaster.internal/ubuntu resolute/main amd64 libp11-kit-dev amd64 0.25.9-2 [29.3 kB] 84s Get:163 http://ftpmaster.internal/ubuntu resolute/main amd64 libtasn1-6-dev amd64 4.20.0-2build1 [93.6 kB] 84s Get:164 http://ftpmaster.internal/ubuntu resolute/main amd64 libgmpxx4ldbl amd64 2:6.3.0+dfsg-5ubuntu1 [9956 B] 84s Get:165 http://ftpmaster.internal/ubuntu resolute/main amd64 libgmp-dev amd64 2:6.3.0+dfsg-5ubuntu1 [342 kB] 84s Get:166 http://ftpmaster.internal/ubuntu resolute/main amd64 nettle-dev amd64 3.10.2-1 [1176 kB] 84s Get:167 http://ftpmaster.internal/ubuntu resolute/main amd64 libgnutls28-dev amd64 3.8.9-3ubuntu2 [1119 kB] 84s Get:168 http://ftpmaster.internal/ubuntu resolute/main amd64 libkrb5-dev amd64 1.21.3-5ubuntu2 [11.9 kB] 84s Get:169 http://ftpmaster.internal/ubuntu resolute/main amd64 libldap-dev amd64 2.6.10+dfsg-1ubuntu2 [328 kB] 84s Get:170 http://ftpmaster.internal/ubuntu resolute/main amd64 libpkgconf3 amd64 1.8.1-4build1 [32.8 kB] 84s Get:171 http://ftpmaster.internal/ubuntu resolute/main amd64 pkgconf-bin amd64 1.8.1-4build1 [21.7 kB] 84s Get:172 http://ftpmaster.internal/ubuntu resolute/main amd64 pkgconf amd64 1.8.1-4build1 [16.8 kB] 84s Get:173 http://ftpmaster.internal/ubuntu resolute/main amd64 libnghttp2-dev amd64 1.64.0-1.1ubuntu1 [120 kB] 84s Get:174 http://ftpmaster.internal/ubuntu resolute/main amd64 libpsl-dev amd64 0.21.2-1.1build1 [76.4 kB] 84s Get:175 http://ftpmaster.internal/ubuntu resolute/main amd64 zlib1g-dev amd64 1:1.3.dfsg+really1.3.1-1ubuntu2 [898 kB] 84s Get:176 http://ftpmaster.internal/ubuntu resolute/main amd64 librtmp-dev amd64 2.4+20151223.gitfa8646d.1-3 [69.2 kB] 84s Get:177 http://ftpmaster.internal/ubuntu resolute/main amd64 libssl-dev amd64 3.5.3-1ubuntu2 [2936 kB] 84s Get:178 http://ftpmaster.internal/ubuntu resolute/main amd64 libssh2-1-dev amd64 1.11.1-1build1 [288 kB] 84s Get:179 http://ftpmaster.internal/ubuntu resolute/main amd64 libzstd-dev amd64 1.5.7+dfsg-2 [376 kB] 84s Get:180 http://ftpmaster.internal/ubuntu resolute/main amd64 libcurl4-gnutls-dev amd64 8.14.1-2ubuntu1 [519 kB] 84s Get:181 http://ftpmaster.internal/ubuntu resolute/main amd64 libdatrie1 amd64 0.2.13-4 [19.3 kB] 84s Get:182 http://ftpmaster.internal/ubuntu resolute/universe amd64 libdouble-conversion3 amd64 3.3.1-2 [41.4 kB] 84s Get:183 http://ftpmaster.internal/ubuntu resolute/main amd64 libpciaccess0 amd64 0.18.1-1ubuntu2 [19.0 kB] 84s Get:184 http://ftpmaster.internal/ubuntu resolute/main amd64 libdrm-intel1 amd64 2.4.127-1ubuntu1 [69.2 kB] 84s Get:185 http://ftpmaster.internal/ubuntu resolute/universe amd64 libdxflib3 amd64 3.26.4-2 [58.8 kB] 84s Get:186 http://ftpmaster.internal/ubuntu resolute/universe amd64 libeccodes-data all 2.41.0-1 [1779 kB] 84s Get:187 http://ftpmaster.internal/ubuntu resolute/universe amd64 libeccodes0 amd64 2.41.0-1 [829 kB] 84s Get:188 http://ftpmaster.internal/ubuntu resolute/universe amd64 libsz2 amd64 1.1.4-2 [5516 B] 84s Get:189 http://ftpmaster.internal/ubuntu resolute/universe amd64 libaec-dev amd64 1.1.4-2 [19.9 kB] 84s Get:190 http://ftpmaster.internal/ubuntu resolute/main amd64 libpng-dev amd64 1.6.50-1 [273 kB] 84s Get:191 http://ftpmaster.internal/ubuntu resolute/main amd64 libjpeg-turbo8-dev amd64 2.1.5-4ubuntu2 [296 kB] 84s Get:192 http://ftpmaster.internal/ubuntu resolute/main amd64 libjpeg8-dev amd64 8c-2ubuntu11 [1484 B] 84s Get:193 http://ftpmaster.internal/ubuntu resolute/main amd64 libjpeg-dev amd64 8c-2ubuntu11 [1482 B] 84s Get:194 http://ftpmaster.internal/ubuntu resolute/universe amd64 libeccodes-dev amd64 2.41.0-1 [1163 kB] 84s Get:195 http://ftpmaster.internal/ubuntu resolute/universe amd64 libopenblas0 amd64 0.3.30+ds-3 [6304 B] 84s Get:196 http://ftpmaster.internal/ubuntu resolute/main amd64 libevent-pthreads-2.1-7t64 amd64 2.1.12-stable-10build1 [8360 B] 84s Get:197 http://ftpmaster.internal/ubuntu resolute/universe amd64 libpsm2-2 amd64 11.2.185-2.1 [193 kB] 84s Get:198 http://ftpmaster.internal/ubuntu resolute/main amd64 librdmacm1t64 amd64 56.1-1ubuntu1 [71.4 kB] 84s Get:199 http://ftpmaster.internal/ubuntu resolute/universe amd64 libfabric1 amd64 2.1.0-1.1 [697 kB] 84s Get:200 http://ftpmaster.internal/ubuntu resolute/universe amd64 libhwloc15 amd64 2.12.2-1 [181 kB] 84s Get:201 http://ftpmaster.internal/ubuntu resolute/main amd64 libibumad3 amd64 56.1-1ubuntu1 [31.3 kB] 84s Get:202 http://ftpmaster.internal/ubuntu resolute/main amd64 libibmad5 amd64 56.1-1ubuntu1 [44.0 kB] 84s Get:203 http://ftpmaster.internal/ubuntu resolute/universe amd64 libucx0 amd64 1.19.0+ds-1build1 [1266 kB] 85s Get:204 http://ftpmaster.internal/ubuntu resolute/main amd64 libxnvctrl0 amd64 510.47.03-0ubuntu4 [12.6 kB] 85s Get:205 http://ftpmaster.internal/ubuntu resolute/universe amd64 libze1 amd64 1.24.1-2 [599 kB] 85s Get:206 http://ftpmaster.internal/ubuntu resolute/main amd64 ocl-icd-libopencl1 amd64 2.3.4-1 [40.9 kB] 85s Get:207 http://ftpmaster.internal/ubuntu resolute/universe amd64 libhwloc-plugins amd64 2.12.2-1 [22.2 kB] 85s Get:208 http://ftpmaster.internal/ubuntu resolute/universe amd64 libopenmpi40 amd64 5.0.8-8ubuntu1 [3384 kB] 85s Get:209 http://ftpmaster.internal/ubuntu resolute/universe amd64 proj-data all 9.7.0-1 [7970 kB] 85s Get:210 http://ftpmaster.internal/ubuntu resolute/universe amd64 libproj25 amd64 9.7.0-1 [1496 kB] 85s Get:211 http://ftpmaster.internal/ubuntu resolute/universe amd64 libqhull-r8.0 amd64 2020.2-7 [197 kB] 85s Get:212 http://ftpmaster.internal/ubuntu resolute/universe amd64 libqhullcpp8.0 amd64 2020.2-7 [51.7 kB] 85s Get:213 http://ftpmaster.internal/ubuntu resolute/main amd64 librados2 amd64 19.2.3-0ubuntu2 [4335 kB] 85s Get:214 http://ftpmaster.internal/ubuntu resolute/main amd64 librsync2t64 amd64 2.3.4-1.1ubuntu2 [43.1 kB] 85s Get:215 http://ftpmaster.internal/ubuntu resolute/universe amd64 libeckit0d amd64 1.32.3-1 [1953 kB] 85s Get:216 http://ftpmaster.internal/ubuntu resolute/universe amd64 libeckit-utils amd64 1.32.3-1 [52.9 kB] 85s Get:217 http://ftpmaster.internal/ubuntu resolute/universe amd64 openmpi-common all 5.0.8-8ubuntu1 [108 kB] 85s Get:218 http://ftpmaster.internal/ubuntu resolute/main amd64 libnl-3-dev amd64 3.11.0-2 [103 kB] 85s Get:219 http://ftpmaster.internal/ubuntu resolute/main amd64 libnl-route-3-dev amd64 3.11.0-2 [229 kB] 85s Get:220 http://ftpmaster.internal/ubuntu resolute/main amd64 libibverbs-dev amd64 56.1-1ubuntu1 [686 kB] 85s Get:221 http://ftpmaster.internal/ubuntu resolute/main amd64 libnuma-dev amd64 2.0.19-1 [37.3 kB] 85s Get:222 http://ftpmaster.internal/ubuntu resolute/main amd64 libltdl7 amd64 2.5.4-7 [43.3 kB] 85s Get:223 http://ftpmaster.internal/ubuntu resolute/main amd64 libltdl-dev amd64 2.5.4-7 [173 kB] 85s Get:224 http://ftpmaster.internal/ubuntu resolute/universe amd64 libhwloc-dev amd64 2.12.2-1 [283 kB] 85s Get:225 http://ftpmaster.internal/ubuntu resolute/main amd64 libevent-extra-2.1-7t64 amd64 2.1.12-stable-10build1 [68.1 kB] 85s Get:226 http://ftpmaster.internal/ubuntu resolute/main amd64 libevent-openssl-2.1-7t64 amd64 2.1.12-stable-10build1 [16.7 kB] 85s Get:227 http://ftpmaster.internal/ubuntu resolute/main amd64 libevent-dev amd64 2.1.12-stable-10build1 [288 kB] 85s Get:228 http://ftpmaster.internal/ubuntu resolute/main amd64 libjs-jquery all 3.6.1+dfsg+~3.5.14-1 [328 kB] 85s Get:229 http://ftpmaster.internal/ubuntu resolute/universe amd64 libjs-jquery-ui all 1.13.2+dfsg-1 [252 kB] 85s Get:230 http://ftpmaster.internal/ubuntu resolute/universe amd64 openmpi-bin amd64 5.0.8-8ubuntu1 [201 kB] 85s Get:231 http://ftpmaster.internal/ubuntu resolute/universe amd64 libopenmpi-dev amd64 5.0.8-8ubuntu1 [1226 kB] 85s Get:232 http://ftpmaster.internal/ubuntu resolute/universe amd64 mpi-default-dev amd64 1.19 [3384 B] 85s Get:233 http://ftpmaster.internal/ubuntu resolute/main amd64 libxxhash-dev amd64 0.8.3-2 [80.6 kB] 85s Get:234 http://ftpmaster.internal/ubuntu resolute/main amd64 libjemalloc-dev amd64 5.3.0-3build1 [531 kB] 85s Get:235 http://ftpmaster.internal/ubuntu resolute/main amd64 libsnappy-dev amd64 1.2.2-2 [45.2 kB] 85s Get:236 http://ftpmaster.internal/ubuntu resolute/main amd64 liblz4-dev amd64 1.10.0-6 [100 kB] 85s Get:237 http://ftpmaster.internal/ubuntu resolute/universe amd64 libeigen3-dev all 3.4.0-5 [1056 kB] 85s Get:238 http://ftpmaster.internal/ubuntu resolute/universe amd64 libopenblas-pthread-dev amd64 0.3.30+ds-3 [5107 kB] 86s Get:239 http://ftpmaster.internal/ubuntu resolute/universe amd64 libopenblas-dev amd64 0.3.30+ds-3 [21.3 kB] 86s Get:240 http://ftpmaster.internal/ubuntu resolute/universe amd64 libeckit-dev amd64 1.32.3-1 [273 kB] 86s Get:241 http://ftpmaster.internal/ubuntu resolute/main amd64 libx11-xcb1 amd64 2:1.8.12-1build1 [8044 B] 86s Get:242 http://ftpmaster.internal/ubuntu resolute/main amd64 libxcb-dri3-0 amd64 1.17.0-2build1 [8036 B] 86s Get:243 http://ftpmaster.internal/ubuntu resolute/main amd64 libxcb-present0 amd64 1.17.0-2build1 [6446 B] 86s Get:244 http://ftpmaster.internal/ubuntu resolute/main amd64 libxcb-randr0 amd64 1.17.0-2build1 [19.7 kB] 86s Get:245 http://ftpmaster.internal/ubuntu resolute/main amd64 libxcb-sync1 amd64 1.17.0-2build1 [10.1 kB] 86s Get:246 http://ftpmaster.internal/ubuntu resolute/main amd64 libxcb-xfixes0 amd64 1.17.0-2build1 [11.1 kB] 86s Get:247 http://ftpmaster.internal/ubuntu resolute/main amd64 libxshmfence1 amd64 1.3.3-1 [5262 B] 86s Get:248 http://ftpmaster.internal/ubuntu resolute/main amd64 mesa-libgallium amd64 25.2.6-1ubuntu1 [11.1 MB] 86s Get:249 http://ftpmaster.internal/ubuntu resolute/main amd64 libgbm1 amd64 25.2.6-1ubuntu1 [34.0 kB] 86s Get:250 http://ftpmaster.internal/ubuntu resolute/main amd64 libwayland-client0 amd64 1.24.0-2 [28.5 kB] 86s Get:251 http://ftpmaster.internal/ubuntu resolute/main amd64 libegl-mesa0 amd64 25.2.6-1ubuntu1 [117 kB] 86s Get:252 http://ftpmaster.internal/ubuntu resolute/universe amd64 libgeos3.13.1 amd64 3.13.1-1 [1017 kB] 86s Get:253 http://ftpmaster.internal/ubuntu resolute/universe amd64 libgeos-c1t64 amd64 3.13.1-1 [103 kB] 86s Get:254 http://ftpmaster.internal/ubuntu resolute/universe amd64 libgeotiff5 amd64 1.7.4-1 [60.2 kB] 86s Get:255 http://ftpmaster.internal/ubuntu resolute/main amd64 libvulkan1 amd64 1.4.328.1-1 [156 kB] 86s Get:256 http://ftpmaster.internal/ubuntu resolute/main amd64 libgl1-mesa-dri amd64 25.2.6-1ubuntu1 [37.0 kB] 86s Get:257 http://ftpmaster.internal/ubuntu resolute/main amd64 libxcb-glx0 amd64 1.17.0-2build1 [27.6 kB] 86s Get:258 http://ftpmaster.internal/ubuntu resolute/main amd64 libxxf86vm1 amd64 1:1.1.4-2 [10.6 kB] 86s Get:259 http://ftpmaster.internal/ubuntu resolute/main amd64 libglx-mesa0 amd64 25.2.6-1ubuntu1 [110 kB] 86s Get:260 http://ftpmaster.internal/ubuntu resolute/main amd64 libgraphite2-3 amd64 1.3.14-2ubuntu1 [73.1 kB] 86s Get:261 http://ftpmaster.internal/ubuntu resolute/main amd64 libharfbuzz0b amd64 12.1.0-1 [535 kB] 86s Get:262 http://ftpmaster.internal/ubuntu resolute/universe amd64 libhdf5-310 amd64 1.14.5+repack-4 [1432 kB] 86s Get:263 http://ftpmaster.internal/ubuntu resolute/universe amd64 libhdf5-hl-310 amd64 1.14.5+repack-4 [59.8 kB] 86s Get:264 http://ftpmaster.internal/ubuntu resolute/main amd64 libimagequant0 amd64 2.18.0-1build1 [36.3 kB] 86s Get:265 http://ftpmaster.internal/ubuntu resolute/main amd64 libwacom-common all 2.16.1-1 [113 kB] 86s Get:266 http://ftpmaster.internal/ubuntu resolute/main amd64 libwacom9 amd64 2.16.1-1 [28.3 kB] 86s Get:267 http://ftpmaster.internal/ubuntu resolute/main amd64 libinput-bin amd64 1.28.1-1ubuntu2 [24.1 kB] 86s Get:268 http://ftpmaster.internal/ubuntu resolute/main amd64 libmtdev1t64 amd64 1.1.7-1 [16.3 kB] 86s Get:269 http://ftpmaster.internal/ubuntu resolute/main amd64 libinput10 amd64 1.28.1-1ubuntu2 [145 kB] 86s Get:270 http://ftpmaster.internal/ubuntu resolute/main amd64 libjs-underscore all 1.13.4~dfsg+~1.11.4-3 [118 kB] 86s Get:271 http://ftpmaster.internal/ubuntu resolute/main amd64 libjs-sphinxdoc all 8.2.3-1ubuntu2 [28.0 kB] 86s Get:272 http://ftpmaster.internal/ubuntu resolute/universe amd64 libjs-sprintf-js all 1.1.2+ds1+~1.1.2-1 [12.8 kB] 86s Get:273 http://ftpmaster.internal/ubuntu resolute/main amd64 libjson-perl all 4.10000-1 [81.9 kB] 86s Get:274 http://ftpmaster.internal/ubuntu resolute/main amd64 liblcms2-2 amd64 2.17-1 [170 kB] 86s Get:275 http://ftpmaster.internal/ubuntu resolute/main amd64 liblua5.4-0 amd64 5.4.8-1 [174 kB] 86s Get:276 http://ftpmaster.internal/ubuntu resolute/universe amd64 liblzf1 amd64 3.6-4 [7624 B] 86s Get:277 http://ftpmaster.internal/ubuntu resolute/universe amd64 libmagics++-data all 4.16.0+really4.16.0-2 [41.0 MB] 88s Get:278 http://ftpmaster.internal/ubuntu resolute/universe amd64 libnetcdf22 amd64 1:4.9.3-1build1 [561 kB] 88s Get:279 http://ftpmaster.internal/ubuntu resolute/universe amd64 libodc-0d amd64 1.6.2-2 [429 kB] 88s Get:280 http://ftpmaster.internal/ubuntu resolute/main amd64 libthai-data all 0.1.29-2build1 [158 kB] 88s Get:281 http://ftpmaster.internal/ubuntu resolute/main amd64 libthai0 amd64 0.1.29-2build1 [18.9 kB] 88s Get:282 http://ftpmaster.internal/ubuntu resolute/main amd64 libpango-1.0-0 amd64 1.56.3-2 [239 kB] 88s Get:283 http://ftpmaster.internal/ubuntu resolute/main amd64 libpangoft2-1.0-0 amd64 1.56.3-2 [52.5 kB] 88s Get:284 http://ftpmaster.internal/ubuntu resolute/main amd64 libpangocairo-1.0-0 amd64 1.56.3-2 [29.0 kB] 88s Get:285 http://ftpmaster.internal/ubuntu resolute/main amd64 libpcre2-16-0 amd64 10.46-1 [243 kB] 88s Get:286 http://ftpmaster.internal/ubuntu resolute/universe amd64 libqt6core6t64 amd64 6.9.2+dfsg-3ubuntu1 [2049 kB] 88s Get:287 http://ftpmaster.internal/ubuntu resolute/main amd64 libglvnd0 amd64 1.7.0-1build2 [65.1 kB] 88s Get:288 http://ftpmaster.internal/ubuntu resolute/main amd64 libegl1 amd64 1.7.0-1build2 [31.2 kB] 88s Get:289 http://ftpmaster.internal/ubuntu resolute/main amd64 libglx0 amd64 1.7.0-1build2 [40.3 kB] 88s Get:290 http://ftpmaster.internal/ubuntu resolute/universe amd64 libmd4c0 amd64 0.5.2-2 [50.1 kB] 88s Get:291 http://ftpmaster.internal/ubuntu resolute/main amd64 libopengl0 amd64 1.7.0-1build2 [32.6 kB] 88s Get:292 http://ftpmaster.internal/ubuntu resolute/universe amd64 libqt6dbus6 amd64 6.9.2+dfsg-3ubuntu1 [278 kB] 88s Get:293 http://ftpmaster.internal/ubuntu resolute/universe amd64 libts0t64 amd64 1.22-1.1build1 [63.8 kB] 88s Get:294 http://ftpmaster.internal/ubuntu resolute/main amd64 libxcb-util1 amd64 0.4.1-1 [11.2 kB] 88s Get:295 http://ftpmaster.internal/ubuntu resolute/universe amd64 libxcb-image0 amd64 0.4.0-2build1 [10.8 kB] 88s Get:296 http://ftpmaster.internal/ubuntu resolute/universe amd64 libxcb-render-util0 amd64 0.3.10-1 [10.8 kB] 88s Get:297 http://ftpmaster.internal/ubuntu resolute/universe amd64 libxcb-cursor0 amd64 0.1.5-1 [10.8 kB] 88s Get:298 http://ftpmaster.internal/ubuntu resolute/universe amd64 libxcb-icccm4 amd64 0.4.2-1 [11.1 kB] 88s Get:299 http://ftpmaster.internal/ubuntu resolute/universe amd64 libxcb-keysyms1 amd64 0.4.1-1 [8738 B] 88s Get:300 http://ftpmaster.internal/ubuntu resolute/main amd64 libxcb-shape0 amd64 1.17.0-2build1 [6544 B] 88s Get:301 http://ftpmaster.internal/ubuntu resolute/main amd64 libxcb-xinput0 amd64 1.17.0-2build1 [36.7 kB] 88s Get:302 http://ftpmaster.internal/ubuntu resolute/main amd64 libxcb-xkb1 amd64 1.17.0-2build1 [35.3 kB] 88s Get:303 http://ftpmaster.internal/ubuntu resolute/main amd64 libxkbcommon-x11-0 amd64 1.12.3-1 [15.0 kB] 88s Get:304 http://ftpmaster.internal/ubuntu resolute/universe amd64 libqt6gui6 amd64 6.9.2+dfsg-3ubuntu1 [3505 kB] 88s Get:305 http://ftpmaster.internal/ubuntu resolute/universe amd64 libqt6widgets6 amd64 6.9.2+dfsg-3ubuntu1 [2844 kB] 88s Get:306 http://ftpmaster.internal/ubuntu resolute/main amd64 mysql-common all 5.8+1.1.1ubuntu1 [6922 B] 88s Get:307 http://ftpmaster.internal/ubuntu resolute/main amd64 libmysqlclient24 amd64 8.4.7-0ubuntu2 [1258 kB] 88s Get:308 http://ftpmaster.internal/ubuntu resolute/main amd64 libpq5 amd64 18.1-1 [275 kB] 88s Get:309 http://ftpmaster.internal/ubuntu resolute/universe amd64 libterralib3t64 amd64 4.3.0+dfsg.2-12.2build2 [2598 kB] 88s Get:310 http://ftpmaster.internal/ubuntu resolute/universe amd64 libmagplus3v5 amd64 4.16.0+really4.16.0-2 [2723 kB] 88s Get:311 http://ftpmaster.internal/ubuntu resolute/universe amd64 libmagics++-metview-dev amd64 4.16.0+really4.16.0-2 [936 kB] 88s Get:312 http://ftpmaster.internal/ubuntu resolute/universe amd64 libterralib-dev amd64 4.3.0+dfsg.2-12.2build2 [4009 kB] 89s Get:313 http://ftpmaster.internal/ubuntu resolute/universe amd64 magics++ amd64 4.16.0+really4.16.0-2 [33.9 kB] 89s Get:314 http://ftpmaster.internal/ubuntu resolute/universe amd64 odc amd64 1.6.2-2 [9210 B] 89s Get:315 http://ftpmaster.internal/ubuntu resolute/universe amd64 libodc-dev amd64 1.6.2-2 [67.7 kB] 89s Get:316 http://ftpmaster.internal/ubuntu resolute/universe amd64 libmagics++-dev amd64 4.16.0+really4.16.0-2 [83.8 kB] 89s Get:317 http://ftpmaster.internal/ubuntu resolute/universe amd64 node-xtend all 4.0.2-3 [3902 B] 89s Get:318 http://ftpmaster.internal/ubuntu resolute/universe amd64 node-corepack all 0.24.0-5 [757 kB] 89s Get:319 http://ftpmaster.internal/ubuntu resolute/universe amd64 nodejs amd64 20.19.4+dfsg-1 [342 kB] 89s Get:320 http://ftpmaster.internal/ubuntu resolute/universe amd64 node-acorn all 8.8.1+ds+~cs25.17.7-2 [115 kB] 89s Get:321 http://ftpmaster.internal/ubuntu resolute/universe amd64 node-cjs-module-lexer all 1.2.3+dfsg-1 [32.1 kB] 89s Get:322 http://ftpmaster.internal/ubuntu resolute/universe amd64 node-balanced-match all 2.0.0-1 [4910 B] 89s Get:323 http://ftpmaster.internal/ubuntu resolute/universe amd64 node-brace-expansion all 2.0.1+~1.1.0-2 [8172 B] 89s Get:324 http://ftpmaster.internal/ubuntu resolute/universe amd64 node-minimatch all 9.0.3-6 [78.0 kB] 89s Get:325 http://ftpmaster.internal/ubuntu resolute/universe amd64 node-ms all 2.1.3+~cs0.7.31-3 [5738 B] 89s Get:326 http://ftpmaster.internal/ubuntu resolute/universe amd64 node-debug all 4.4.1+~4.1.12-1 [17.7 kB] 89s Get:327 http://ftpmaster.internal/ubuntu resolute/universe amd64 node-lru-cache all 10.0.1-3 [61.9 kB] 89s Get:328 http://ftpmaster.internal/ubuntu resolute/universe amd64 node-semver all 7.6.1+~7.5.8-2 [45.2 kB] 89s Get:329 http://ftpmaster.internal/ubuntu resolute/universe amd64 node-llhttp all 9.3.3~really9.3.0+~cs12.11.8-3 [158 kB] 89s Get:330 http://ftpmaster.internal/ubuntu resolute/universe amd64 node-undici all 7.16.0+dfsg+~cs3.2.0-2 [380 kB] 89s Get:331 http://ftpmaster.internal/ubuntu resolute/universe amd64 libnode115 amd64 20.19.4+dfsg-1 [14.0 MB] 89s Get:332 http://ftpmaster.internal/ubuntu resolute/universe amd64 libnorm1t64 amd64 1.5.9+dfsg-4 [158 kB] 89s Get:333 http://ftpmaster.internal/ubuntu resolute/universe amd64 libpgm-5.3-0t64 amd64 5.3.128~dfsg-2.1build1 [167 kB] 89s Get:334 http://ftpmaster.internal/ubuntu resolute/main amd64 libpython3.14-stdlib amd64 3.14.0-4 [2397 kB] 89s Get:335 http://ftpmaster.internal/ubuntu resolute/main amd64 libraqm0 amd64 0.10.3-1 [15.4 kB] 89s Get:336 http://ftpmaster.internal/ubuntu resolute/main amd64 libsodium23 amd64 1.0.18-1build3 [161 kB] 89s Get:337 http://ftpmaster.internal/ubuntu resolute/main amd64 libwebpdemux2 amd64 1.5.0-0.1 [13.0 kB] 89s Get:338 http://ftpmaster.internal/ubuntu resolute/main amd64 libwebpmux3 amd64 1.5.0-0.1 [27.6 kB] 89s Get:339 http://ftpmaster.internal/ubuntu resolute/main amd64 libxslt1.1 amd64 1.1.43-0.3 [172 kB] 89s Get:340 http://ftpmaster.internal/ubuntu resolute/universe amd64 libzmq5 amd64 4.3.5-1build2 [260 kB] 89s Get:341 http://ftpmaster.internal/ubuntu resolute/universe amd64 libzopfli1 amd64 1.0.3-3 [141 kB] 89s Get:342 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-mypy-extensions all 1.1.0-1 [6716 B] 89s Get:343 http://ftpmaster.internal/ubuntu resolute/main amd64 python3-psutil amd64 7.1.0-1ubuntu1 [191 kB] 89s Get:344 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-mypy amd64 1.15.0-5 [9215 kB] 90s Get:345 http://ftpmaster.internal/ubuntu resolute/universe amd64 mypy all 1.15.0-5 [25.4 kB] 90s Get:346 http://ftpmaster.internal/ubuntu resolute/universe amd64 node-esprima all 4.0.1+ds+~4.0.3-2 [69.3 kB] 90s Get:347 http://ftpmaster.internal/ubuntu resolute/universe amd64 node-fortawesome-fontawesome-free all 6.7.2+ds1-1 [1653 kB] 90s Get:348 http://ftpmaster.internal/ubuntu resolute/universe amd64 node-sprintf-js all 1.1.2+ds1+~1.1.2-1 [3916 B] 90s Get:349 http://ftpmaster.internal/ubuntu resolute/universe amd64 node-argparse all 2.0.1-2 [33.2 kB] 90s Get:350 http://ftpmaster.internal/ubuntu resolute/universe amd64 node-js-yaml all 4.1.0+dfsg+~4.0.5-7 [61.9 kB] 90s Get:351 http://ftpmaster.internal/ubuntu resolute/universe amd64 pandoc-data all 3.1.11.1-3build1 [78.8 kB] 90s Get:352 http://ftpmaster.internal/ubuntu resolute/universe amd64 pandoc amd64 3.1.11.1+ds-4 [27.2 MB] 91s Get:353 http://ftpmaster.internal/ubuntu resolute/universe amd64 pybuild-plugin-autopkgtest all 6.20250414 [1746 B] 91s Get:354 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-pyproject-hooks all 1.2.0-1 [10.2 kB] 91s Get:355 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-wheel all 0.46.1-2 [22.1 kB] 91s Get:356 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-build all 1.2.2-4 [31.0 kB] 91s Get:357 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-installer all 0.7.0+dfsg1-3 [17.4 kB] 91s Get:358 http://ftpmaster.internal/ubuntu resolute/universe amd64 pybuild-plugin-pyproject all 6.20250414 [1728 B] 91s Get:359 http://ftpmaster.internal/ubuntu resolute/universe amd64 python-cartopy-data all 0.25.0+dfsg-1 [6537 kB] 91s Get:360 http://ftpmaster.internal/ubuntu resolute/main amd64 libjs-mathjax all 2.7.9+dfsg-1 [5665 kB] 91s Get:361 http://ftpmaster.internal/ubuntu resolute/universe amd64 python-dask-doc all 2024.12.1+dfsg-2 [10.4 MB] 91s Get:362 http://ftpmaster.internal/ubuntu resolute/universe amd64 python-matplotlib-data all 3.10.7+dfsg1-1 [2930 kB] 92s Get:363 http://ftpmaster.internal/ubuntu resolute/universe amd64 python-pandas-doc all 2.3.3+dfsg-1ubuntu1 [14.1 MB] 92s Get:364 http://ftpmaster.internal/ubuntu resolute/universe amd64 python-tinycss2-common all 1.4.0-2 [47.0 kB] 92s Get:365 http://ftpmaster.internal/ubuntu resolute/universe amd64 libjs-requirejs all 2.3.7+ds+~2.1.37-1 [201 kB] 92s Get:366 http://ftpmaster.internal/ubuntu resolute/universe amd64 python-xarray-doc all 2025.03.1-8 [5284 kB] 92s Get:367 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-accessible-pygments all 0.0.5-2 [790 kB] 92s Get:368 http://ftpmaster.internal/ubuntu resolute/main amd64 python3.14 amd64 3.14.0-4 [805 kB] 92s Get:369 http://ftpmaster.internal/ubuntu resolute-proposed/main amd64 python3-all amd64 3.13.7-2 [890 B] 92s Get:370 http://ftpmaster.internal/ubuntu resolute/main amd64 python3-defusedxml all 0.7.1-3 [42.2 kB] 92s Get:371 http://ftpmaster.internal/ubuntu resolute/main amd64 sphinx-common all 8.2.3-1ubuntu2 [656 kB] 92s Get:372 http://ftpmaster.internal/ubuntu resolute/main amd64 python3-alabaster all 0.7.16-0.1 [18.5 kB] 92s Get:373 http://ftpmaster.internal/ubuntu resolute/main amd64 python3-roman all 5.1-1 [10.6 kB] 92s Get:374 http://ftpmaster.internal/ubuntu resolute/main amd64 python3-docutils all 0.21.2+dfsg-2 [409 kB] 92s Get:375 http://ftpmaster.internal/ubuntu resolute/main amd64 python3-imagesize all 1.4.1-1 [6844 B] 92s Get:376 http://ftpmaster.internal/ubuntu resolute/main amd64 python3-snowballstemmer all 3.0.1-1 [65.9 kB] 92s Get:377 http://ftpmaster.internal/ubuntu resolute/main amd64 python3-sphinx all 8.2.3-1ubuntu2 [482 kB] 92s Get:378 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-autodocsumm all 0.2.14-2 [11.9 kB] 92s Get:379 http://ftpmaster.internal/ubuntu resolute/main amd64 python3-webencodings all 0.5.1-5 [11.5 kB] 92s Get:380 http://ftpmaster.internal/ubuntu resolute/main amd64 python3-html5lib all 1.2-2 [90.6 kB] 92s Get:381 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-bleach all 6.2.0-1 [43.9 kB] 92s Get:382 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-bottleneck amd64 1.4.2+ds1-2build2 [99.0 kB] 92s Get:383 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-brotli amd64 1.1.0-2build6 [340 kB] 92s Get:384 http://ftpmaster.internal/ubuntu resolute/main amd64 python3-soupsieve all 2.7-2 [33.6 kB] 92s Get:385 http://ftpmaster.internal/ubuntu resolute/main amd64 python3-bs4 all 4.13.4-3 [137 kB] 92s Get:386 http://ftpmaster.internal/ubuntu resolute/main amd64 python3-pil amd64 11.3.0-1ubuntu2 [504 kB] 92s Get:387 http://ftpmaster.internal/ubuntu resolute/main amd64 python3.14-tk amd64 3.14.0-4 [108 kB] 92s Get:388 http://ftpmaster.internal/ubuntu resolute/main amd64 python3.13-tk amd64 3.13.9-1 [108 kB] 92s Get:389 http://ftpmaster.internal/ubuntu resolute/main amd64 python3-tk amd64 3.13.9-1 [8946 B] 92s Get:390 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-pil.imagetk amd64 11.3.0-1ubuntu2 [9804 B] 92s Get:391 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-contourpy amd64 1.3.1-2 [255 kB] 92s Get:392 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-cycler all 0.12.1-2 [9850 B] 92s Get:393 http://ftpmaster.internal/ubuntu resolute/main amd64 python3-platformdirs all 4.3.7-1 [16.9 kB] 92s Get:394 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-fs all 2.4.16-9ubuntu1 [91.5 kB] 92s Get:395 http://ftpmaster.internal/ubuntu resolute/main amd64 python3-lxml amd64 6.0.2-1 [2333 kB] 93s Get:396 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-lz4 amd64 4.4.4+dfsg-3 [27.5 kB] 93s Get:397 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-scipy amd64 1.15.3-1ubuntu1 [20.3 MB] 95s Get:398 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-mpmath all 1.3.0-2 [423 kB] 95s Get:399 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-sympy all 1.14.0-2 [4306 kB] 96s Get:400 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-ufolib2 all 0.17.1+dfsg1-1 [33.5 kB] 96s Get:401 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-zopfli amd64 0.4.0-1 [11.1 kB] 96s Get:402 http://ftpmaster.internal/ubuntu resolute/universe amd64 unicode-data all 16.0.0-1 [9513 kB] 96s Get:403 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-fonttools amd64 4.57.0-2build1 [1731 kB] 96s Get:404 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-kiwisolver amd64 1.4.10~rc0-1 [65.5 kB] 97s Get:405 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-matplotlib amd64 3.10.7+dfsg1-1 [17.2 MB] 97s Get:406 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-pyproj amd64 3.7.2-1 [637 kB] 97s Get:407 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-pyshp all 2.3.1-3 [61.8 kB] 97s Get:408 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-shapely amd64 2.1.2-1 [408 kB] 97s Get:409 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-cartopy amd64 0.25.0+dfsg-1 [533 kB] 97s Get:410 http://ftpmaster.internal/ubuntu resolute/main amd64 python3-ply all 3.11-9 [45.8 kB] 97s Get:411 http://ftpmaster.internal/ubuntu resolute/main amd64 python3-pycparser all 2.23-1 [77.2 kB] 97s Get:412 http://ftpmaster.internal/ubuntu resolute/main amd64 python3-cffi all 2.0.0-2 [75.5 kB] 97s Get:413 http://ftpmaster.internal/ubuntu resolute/main amd64 python3-click all 8.2.0+0.really.8.1.8-1 [80.0 kB] 97s Get:414 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-findlibs amd64 0.0.5-1build1 [3844 B] 97s Get:415 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-ecmwflibs amd64 2:0.6.3-2build2 [8604 B] 97s Get:416 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-eccodes amd64 2:2.43.0-1 [33.1 kB] 97s Get:417 http://ftpmaster.internal/ubuntu resolute/main amd64 python3-pytz all 2025.2-4 [32.3 kB] 97s Get:418 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-pandas-lib amd64 2.3.3+dfsg-1ubuntu1 [7668 kB] 98s Get:419 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-pandas all 2.3.3+dfsg-1ubuntu1 [2948 kB] 98s Get:420 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-xarray all 2025.03.1-8 [831 kB] 98s Get:421 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-cfgrib amd64 0.9.15.1-1 [50.2 kB] 98s Get:422 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-cftime amd64 1.6.5-1 [521 kB] 98s Get:423 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-cloudpickle all 3.1.1-1 [22.4 kB] 98s Get:424 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-comm all 0.2.1-1 [7016 B] 98s Get:425 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-coverage amd64 7.8.2+dfsg1-1 [157 kB] 98s Get:426 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-crc32c amd64 2.7.1-1build1 [24.7 kB] 98s Get:427 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-fsspec all 2025.3.2-1ubuntu1 [217 kB] 98s Get:428 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-toolz all 1.0.0-2 [45.0 kB] 98s Get:429 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-locket all 1.0.0-2 [5872 B] 98s Get:430 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-partd all 1.4.2-1 [15.7 kB] 98s Get:431 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-dask all 2024.12.1+dfsg-2 [875 kB] 98s Get:432 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-debugpy amd64 1.8.12+ds-1ubuntu1 [778 kB] 98s Get:433 http://ftpmaster.internal/ubuntu resolute/main amd64 python3.13-doc all 3.13.9-1 [14.3 MB] 98s Get:434 http://ftpmaster.internal/ubuntu resolute-proposed/main amd64 python3-doc all 3.13.7-2 [10.8 kB] 98s Get:435 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-donfig all 0.8.1+dfsg-3 [17.3 kB] 98s Get:436 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-execnet all 2.1.1-1 [33.4 kB] 98s Get:437 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-fastjsonschema all 2.21.1-1 [20.4 kB] 98s Get:438 http://ftpmaster.internal/ubuntu resolute/main amd64 python3-flexcache all 0.3-2 [13.4 kB] 98s Get:439 http://ftpmaster.internal/ubuntu resolute/main amd64 python3-flexparser all 0.4-1 [43.8 kB] 98s Get:440 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-h5py-serial amd64 3.13.0-1ubuntu1 [1184 kB] 98s Get:441 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-h5py all 3.13.0-1ubuntu1 [8230 B] 98s Get:442 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-h5netcdf all 1.6.1-1 [46.7 kB] 98s Get:443 http://ftpmaster.internal/ubuntu resolute/main amd64 python3-sortedcontainers all 2.4.0-2 [27.6 kB] 98s Get:444 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-hypothesis all 6.130.5-2 [341 kB] 98s Get:445 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-iniconfig all 2.1.0-1 [6840 B] 98s Get:446 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-jupyter-core all 5.7.2-5 [28.1 kB] 98s Get:447 http://ftpmaster.internal/ubuntu resolute/main amd64 python3-tornado amd64 6.5.2-3 [304 kB] 98s Get:448 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-zmq amd64 27.1.0-1 [234 kB] 98s Get:449 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-jupyter-client all 8.6.3-3 [78.4 kB] 98s Get:450 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-nest-asyncio all 1.5.4-1 [6256 B] 98s Get:451 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-ipykernel all 6.29.5-2 [82.7 kB] 98s Get:452 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-jupyter-console all 6.6.3-2 [21.6 kB] 98s Get:453 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-jupyterlab-pygments all 0.2.2-3 [6054 B] 98s Get:454 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-mistune all 3.1.4-1 [35.0 kB] 98s Get:455 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-nbformat all 5.9.1-1 [41.2 kB] 98s Get:456 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-nbclient all 0.8.0-2 [53.9 kB] 98s Get:457 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-tinycss2 all 1.4.0-2 [22.5 kB] 98s Get:458 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-pandocfilters all 1.5.1-1 [23.6 kB] 98s Get:459 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-nbconvert all 7.16.6-1 [140 kB] 98s Get:460 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-nbsphinx all 0.9.5+ds-1 [41.0 kB] 98s Get:461 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-netcdf4 amd64 1.7.2-1build4 [667 kB] 98s Get:462 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-pydata-sphinx-theme all 0.16.1+dfsg-3 [959 kB] 98s Get:463 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-numcodecs amd64 0.16.3+ds-1 [509 kB] 98s Get:464 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-numpydoc all 1.9.0-1 [53.2 kB] 98s Get:465 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-pickleshare all 0.7.5-5 [7570 B] 98s Get:466 http://ftpmaster.internal/ubuntu resolute/main amd64 python3-pint all 0.24.4-2 [203 kB] 99s Get:467 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-pip all 25.1.1+dfsg-1ubuntu2 [1416 kB] 99s Get:468 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-pluggy all 1.6.0-1 [21.0 kB] 99s Get:469 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-pooch all 1.8.2-1 [49.9 kB] 99s Get:470 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-pytest all 8.3.5-2 [252 kB] 99s Get:471 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-regex amd64 0.1.20250918-1 [310 kB] 99s Get:472 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-tomlkit all 0.13.3-2 [39.1 kB] 99s Get:473 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-pytest-mypy all 3.2.0-2 [21.6 kB] 99s Get:474 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-pytest-xdist all 3.8.0-2 [34.6 kB] 99s Get:475 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-seaborn all 0.13.2-5 [225 kB] 99s Get:476 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-setuptools-scm all 8.2.1-3 [32.7 kB] 99s Get:477 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-sphinx-book-theme all 1.1.4-2 [83.3 kB] 99s Get:478 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-sphinx-copybutton all 0.5.2-3 [16.7 kB] 99s Get:479 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-sphinx-design all 0.6.1-2 [894 kB] 99s Get:480 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-sphinx-gallery all 0.17.1-1 [334 kB] 99s Get:481 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-sphinx-inline-tabs all 2023.4.21-3 [39.2 kB] 99s Get:482 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-sphinx-remove-toctrees all 1.0.0-1 [6198 B] 99s Get:483 http://ftpmaster.internal/ubuntu resolute/main amd64 sphinx-rtd-theme-common all 3.0.2+dfsg-3 [1013 kB] 99s Get:484 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-sphinxcontrib.jquery all 4.1-6 [6856 B] 99s Get:485 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-sphinx-rtd-theme all 3.0.2+dfsg-3 [23.5 kB] 99s Get:486 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-sphinxcontrib-mermaid all 1.0.0-1 [4844 kB] 99s Get:487 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-sphinxext-opengraph all 0.12.0-1 [873 kB] 99s Get:488 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-sphinxext-rediraffe all 0.3.0-1 [8414 B] 99s Get:489 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-zarr all 3.1.3-1 [2192 kB] 99s Get:490 http://ftpmaster.internal/ubuntu resolute/main amd64 tzdata-legacy all 2025b-5ubuntu1 [99.3 kB] 99s Get:491 http://ftpmaster.internal/ubuntu resolute/universe amd64 python-hypothesis-doc all 6.130.5-2 [563 kB] 99s Get:492 http://ftpmaster.internal/ubuntu resolute/universe amd64 python-scipy-doc all 1.15.3-1ubuntu1 [26.6 kB] 100s Preconfiguring packages ... 100s Fetched 601 MB in 21s (29.2 MB/s) 100s Selecting previously unselected package fonts-lato. 100s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 83372 files and directories currently installed.) 100s Preparing to unpack .../000-fonts-lato_2.015-1_all.deb ... 100s Unpacking fonts-lato (2.015-1) ... 100s Selecting previously unselected package poppler-data. 100s Preparing to unpack .../001-poppler-data_0.4.12-1_all.deb ... 100s Unpacking poppler-data (0.4.12-1) ... 100s Selecting previously unselected package python3-numpy-dev:amd64. 100s Preparing to unpack .../002-python3-numpy-dev_1%3a2.3.4+ds-3ubuntu1_amd64.deb ... 100s Unpacking python3-numpy-dev:amd64 (1:2.3.4+ds-3ubuntu1) ... 100s Selecting previously unselected package libgfortran5:amd64. 100s Preparing to unpack .../003-libgfortran5_15.2.0-7ubuntu1_amd64.deb ... 100s Unpacking libgfortran5:amd64 (15.2.0-7ubuntu1) ... 100s Selecting previously unselected package libopenblas0-pthread:amd64. 100s Preparing to unpack .../004-libopenblas0-pthread_0.3.30+ds-3_amd64.deb ... 100s Unpacking libopenblas0-pthread:amd64 (0.3.30+ds-3) ... 100s Selecting previously unselected package python3-numpy. 100s Preparing to unpack .../005-python3-numpy_1%3a2.3.4+ds-3ubuntu1_amd64.deb ... 100s Unpacking python3-numpy (1:2.3.4+ds-3ubuntu1) ... 100s Selecting previously unselected package libpython3.14-minimal:amd64. 100s Preparing to unpack .../006-libpython3.14-minimal_3.14.0-4_amd64.deb ... 100s Unpacking libpython3.14-minimal:amd64 (3.14.0-4) ... 100s Selecting previously unselected package python3.14-minimal. 100s Preparing to unpack .../007-python3.14-minimal_3.14.0-4_amd64.deb ... 100s Unpacking python3.14-minimal (3.14.0-4) ... 100s Selecting previously unselected package m4. 100s Preparing to unpack .../008-m4_1.4.20-2_amd64.deb ... 100s Unpacking m4 (1.4.20-2) ... 100s Selecting previously unselected package autoconf. 100s Preparing to unpack .../009-autoconf_2.72-3.1ubuntu1_all.deb ... 100s Unpacking autoconf (2.72-3.1ubuntu1) ... 100s Selecting previously unselected package autotools-dev. 100s Preparing to unpack .../010-autotools-dev_20240727.1_all.deb ... 100s Unpacking autotools-dev (20240727.1) ... 100s Selecting previously unselected package automake. 100s Preparing to unpack .../011-automake_1%3a1.18.1-2_all.deb ... 100s Unpacking automake (1:1.18.1-2) ... 100s Selecting previously unselected package autopoint. 100s Preparing to unpack .../012-autopoint_0.23.2-1_all.deb ... 100s Unpacking autopoint (0.23.2-1) ... 100s Selecting previously unselected package libtcl8.6:amd64. 100s Preparing to unpack .../013-libtcl8.6_8.6.17+dfsg-1_amd64.deb ... 100s Unpacking libtcl8.6:amd64 (8.6.17+dfsg-1) ... 100s Selecting previously unselected package fonts-dejavu-mono. 100s Preparing to unpack .../014-fonts-dejavu-mono_2.37-8_all.deb ... 100s Unpacking fonts-dejavu-mono (2.37-8) ... 100s Selecting previously unselected package fonts-dejavu-core. 100s Preparing to unpack .../015-fonts-dejavu-core_2.37-8_all.deb ... 100s Unpacking fonts-dejavu-core (2.37-8) ... 100s Selecting previously unselected package libfontenc1:amd64. 100s Preparing to unpack .../016-libfontenc1_1%3a1.1.8-1build1_amd64.deb ... 100s Unpacking libfontenc1:amd64 (1:1.1.8-1build1) ... 100s Selecting previously unselected package x11-common. 100s Preparing to unpack .../017-x11-common_1%3a7.7+24ubuntu1_all.deb ... 100s Unpacking x11-common (1:7.7+24ubuntu1) ... 100s Selecting previously unselected package xfonts-encodings. 100s Preparing to unpack .../018-xfonts-encodings_1%3a1.0.5-0ubuntu2_all.deb ... 100s Unpacking xfonts-encodings (1:1.0.5-0ubuntu2) ... 100s Selecting previously unselected package xfonts-utils. 100s Preparing to unpack .../019-xfonts-utils_1%3a7.7+7_amd64.deb ... 100s Unpacking xfonts-utils (1:7.7+7) ... 100s Selecting previously unselected package fonts-urw-base35. 100s Preparing to unpack .../020-fonts-urw-base35_20200910-8_all.deb ... 100s Unpacking fonts-urw-base35 (20200910-8) ... 101s Selecting previously unselected package fontconfig-config. 101s Preparing to unpack .../021-fontconfig-config_2.15.0-2.3ubuntu1_amd64.deb ... 101s Unpacking fontconfig-config (2.15.0-2.3ubuntu1) ... 101s Selecting previously unselected package libfontconfig1:amd64. 101s Preparing to unpack .../022-libfontconfig1_2.15.0-2.3ubuntu1_amd64.deb ... 101s Unpacking libfontconfig1:amd64 (2.15.0-2.3ubuntu1) ... 101s Selecting previously unselected package libxrender1:amd64. 101s Preparing to unpack .../023-libxrender1_1%3a0.9.12-1_amd64.deb ... 101s Unpacking libxrender1:amd64 (1:0.9.12-1) ... 101s Selecting previously unselected package libxft2:amd64. 101s Preparing to unpack .../024-libxft2_2.3.6-1build1_amd64.deb ... 101s Unpacking libxft2:amd64 (2.3.6-1build1) ... 101s Selecting previously unselected package libxss1:amd64. 101s Preparing to unpack .../025-libxss1_1%3a1.2.3-1build3_amd64.deb ... 101s Unpacking libxss1:amd64 (1:1.2.3-1build3) ... 101s Selecting previously unselected package libtk8.6:amd64. 101s Preparing to unpack .../026-libtk8.6_8.6.17-1_amd64.deb ... 101s Unpacking libtk8.6:amd64 (8.6.17-1) ... 101s Selecting previously unselected package tk8.6-blt2.5. 101s Preparing to unpack .../027-tk8.6-blt2.5_2.5.3+dfsg-8_amd64.deb ... 101s Unpacking tk8.6-blt2.5 (2.5.3+dfsg-8) ... 101s Selecting previously unselected package blt. 101s Preparing to unpack .../028-blt_2.5.3+dfsg-8_amd64.deb ... 101s Unpacking blt (2.5.3+dfsg-8) ... 101s Selecting previously unselected package libisl23:amd64. 101s Preparing to unpack .../029-libisl23_0.27-1_amd64.deb ... 101s Unpacking libisl23:amd64 (0.27-1) ... 101s Selecting previously unselected package libmpc3:amd64. 101s Preparing to unpack .../030-libmpc3_1.3.1-2_amd64.deb ... 101s Unpacking libmpc3:amd64 (1.3.1-2) ... 101s Selecting previously unselected package cpp-15-x86-64-linux-gnu. 101s Preparing to unpack .../031-cpp-15-x86-64-linux-gnu_15.2.0-7ubuntu1_amd64.deb ... 101s Unpacking cpp-15-x86-64-linux-gnu (15.2.0-7ubuntu1) ... 101s Selecting previously unselected package cpp-15. 101s Preparing to unpack .../032-cpp-15_15.2.0-7ubuntu1_amd64.deb ... 101s Unpacking cpp-15 (15.2.0-7ubuntu1) ... 101s Selecting previously unselected package cpp-x86-64-linux-gnu. 101s Preparing to unpack .../033-cpp-x86-64-linux-gnu_4%3a15.2.0-4ubuntu1_amd64.deb ... 101s Unpacking cpp-x86-64-linux-gnu (4:15.2.0-4ubuntu1) ... 101s Selecting previously unselected package cpp. 101s Preparing to unpack .../034-cpp_4%3a15.2.0-4ubuntu1_amd64.deb ... 101s Unpacking cpp (4:15.2.0-4ubuntu1) ... 101s Selecting previously unselected package libcc1-0:amd64. 101s Preparing to unpack .../035-libcc1-0_15.2.0-7ubuntu1_amd64.deb ... 101s Unpacking libcc1-0:amd64 (15.2.0-7ubuntu1) ... 101s Selecting previously unselected package libgomp1:amd64. 101s Preparing to unpack .../036-libgomp1_15.2.0-7ubuntu1_amd64.deb ... 101s Unpacking libgomp1:amd64 (15.2.0-7ubuntu1) ... 101s Selecting previously unselected package libitm1:amd64. 101s Preparing to unpack .../037-libitm1_15.2.0-7ubuntu1_amd64.deb ... 101s Unpacking libitm1:amd64 (15.2.0-7ubuntu1) ... 101s Selecting previously unselected package libasan8:amd64. 101s Preparing to unpack .../038-libasan8_15.2.0-7ubuntu1_amd64.deb ... 101s Unpacking libasan8:amd64 (15.2.0-7ubuntu1) ... 101s Selecting previously unselected package liblsan0:amd64. 101s Preparing to unpack .../039-liblsan0_15.2.0-7ubuntu1_amd64.deb ... 101s Unpacking liblsan0:amd64 (15.2.0-7ubuntu1) ... 101s Selecting previously unselected package libtsan2:amd64. 101s Preparing to unpack .../040-libtsan2_15.2.0-7ubuntu1_amd64.deb ... 101s Unpacking libtsan2:amd64 (15.2.0-7ubuntu1) ... 101s Selecting previously unselected package libubsan1:amd64. 101s Preparing to unpack .../041-libubsan1_15.2.0-7ubuntu1_amd64.deb ... 101s Unpacking libubsan1:amd64 (15.2.0-7ubuntu1) ... 101s Selecting previously unselected package libhwasan0:amd64. 101s Preparing to unpack .../042-libhwasan0_15.2.0-7ubuntu1_amd64.deb ... 101s Unpacking libhwasan0:amd64 (15.2.0-7ubuntu1) ... 101s Selecting previously unselected package libquadmath0:amd64. 101s Preparing to unpack .../043-libquadmath0_15.2.0-7ubuntu1_amd64.deb ... 101s Unpacking libquadmath0:amd64 (15.2.0-7ubuntu1) ... 101s Selecting previously unselected package libgcc-15-dev:amd64. 101s Preparing to unpack .../044-libgcc-15-dev_15.2.0-7ubuntu1_amd64.deb ... 101s Unpacking libgcc-15-dev:amd64 (15.2.0-7ubuntu1) ... 101s Selecting previously unselected package gcc-15-x86-64-linux-gnu. 101s Preparing to unpack .../045-gcc-15-x86-64-linux-gnu_15.2.0-7ubuntu1_amd64.deb ... 101s Unpacking gcc-15-x86-64-linux-gnu (15.2.0-7ubuntu1) ... 102s Selecting previously unselected package gcc-15. 102s Preparing to unpack .../046-gcc-15_15.2.0-7ubuntu1_amd64.deb ... 102s Unpacking gcc-15 (15.2.0-7ubuntu1) ... 102s Selecting previously unselected package gcc-x86-64-linux-gnu. 102s Preparing to unpack .../047-gcc-x86-64-linux-gnu_4%3a15.2.0-4ubuntu1_amd64.deb ... 102s Unpacking gcc-x86-64-linux-gnu (4:15.2.0-4ubuntu1) ... 102s Selecting previously unselected package gcc. 102s Preparing to unpack .../048-gcc_4%3a15.2.0-4ubuntu1_amd64.deb ... 102s Unpacking gcc (4:15.2.0-4ubuntu1) ... 102s Selecting previously unselected package libstdc++-15-dev:amd64. 102s Preparing to unpack .../049-libstdc++-15-dev_15.2.0-7ubuntu1_amd64.deb ... 102s Unpacking libstdc++-15-dev:amd64 (15.2.0-7ubuntu1) ... 102s Selecting previously unselected package g++-15-x86-64-linux-gnu. 102s Preparing to unpack .../050-g++-15-x86-64-linux-gnu_15.2.0-7ubuntu1_amd64.deb ... 102s Unpacking g++-15-x86-64-linux-gnu (15.2.0-7ubuntu1) ... 102s Selecting previously unselected package g++-15. 102s Preparing to unpack .../051-g++-15_15.2.0-7ubuntu1_amd64.deb ... 102s Unpacking g++-15 (15.2.0-7ubuntu1) ... 102s Selecting previously unselected package g++-x86-64-linux-gnu. 102s Preparing to unpack .../052-g++-x86-64-linux-gnu_4%3a15.2.0-4ubuntu1_amd64.deb ... 102s Unpacking g++-x86-64-linux-gnu (4:15.2.0-4ubuntu1) ... 102s Selecting previously unselected package g++. 102s Preparing to unpack .../053-g++_4%3a15.2.0-4ubuntu1_amd64.deb ... 102s Unpacking g++ (4:15.2.0-4ubuntu1) ... 102s Selecting previously unselected package build-essential. 102s Preparing to unpack .../054-build-essential_12.12ubuntu1_amd64.deb ... 102s Unpacking build-essential (12.12ubuntu1) ... 102s Selecting previously unselected package gcc-14-base:amd64. 102s Preparing to unpack .../055-gcc-14-base_14.3.0-10ubuntu1_amd64.deb ... 102s Unpacking gcc-14-base:amd64 (14.3.0-10ubuntu1) ... 102s Selecting previously unselected package cpp-14-x86-64-linux-gnu. 102s Preparing to unpack .../056-cpp-14-x86-64-linux-gnu_14.3.0-10ubuntu1_amd64.deb ... 102s Unpacking cpp-14-x86-64-linux-gnu (14.3.0-10ubuntu1) ... 102s Selecting previously unselected package cpp-14. 102s Preparing to unpack .../057-cpp-14_14.3.0-10ubuntu1_amd64.deb ... 102s Unpacking cpp-14 (14.3.0-10ubuntu1) ... 102s Selecting previously unselected package libdebhelper-perl. 102s Preparing to unpack .../058-libdebhelper-perl_13.24.2ubuntu1_all.deb ... 102s Unpacking libdebhelper-perl (13.24.2ubuntu1) ... 102s Selecting previously unselected package libgcc-14-dev:amd64. 102s Preparing to unpack .../059-libgcc-14-dev_14.3.0-10ubuntu1_amd64.deb ... 102s Unpacking libgcc-14-dev:amd64 (14.3.0-10ubuntu1) ... 102s Selecting previously unselected package gcc-14-x86-64-linux-gnu. 102s Preparing to unpack .../060-gcc-14-x86-64-linux-gnu_14.3.0-10ubuntu1_amd64.deb ... 102s Unpacking gcc-14-x86-64-linux-gnu (14.3.0-10ubuntu1) ... 102s Selecting previously unselected package gcc-14. 102s Preparing to unpack .../061-gcc-14_14.3.0-10ubuntu1_amd64.deb ... 102s Unpacking gcc-14 (14.3.0-10ubuntu1) ... 102s Selecting previously unselected package libtool. 102s Preparing to unpack .../062-libtool_2.5.4-7_all.deb ... 102s Unpacking libtool (2.5.4-7) ... 102s Selecting previously unselected package dh-autoreconf. 102s Preparing to unpack .../063-dh-autoreconf_21_all.deb ... 102s Unpacking dh-autoreconf (21) ... 102s Selecting previously unselected package libarchive-zip-perl. 102s Preparing to unpack .../064-libarchive-zip-perl_1.68-1_all.deb ... 102s Unpacking libarchive-zip-perl (1.68-1) ... 102s Selecting previously unselected package libfile-stripnondeterminism-perl. 102s Preparing to unpack .../065-libfile-stripnondeterminism-perl_1.15.0-1_all.deb ... 102s Unpacking libfile-stripnondeterminism-perl (1.15.0-1) ... 102s Selecting previously unselected package dh-strip-nondeterminism. 102s Preparing to unpack .../066-dh-strip-nondeterminism_1.15.0-1_all.deb ... 102s Unpacking dh-strip-nondeterminism (1.15.0-1) ... 102s Selecting previously unselected package debugedit. 102s Preparing to unpack .../067-debugedit_1%3a5.2-3_amd64.deb ... 102s Unpacking debugedit (1:5.2-3) ... 102s Selecting previously unselected package dwz. 102s Preparing to unpack .../068-dwz_0.16-2_amd64.deb ... 102s Unpacking dwz (0.16-2) ... 102s Selecting previously unselected package gettext. 102s Preparing to unpack .../069-gettext_0.23.2-1_amd64.deb ... 102s Unpacking gettext (0.23.2-1) ... 102s Selecting previously unselected package intltool-debian. 102s Preparing to unpack .../070-intltool-debian_0.35.0+20060710.6_all.deb ... 102s Unpacking intltool-debian (0.35.0+20060710.6) ... 102s Selecting previously unselected package po-debconf. 102s Preparing to unpack .../071-po-debconf_1.0.21+nmu1_all.deb ... 102s Unpacking po-debconf (1.0.21+nmu1) ... 102s Selecting previously unselected package debhelper. 102s Preparing to unpack .../072-debhelper_13.24.2ubuntu1_all.deb ... 102s Unpacking debhelper (13.24.2ubuntu1) ... 103s Selecting previously unselected package dh-python. 103s Preparing to unpack .../073-dh-python_6.20250414_all.deb ... 103s Unpacking dh-python (6.20250414) ... 103s Selecting previously unselected package sgml-base. 103s Preparing to unpack .../074-sgml-base_1.31+nmu1_all.deb ... 103s Unpacking sgml-base (1.31+nmu1) ... 103s Selecting previously unselected package xml-core. 103s Preparing to unpack .../075-xml-core_0.19_all.deb ... 103s Unpacking xml-core (0.19) ... 103s Selecting previously unselected package docutils-common. 103s Preparing to unpack .../076-docutils-common_0.21.2+dfsg-2_all.deb ... 103s Unpacking docutils-common (0.21.2+dfsg-2) ... 103s Selecting previously unselected package fontconfig. 103s Preparing to unpack .../077-fontconfig_2.15.0-2.3ubuntu1_amd64.deb ... 103s Unpacking fontconfig (2.15.0-2.3ubuntu1) ... 103s Selecting previously unselected package fonts-dejavu-extra. 103s Preparing to unpack .../078-fonts-dejavu-extra_2.37-8_all.deb ... 103s Unpacking fonts-dejavu-extra (2.37-8) ... 103s Selecting previously unselected package fonts-font-awesome. 103s Preparing to unpack .../079-fonts-font-awesome_5.0.10+really4.7.0~dfsg-4.1_all.deb ... 103s Unpacking fonts-font-awesome (5.0.10+really4.7.0~dfsg-4.1) ... 103s Selecting previously unselected package fonts-lyx. 103s Preparing to unpack .../080-fonts-lyx_2.4.4-2_all.deb ... 103s Unpacking fonts-lyx (2.4.4-2) ... 103s Selecting previously unselected package fonts-mathjax. 103s Preparing to unpack .../081-fonts-mathjax_2.7.9+dfsg-1_all.deb ... 103s Unpacking fonts-mathjax (2.7.9+dfsg-1) ... 103s Selecting previously unselected package fonts-open-sans. 103s Preparing to unpack .../082-fonts-open-sans_1.11-2_all.deb ... 103s Unpacking fonts-open-sans (1.11-2) ... 103s Selecting previously unselected package libbabeltrace1:amd64. 103s Preparing to unpack .../083-libbabeltrace1_1.5.11-4build3_amd64.deb ... 103s Unpacking libbabeltrace1:amd64 (1.5.11-4build3) ... 103s Selecting previously unselected package libipt2. 103s Preparing to unpack .../084-libipt2_2.1.2-3_amd64.deb ... 103s Unpacking libipt2 (2.1.2-3) ... 103s Selecting previously unselected package libsource-highlight-common. 103s Preparing to unpack .../085-libsource-highlight-common_3.1.9-4.3build1_all.deb ... 103s Unpacking libsource-highlight-common (3.1.9-4.3build1) ... 103s Selecting previously unselected package libsource-highlight4t64:amd64. 103s Preparing to unpack .../086-libsource-highlight4t64_3.1.9-4.3build1_amd64.deb ... 103s Unpacking libsource-highlight4t64:amd64 (3.1.9-4.3build1) ... 103s Selecting previously unselected package gdb. 103s Preparing to unpack .../087-gdb_16.3-1ubuntu2_amd64.deb ... 103s Unpacking gdb (16.3-1ubuntu2) ... 103s Selecting previously unselected package libgfortran-14-dev:amd64. 103s Preparing to unpack .../088-libgfortran-14-dev_14.3.0-10ubuntu1_amd64.deb ... 103s Unpacking libgfortran-14-dev:amd64 (14.3.0-10ubuntu1) ... 103s Selecting previously unselected package gfortran-14-x86-64-linux-gnu. 103s Preparing to unpack .../089-gfortran-14-x86-64-linux-gnu_14.3.0-10ubuntu1_amd64.deb ... 103s Unpacking gfortran-14-x86-64-linux-gnu (14.3.0-10ubuntu1) ... 103s Selecting previously unselected package gfortran-14. 103s Preparing to unpack .../090-gfortran-14_14.3.0-10ubuntu1_amd64.deb ... 103s Unpacking gfortran-14 (14.3.0-10ubuntu1) ... 103s Selecting previously unselected package libgfortran-15-dev:amd64. 103s Preparing to unpack .../091-libgfortran-15-dev_15.2.0-7ubuntu1_amd64.deb ... 103s Unpacking libgfortran-15-dev:amd64 (15.2.0-7ubuntu1) ... 103s Selecting previously unselected package gfortran-15-x86-64-linux-gnu. 103s Preparing to unpack .../092-gfortran-15-x86-64-linux-gnu_15.2.0-7ubuntu1_amd64.deb ... 103s Unpacking gfortran-15-x86-64-linux-gnu (15.2.0-7ubuntu1) ... 103s Selecting previously unselected package gfortran-15. 103s Preparing to unpack .../093-gfortran-15_15.2.0-7ubuntu1_amd64.deb ... 103s Unpacking gfortran-15 (15.2.0-7ubuntu1) ... 103s Selecting previously unselected package libgs-common. 103s Preparing to unpack .../094-libgs-common_10.05.0dfsg1-0ubuntu4_all.deb ... 103s Unpacking libgs-common (10.05.0dfsg1-0ubuntu4) ... 103s Selecting previously unselected package libgs10-common. 103s Preparing to unpack .../095-libgs10-common_10.05.0dfsg1-0ubuntu4_all.deb ... 103s Unpacking libgs10-common (10.05.0dfsg1-0ubuntu4) ... 103s Selecting previously unselected package libavahi-common-data:amd64. 103s Preparing to unpack .../096-libavahi-common-data_0.8-16ubuntu3_amd64.deb ... 103s Unpacking libavahi-common-data:amd64 (0.8-16ubuntu3) ... 103s Selecting previously unselected package libavahi-common3:amd64. 103s Preparing to unpack .../097-libavahi-common3_0.8-16ubuntu3_amd64.deb ... 103s Unpacking libavahi-common3:amd64 (0.8-16ubuntu3) ... 103s Selecting previously unselected package libavahi-client3:amd64. 103s Preparing to unpack .../098-libavahi-client3_0.8-16ubuntu3_amd64.deb ... 103s Unpacking libavahi-client3:amd64 (0.8-16ubuntu3) ... 103s Selecting previously unselected package libcups2t64:amd64. 103s Preparing to unpack .../099-libcups2t64_2.4.12-0ubuntu3_amd64.deb ... 103s Unpacking libcups2t64:amd64 (2.4.12-0ubuntu3) ... 103s Selecting previously unselected package libidn12:amd64. 103s Preparing to unpack .../100-libidn12_1.43-2_amd64.deb ... 103s Unpacking libidn12:amd64 (1.43-2) ... 103s Selecting previously unselected package libijs-0.35:amd64. 103s Preparing to unpack .../101-libijs-0.35_0.35-16_amd64.deb ... 103s Unpacking libijs-0.35:amd64 (0.35-16) ... 103s Selecting previously unselected package libjbig2dec0:amd64. 103s Preparing to unpack .../102-libjbig2dec0_0.20-1build3_amd64.deb ... 103s Unpacking libjbig2dec0:amd64 (0.20-1build3) ... 103s Selecting previously unselected package libjpeg-turbo8:amd64. 103s Preparing to unpack .../103-libjpeg-turbo8_2.1.5-4ubuntu2_amd64.deb ... 103s Unpacking libjpeg-turbo8:amd64 (2.1.5-4ubuntu2) ... 103s Selecting previously unselected package libjpeg8:amd64. 103s Preparing to unpack .../104-libjpeg8_8c-2ubuntu11_amd64.deb ... 103s Unpacking libjpeg8:amd64 (8c-2ubuntu11) ... 103s Selecting previously unselected package libopenjp2-7:amd64. 103s Preparing to unpack .../105-libopenjp2-7_2.5.3-2.1_amd64.deb ... 103s Unpacking libopenjp2-7:amd64 (2.5.3-2.1) ... 103s Selecting previously unselected package libpaper2:amd64. 103s Preparing to unpack .../106-libpaper2_2.2.5-0.3_amd64.deb ... 103s Unpacking libpaper2:amd64 (2.2.5-0.3) ... 103s Selecting previously unselected package libdeflate0:amd64. 103s Preparing to unpack .../107-libdeflate0_1.23-2_amd64.deb ... 103s Unpacking libdeflate0:amd64 (1.23-2) ... 103s Selecting previously unselected package libjbig0:amd64. 103s Preparing to unpack .../108-libjbig0_2.1-6.1ubuntu2_amd64.deb ... 103s Unpacking libjbig0:amd64 (2.1-6.1ubuntu2) ... 104s Selecting previously unselected package liblerc4:amd64. 104s Preparing to unpack .../109-liblerc4_4.0.0+ds-5ubuntu1_amd64.deb ... 104s Unpacking liblerc4:amd64 (4.0.0+ds-5ubuntu1) ... 104s Selecting previously unselected package libsharpyuv0:amd64. 104s Preparing to unpack .../110-libsharpyuv0_1.5.0-0.1_amd64.deb ... 104s Unpacking libsharpyuv0:amd64 (1.5.0-0.1) ... 104s Selecting previously unselected package libwebp7:amd64. 104s Preparing to unpack .../111-libwebp7_1.5.0-0.1_amd64.deb ... 104s Unpacking libwebp7:amd64 (1.5.0-0.1) ... 104s Selecting previously unselected package libtiff6:amd64. 104s Preparing to unpack .../112-libtiff6_4.7.0-3ubuntu3_amd64.deb ... 104s Unpacking libtiff6:amd64 (4.7.0-3ubuntu3) ... 104s Selecting previously unselected package libice6:amd64. 104s Preparing to unpack .../113-libice6_2%3a1.1.1-1_amd64.deb ... 104s Unpacking libice6:amd64 (2:1.1.1-1) ... 104s Selecting previously unselected package libsm6:amd64. 104s Preparing to unpack .../114-libsm6_2%3a1.2.6-1_amd64.deb ... 104s Unpacking libsm6:amd64 (2:1.2.6-1) ... 104s Selecting previously unselected package libxt6t64:amd64. 104s Preparing to unpack .../115-libxt6t64_1%3a1.2.1-1.3_amd64.deb ... 104s Unpacking libxt6t64:amd64 (1:1.2.1-1.3) ... 104s Selecting previously unselected package libgs10:amd64. 104s Preparing to unpack .../116-libgs10_10.05.0dfsg1-0ubuntu4_amd64.deb ... 104s Unpacking libgs10:amd64 (10.05.0dfsg1-0ubuntu4) ... 104s Selecting previously unselected package ghostscript. 104s Preparing to unpack .../117-ghostscript_10.05.0dfsg1-0ubuntu4_amd64.deb ... 104s Unpacking ghostscript (10.05.0dfsg1-0ubuntu4) ... 104s Selecting previously unselected package python3-decorator. 104s Preparing to unpack .../118-python3-decorator_5.2.1-2_all.deb ... 104s Unpacking python3-decorator (5.2.1-2) ... 104s Selecting previously unselected package python3-parso. 104s Preparing to unpack .../119-python3-parso_0.8.5-1_all.deb ... 104s Unpacking python3-parso (0.8.5-1) ... 104s Selecting previously unselected package python3-typeshed. 104s Preparing to unpack .../120-python3-typeshed_0.0~git20241223.ea91db2-4_all.deb ... 104s Unpacking python3-typeshed (0.0~git20241223.ea91db2-4) ... 104s Selecting previously unselected package python3-jedi. 104s Preparing to unpack .../121-python3-jedi_0.19.1+ds1-1_all.deb ... 104s Unpacking python3-jedi (0.19.1+ds1-1) ... 104s Selecting previously unselected package python3-traitlets. 104s Preparing to unpack .../122-python3-traitlets_5.14.3+really5.14.3-1_all.deb ... 104s Unpacking python3-traitlets (5.14.3+really5.14.3-1) ... 104s Selecting previously unselected package python3-matplotlib-inline. 104s Preparing to unpack .../123-python3-matplotlib-inline_0.1.7-1_all.deb ... 104s Unpacking python3-matplotlib-inline (0.1.7-1) ... 104s Selecting previously unselected package python3-wcwidth. 104s Preparing to unpack .../124-python3-wcwidth_0.2.13+dfsg1-1_all.deb ... 104s Unpacking python3-wcwidth (0.2.13+dfsg1-1) ... 104s Selecting previously unselected package python3-prompt-toolkit. 104s Preparing to unpack .../125-python3-prompt-toolkit_3.0.52-1_all.deb ... 104s Unpacking python3-prompt-toolkit (3.0.52-1) ... 104s Selecting previously unselected package python3-asttokens. 104s Preparing to unpack .../126-python3-asttokens_3.0.0-2_all.deb ... 104s Unpacking python3-asttokens (3.0.0-2) ... 104s Selecting previously unselected package python3-executing. 104s Preparing to unpack .../127-python3-executing_2.2.0-0.2_all.deb ... 104s Unpacking python3-executing (2.2.0-0.2) ... 104s Selecting previously unselected package python3-pure-eval. 104s Preparing to unpack .../128-python3-pure-eval_0.2.3-1_all.deb ... 104s Unpacking python3-pure-eval (0.2.3-1) ... 104s Selecting previously unselected package python3-stack-data. 104s Preparing to unpack .../129-python3-stack-data_0.6.3-1_all.deb ... 104s Unpacking python3-stack-data (0.6.3-1) ... 104s Selecting previously unselected package python3-ipython. 104s Preparing to unpack .../130-python3-ipython_8.35.0-2_all.deb ... 104s Unpacking python3-ipython (8.35.0-2) ... 104s Selecting previously unselected package ipython3. 104s Preparing to unpack .../131-ipython3_8.35.0-2_all.deb ... 104s Unpacking ipython3 (8.35.0-2) ... 104s Selecting previously unselected package comerr-dev:amd64. 104s Preparing to unpack .../132-comerr-dev_2.1-1.47.2-3ubuntu2_amd64.deb ... 104s Unpacking comerr-dev:amd64 (2.1-1.47.2-3ubuntu2) ... 104s Selecting previously unselected package libgssrpc4t64:amd64. 104s Preparing to unpack .../133-libgssrpc4t64_1.21.3-5ubuntu2_amd64.deb ... 104s Unpacking libgssrpc4t64:amd64 (1.21.3-5ubuntu2) ... 104s Selecting previously unselected package libkadm5clnt-mit12:amd64. 104s Preparing to unpack .../134-libkadm5clnt-mit12_1.21.3-5ubuntu2_amd64.deb ... 104s Unpacking libkadm5clnt-mit12:amd64 (1.21.3-5ubuntu2) ... 104s Selecting previously unselected package libkdb5-10t64:amd64. 104s Preparing to unpack .../135-libkdb5-10t64_1.21.3-5ubuntu2_amd64.deb ... 104s Unpacking libkdb5-10t64:amd64 (1.21.3-5ubuntu2) ... 104s Selecting previously unselected package libkadm5srv-mit12:amd64. 104s Preparing to unpack .../136-libkadm5srv-mit12_1.21.3-5ubuntu2_amd64.deb ... 104s Unpacking libkadm5srv-mit12:amd64 (1.21.3-5ubuntu2) ... 104s Selecting previously unselected package krb5-multidev:amd64. 104s Preparing to unpack .../137-krb5-multidev_1.21.3-5ubuntu2_amd64.deb ... 104s Unpacking krb5-multidev:amd64 (1.21.3-5ubuntu2) ... 104s Selecting previously unselected package libaec0:amd64. 104s Preparing to unpack .../138-libaec0_1.1.4-2_amd64.deb ... 104s Unpacking libaec0:amd64 (1.1.4-2) ... 104s Selecting previously unselected package libllvm21:amd64. 104s Preparing to unpack .../139-libllvm21_1%3a21.1.2-2ubuntu6_amd64.deb ... 104s Unpacking libllvm21:amd64 (1:21.1.2-2ubuntu6) ... 105s Selecting previously unselected package libamd-comgr3:amd64. 105s Preparing to unpack .../140-libamd-comgr3_7.0.2+dfsg-1_amd64.deb ... 105s Unpacking libamd-comgr3:amd64 (7.0.2+dfsg-1) ... 105s Selecting previously unselected package libhsakmt1:amd64. 105s Preparing to unpack .../141-libhsakmt1_6.4.3+dfsg-3_amd64.deb ... 105s Unpacking libhsakmt1:amd64 (6.4.3+dfsg-3) ... 105s Selecting previously unselected package libhsa-runtime64-1:amd64. 105s Preparing to unpack .../142-libhsa-runtime64-1_6.4.3+dfsg-3_amd64.deb ... 105s Unpacking libhsa-runtime64-1:amd64 (6.4.3+dfsg-3) ... 105s Selecting previously unselected package libamdhip64-6:amd64. 105s Preparing to unpack .../143-libamdhip64-6_6.4.3-3_amd64.deb ... 105s Unpacking libamdhip64-6:amd64 (6.4.3-3) ... 105s Selecting previously unselected package libb2-1:amd64. 105s Preparing to unpack .../144-libb2-1_0.98.1-1.1build1_amd64.deb ... 105s Unpacking libb2-1:amd64 (0.98.1-1.1build1) ... 105s Selecting previously unselected package libsnappy1v5:amd64. 105s Preparing to unpack .../145-libsnappy1v5_1.2.2-2_amd64.deb ... 105s Unpacking libsnappy1v5:amd64 (1.2.2-2) ... 105s Selecting previously unselected package libblosc1:amd64. 105s Preparing to unpack .../146-libblosc1_1.21.5+ds-2_amd64.deb ... 105s Unpacking libblosc1:amd64 (1.21.5+ds-2) ... 105s Selecting previously unselected package libboost-iostreams1.88.0:amd64. 105s Preparing to unpack .../147-libboost-iostreams1.88.0_1.88.0-1.4ubuntu2_amd64.deb ... 105s Unpacking libboost-iostreams1.88.0:amd64 (1.88.0-1.4ubuntu2) ... 105s Selecting previously unselected package libboost-thread1.88.0:amd64. 105s Preparing to unpack .../148-libboost-thread1.88.0_1.88.0-1.4ubuntu2_amd64.deb ... 105s Unpacking libboost-thread1.88.0:amd64 (1.88.0-1.4ubuntu2) ... 105s Selecting previously unselected package libbrotli-dev:amd64. 105s Preparing to unpack .../149-libbrotli-dev_1.1.0-2build6_amd64.deb ... 105s Unpacking libbrotli-dev:amd64 (1.1.0-2build6) ... 105s Selecting previously unselected package libbz2-dev:amd64. 105s Preparing to unpack .../150-libbz2-dev_1.0.8-6build1_amd64.deb ... 105s Unpacking libbz2-dev:amd64 (1.0.8-6build1) ... 105s Selecting previously unselected package libpixman-1-0:amd64. 105s Preparing to unpack .../151-libpixman-1-0_0.46.4-1_amd64.deb ... 105s Unpacking libpixman-1-0:amd64 (0.46.4-1) ... 105s Selecting previously unselected package libxcb-render0:amd64. 105s Preparing to unpack .../152-libxcb-render0_1.17.0-2build1_amd64.deb ... 105s Unpacking libxcb-render0:amd64 (1.17.0-2build1) ... 105s Selecting previously unselected package libxcb-shm0:amd64. 105s Preparing to unpack .../153-libxcb-shm0_1.17.0-2build1_amd64.deb ... 105s Unpacking libxcb-shm0:amd64 (1.17.0-2build1) ... 105s Selecting previously unselected package libcairo2:amd64. 105s Preparing to unpack .../154-libcairo2_1.18.4-1build1_amd64.deb ... 105s Unpacking libcairo2:amd64 (1.18.4-1build1) ... 105s Selecting previously unselected package libcares2:amd64. 105s Preparing to unpack .../155-libcares2_1.34.5-1_amd64.deb ... 105s Unpacking libcares2:amd64 (1.34.5-1) ... 105s Selecting previously unselected package libevent-2.1-7t64:amd64. 105s Preparing to unpack .../156-libevent-2.1-7t64_2.1.12-stable-10build1_amd64.deb ... 105s Unpacking libevent-2.1-7t64:amd64 (2.1.12-stable-10build1) ... 105s Selecting previously unselected package libunbound8:amd64. 105s Preparing to unpack .../157-libunbound8_1.22.0-2ubuntu4_amd64.deb ... 105s Unpacking libunbound8:amd64 (1.22.0-2ubuntu4) ... 105s Selecting previously unselected package libgnutls-dane0t64:amd64. 105s Preparing to unpack .../158-libgnutls-dane0t64_3.8.9-3ubuntu2_amd64.deb ... 105s Unpacking libgnutls-dane0t64:amd64 (3.8.9-3ubuntu2) ... 105s Selecting previously unselected package libgnutls-openssl27t64:amd64. 105s Preparing to unpack .../159-libgnutls-openssl27t64_3.8.9-3ubuntu2_amd64.deb ... 105s Unpacking libgnutls-openssl27t64:amd64 (3.8.9-3ubuntu2) ... 105s Selecting previously unselected package libidn2-dev:amd64. 105s Preparing to unpack .../160-libidn2-dev_2.3.8-4_amd64.deb ... 105s Unpacking libidn2-dev:amd64 (2.3.8-4) ... 105s Selecting previously unselected package libp11-kit-dev:amd64. 105s Preparing to unpack .../161-libp11-kit-dev_0.25.9-2_amd64.deb ... 105s Unpacking libp11-kit-dev:amd64 (0.25.9-2) ... 105s Selecting previously unselected package libtasn1-6-dev:amd64. 105s Preparing to unpack .../162-libtasn1-6-dev_4.20.0-2build1_amd64.deb ... 105s Unpacking libtasn1-6-dev:amd64 (4.20.0-2build1) ... 105s Selecting previously unselected package libgmpxx4ldbl:amd64. 105s Preparing to unpack .../163-libgmpxx4ldbl_2%3a6.3.0+dfsg-5ubuntu1_amd64.deb ... 105s Unpacking libgmpxx4ldbl:amd64 (2:6.3.0+dfsg-5ubuntu1) ... 105s Selecting previously unselected package libgmp-dev:amd64. 105s Preparing to unpack .../164-libgmp-dev_2%3a6.3.0+dfsg-5ubuntu1_amd64.deb ... 105s Unpacking libgmp-dev:amd64 (2:6.3.0+dfsg-5ubuntu1) ... 105s Selecting previously unselected package nettle-dev:amd64. 105s Preparing to unpack .../165-nettle-dev_3.10.2-1_amd64.deb ... 105s Unpacking nettle-dev:amd64 (3.10.2-1) ... 105s Selecting previously unselected package libgnutls28-dev:amd64. 105s Preparing to unpack .../166-libgnutls28-dev_3.8.9-3ubuntu2_amd64.deb ... 105s Unpacking libgnutls28-dev:amd64 (3.8.9-3ubuntu2) ... 105s Selecting previously unselected package libkrb5-dev:amd64. 105s Preparing to unpack .../167-libkrb5-dev_1.21.3-5ubuntu2_amd64.deb ... 105s Unpacking libkrb5-dev:amd64 (1.21.3-5ubuntu2) ... 105s Selecting previously unselected package libldap-dev:amd64. 106s Preparing to unpack .../168-libldap-dev_2.6.10+dfsg-1ubuntu2_amd64.deb ... 106s Unpacking libldap-dev:amd64 (2.6.10+dfsg-1ubuntu2) ... 106s Selecting previously unselected package libpkgconf3:amd64. 106s Preparing to unpack .../169-libpkgconf3_1.8.1-4build1_amd64.deb ... 106s Unpacking libpkgconf3:amd64 (1.8.1-4build1) ... 106s Selecting previously unselected package pkgconf-bin. 106s Preparing to unpack .../170-pkgconf-bin_1.8.1-4build1_amd64.deb ... 106s Unpacking pkgconf-bin (1.8.1-4build1) ... 106s Selecting previously unselected package pkgconf:amd64. 106s Preparing to unpack .../171-pkgconf_1.8.1-4build1_amd64.deb ... 106s Unpacking pkgconf:amd64 (1.8.1-4build1) ... 106s Selecting previously unselected package libnghttp2-dev:amd64. 106s Preparing to unpack .../172-libnghttp2-dev_1.64.0-1.1ubuntu1_amd64.deb ... 106s Unpacking libnghttp2-dev:amd64 (1.64.0-1.1ubuntu1) ... 106s Selecting previously unselected package libpsl-dev:amd64. 106s Preparing to unpack .../173-libpsl-dev_0.21.2-1.1build1_amd64.deb ... 106s Unpacking libpsl-dev:amd64 (0.21.2-1.1build1) ... 106s Selecting previously unselected package zlib1g-dev:amd64. 106s Preparing to unpack .../174-zlib1g-dev_1%3a1.3.dfsg+really1.3.1-1ubuntu2_amd64.deb ... 106s Unpacking zlib1g-dev:amd64 (1:1.3.dfsg+really1.3.1-1ubuntu2) ... 106s Selecting previously unselected package librtmp-dev:amd64. 106s Preparing to unpack .../175-librtmp-dev_2.4+20151223.gitfa8646d.1-3_amd64.deb ... 106s Unpacking librtmp-dev:amd64 (2.4+20151223.gitfa8646d.1-3) ... 106s Selecting previously unselected package libssl-dev:amd64. 106s Preparing to unpack .../176-libssl-dev_3.5.3-1ubuntu2_amd64.deb ... 106s Unpacking libssl-dev:amd64 (3.5.3-1ubuntu2) ... 106s Selecting previously unselected package libssh2-1-dev:amd64. 106s Preparing to unpack .../177-libssh2-1-dev_1.11.1-1build1_amd64.deb ... 106s Unpacking libssh2-1-dev:amd64 (1.11.1-1build1) ... 106s Selecting previously unselected package libzstd-dev:amd64. 106s Preparing to unpack .../178-libzstd-dev_1.5.7+dfsg-2_amd64.deb ... 106s Unpacking libzstd-dev:amd64 (1.5.7+dfsg-2) ... 106s Selecting previously unselected package libcurl4-gnutls-dev:amd64. 106s Preparing to unpack .../179-libcurl4-gnutls-dev_8.14.1-2ubuntu1_amd64.deb ... 106s Unpacking libcurl4-gnutls-dev:amd64 (8.14.1-2ubuntu1) ... 106s Selecting previously unselected package libdatrie1:amd64. 106s Preparing to unpack .../180-libdatrie1_0.2.13-4_amd64.deb ... 106s Unpacking libdatrie1:amd64 (0.2.13-4) ... 106s Selecting previously unselected package libdouble-conversion3:amd64. 106s Preparing to unpack .../181-libdouble-conversion3_3.3.1-2_amd64.deb ... 106s Unpacking libdouble-conversion3:amd64 (3.3.1-2) ... 106s Selecting previously unselected package libpciaccess0:amd64. 106s Preparing to unpack .../182-libpciaccess0_0.18.1-1ubuntu2_amd64.deb ... 106s Unpacking libpciaccess0:amd64 (0.18.1-1ubuntu2) ... 106s Selecting previously unselected package libdrm-intel1:amd64. 106s Preparing to unpack .../183-libdrm-intel1_2.4.127-1ubuntu1_amd64.deb ... 106s Unpacking libdrm-intel1:amd64 (2.4.127-1ubuntu1) ... 106s Selecting previously unselected package libdxflib3:amd64. 106s Preparing to unpack .../184-libdxflib3_3.26.4-2_amd64.deb ... 106s Unpacking libdxflib3:amd64 (3.26.4-2) ... 106s Selecting previously unselected package libeccodes-data. 106s Preparing to unpack .../185-libeccodes-data_2.41.0-1_all.deb ... 106s Unpacking libeccodes-data (2.41.0-1) ... 107s Selecting previously unselected package libeccodes0:amd64. 107s Preparing to unpack .../186-libeccodes0_2.41.0-1_amd64.deb ... 107s Unpacking libeccodes0:amd64 (2.41.0-1) ... 107s Selecting previously unselected package libsz2:amd64. 107s Preparing to unpack .../187-libsz2_1.1.4-2_amd64.deb ... 107s Unpacking libsz2:amd64 (1.1.4-2) ... 107s Selecting previously unselected package libaec-dev:amd64. 107s Preparing to unpack .../188-libaec-dev_1.1.4-2_amd64.deb ... 107s Unpacking libaec-dev:amd64 (1.1.4-2) ... 107s Selecting previously unselected package libpng-dev:amd64. 107s Preparing to unpack .../189-libpng-dev_1.6.50-1_amd64.deb ... 107s Unpacking libpng-dev:amd64 (1.6.50-1) ... 107s Selecting previously unselected package libjpeg-turbo8-dev:amd64. 107s Preparing to unpack .../190-libjpeg-turbo8-dev_2.1.5-4ubuntu2_amd64.deb ... 107s Unpacking libjpeg-turbo8-dev:amd64 (2.1.5-4ubuntu2) ... 107s Selecting previously unselected package libjpeg8-dev:amd64. 107s Preparing to unpack .../191-libjpeg8-dev_8c-2ubuntu11_amd64.deb ... 107s Unpacking libjpeg8-dev:amd64 (8c-2ubuntu11) ... 107s Selecting previously unselected package libjpeg-dev:amd64. 107s Preparing to unpack .../192-libjpeg-dev_8c-2ubuntu11_amd64.deb ... 107s Unpacking libjpeg-dev:amd64 (8c-2ubuntu11) ... 107s Selecting previously unselected package libeccodes-dev:amd64. 107s Preparing to unpack .../193-libeccodes-dev_2.41.0-1_amd64.deb ... 107s Unpacking libeccodes-dev:amd64 (2.41.0-1) ... 107s Selecting previously unselected package libopenblas0:amd64. 107s Preparing to unpack .../194-libopenblas0_0.3.30+ds-3_amd64.deb ... 107s Unpacking libopenblas0:amd64 (0.3.30+ds-3) ... 107s Selecting previously unselected package libevent-pthreads-2.1-7t64:amd64. 107s Preparing to unpack .../195-libevent-pthreads-2.1-7t64_2.1.12-stable-10build1_amd64.deb ... 107s Unpacking libevent-pthreads-2.1-7t64:amd64 (2.1.12-stable-10build1) ... 107s Selecting previously unselected package libpsm2-2. 107s Preparing to unpack .../196-libpsm2-2_11.2.185-2.1_amd64.deb ... 107s Unpacking libpsm2-2 (11.2.185-2.1) ... 107s Selecting previously unselected package librdmacm1t64:amd64. 107s Preparing to unpack .../197-librdmacm1t64_56.1-1ubuntu1_amd64.deb ... 107s Unpacking librdmacm1t64:amd64 (56.1-1ubuntu1) ... 107s Selecting previously unselected package libfabric1:amd64. 107s Preparing to unpack .../198-libfabric1_2.1.0-1.1_amd64.deb ... 107s Unpacking libfabric1:amd64 (2.1.0-1.1) ... 107s Selecting previously unselected package libhwloc15:amd64. 107s Preparing to unpack .../199-libhwloc15_2.12.2-1_amd64.deb ... 107s Unpacking libhwloc15:amd64 (2.12.2-1) ... 107s Selecting previously unselected package libibumad3:amd64. 107s Preparing to unpack .../200-libibumad3_56.1-1ubuntu1_amd64.deb ... 107s Unpacking libibumad3:amd64 (56.1-1ubuntu1) ... 107s Selecting previously unselected package libibmad5:amd64. 107s Preparing to unpack .../201-libibmad5_56.1-1ubuntu1_amd64.deb ... 107s Unpacking libibmad5:amd64 (56.1-1ubuntu1) ... 107s Selecting previously unselected package libucx0:amd64. 107s Preparing to unpack .../202-libucx0_1.19.0+ds-1build1_amd64.deb ... 107s Unpacking libucx0:amd64 (1.19.0+ds-1build1) ... 107s Selecting previously unselected package libxnvctrl0:amd64. 107s Preparing to unpack .../203-libxnvctrl0_510.47.03-0ubuntu4_amd64.deb ... 107s Unpacking libxnvctrl0:amd64 (510.47.03-0ubuntu4) ... 107s Selecting previously unselected package libze1:amd64. 107s Preparing to unpack .../204-libze1_1.24.1-2_amd64.deb ... 107s Unpacking libze1:amd64 (1.24.1-2) ... 107s Selecting previously unselected package ocl-icd-libopencl1:amd64. 107s Preparing to unpack .../205-ocl-icd-libopencl1_2.3.4-1_amd64.deb ... 107s Unpacking ocl-icd-libopencl1:amd64 (2.3.4-1) ... 107s Selecting previously unselected package libhwloc-plugins:amd64. 107s Preparing to unpack .../206-libhwloc-plugins_2.12.2-1_amd64.deb ... 107s Unpacking libhwloc-plugins:amd64 (2.12.2-1) ... 107s Selecting previously unselected package libopenmpi40:amd64. 107s Preparing to unpack .../207-libopenmpi40_5.0.8-8ubuntu1_amd64.deb ... 107s Unpacking libopenmpi40:amd64 (5.0.8-8ubuntu1) ... 107s Selecting previously unselected package proj-data. 107s Preparing to unpack .../208-proj-data_9.7.0-1_all.deb ... 107s Unpacking proj-data (9.7.0-1) ... 107s Selecting previously unselected package libproj25:amd64. 107s Preparing to unpack .../209-libproj25_9.7.0-1_amd64.deb ... 107s Unpacking libproj25:amd64 (9.7.0-1) ... 107s Selecting previously unselected package libqhull-r8.0:amd64. 107s Preparing to unpack .../210-libqhull-r8.0_2020.2-7_amd64.deb ... 107s Unpacking libqhull-r8.0:amd64 (2020.2-7) ... 107s Selecting previously unselected package libqhullcpp8.0:amd64. 107s Preparing to unpack .../211-libqhullcpp8.0_2020.2-7_amd64.deb ... 107s Unpacking libqhullcpp8.0:amd64 (2020.2-7) ... 107s Selecting previously unselected package librados2. 107s Preparing to unpack .../212-librados2_19.2.3-0ubuntu2_amd64.deb ... 107s Unpacking librados2 (19.2.3-0ubuntu2) ... 107s Selecting previously unselected package librsync2t64:amd64. 107s Preparing to unpack .../213-librsync2t64_2.3.4-1.1ubuntu2_amd64.deb ... 107s Unpacking librsync2t64:amd64 (2.3.4-1.1ubuntu2) ... 107s Selecting previously unselected package libeckit0d:amd64. 107s Preparing to unpack .../214-libeckit0d_1.32.3-1_amd64.deb ... 107s Unpacking libeckit0d:amd64 (1.32.3-1) ... 108s Selecting previously unselected package libeckit-utils. 108s Preparing to unpack .../215-libeckit-utils_1.32.3-1_amd64.deb ... 108s Unpacking libeckit-utils (1.32.3-1) ... 108s Selecting previously unselected package openmpi-common. 108s Preparing to unpack .../216-openmpi-common_5.0.8-8ubuntu1_all.deb ... 108s Unpacking openmpi-common (5.0.8-8ubuntu1) ... 108s Selecting previously unselected package libnl-3-dev:amd64. 108s Preparing to unpack .../217-libnl-3-dev_3.11.0-2_amd64.deb ... 108s Unpacking libnl-3-dev:amd64 (3.11.0-2) ... 108s Selecting previously unselected package libnl-route-3-dev:amd64. 108s Preparing to unpack .../218-libnl-route-3-dev_3.11.0-2_amd64.deb ... 108s Unpacking libnl-route-3-dev:amd64 (3.11.0-2) ... 108s Selecting previously unselected package libibverbs-dev:amd64. 108s Preparing to unpack .../219-libibverbs-dev_56.1-1ubuntu1_amd64.deb ... 108s Unpacking libibverbs-dev:amd64 (56.1-1ubuntu1) ... 108s Selecting previously unselected package libnuma-dev:amd64. 108s Preparing to unpack .../220-libnuma-dev_2.0.19-1_amd64.deb ... 108s Unpacking libnuma-dev:amd64 (2.0.19-1) ... 108s Selecting previously unselected package libltdl7:amd64. 108s Preparing to unpack .../221-libltdl7_2.5.4-7_amd64.deb ... 108s Unpacking libltdl7:amd64 (2.5.4-7) ... 108s Selecting previously unselected package libltdl-dev:amd64. 108s Preparing to unpack .../222-libltdl-dev_2.5.4-7_amd64.deb ... 108s Unpacking libltdl-dev:amd64 (2.5.4-7) ... 108s Selecting previously unselected package libhwloc-dev:amd64. 108s Preparing to unpack .../223-libhwloc-dev_2.12.2-1_amd64.deb ... 108s Unpacking libhwloc-dev:amd64 (2.12.2-1) ... 108s Selecting previously unselected package libevent-extra-2.1-7t64:amd64. 108s Preparing to unpack .../224-libevent-extra-2.1-7t64_2.1.12-stable-10build1_amd64.deb ... 108s Unpacking libevent-extra-2.1-7t64:amd64 (2.1.12-stable-10build1) ... 108s Selecting previously unselected package libevent-openssl-2.1-7t64:amd64. 108s Preparing to unpack .../225-libevent-openssl-2.1-7t64_2.1.12-stable-10build1_amd64.deb ... 108s Unpacking libevent-openssl-2.1-7t64:amd64 (2.1.12-stable-10build1) ... 108s Selecting previously unselected package libevent-dev. 108s Preparing to unpack .../226-libevent-dev_2.1.12-stable-10build1_amd64.deb ... 108s Unpacking libevent-dev (2.1.12-stable-10build1) ... 108s Selecting previously unselected package libjs-jquery. 108s Preparing to unpack .../227-libjs-jquery_3.6.1+dfsg+~3.5.14-1_all.deb ... 108s Unpacking libjs-jquery (3.6.1+dfsg+~3.5.14-1) ... 108s Selecting previously unselected package libjs-jquery-ui. 108s Preparing to unpack .../228-libjs-jquery-ui_1.13.2+dfsg-1_all.deb ... 108s Unpacking libjs-jquery-ui (1.13.2+dfsg-1) ... 108s Selecting previously unselected package openmpi-bin. 108s Preparing to unpack .../229-openmpi-bin_5.0.8-8ubuntu1_amd64.deb ... 108s Unpacking openmpi-bin (5.0.8-8ubuntu1) ... 108s Selecting previously unselected package libopenmpi-dev:amd64. 108s Preparing to unpack .../230-libopenmpi-dev_5.0.8-8ubuntu1_amd64.deb ... 108s Unpacking libopenmpi-dev:amd64 (5.0.8-8ubuntu1) ... 108s Selecting previously unselected package mpi-default-dev. 108s Preparing to unpack .../231-mpi-default-dev_1.19_amd64.deb ... 108s Unpacking mpi-default-dev (1.19) ... 108s Selecting previously unselected package libxxhash-dev:amd64. 108s Preparing to unpack .../232-libxxhash-dev_0.8.3-2_amd64.deb ... 108s Unpacking libxxhash-dev:amd64 (0.8.3-2) ... 108s Selecting previously unselected package libjemalloc-dev. 108s Preparing to unpack .../233-libjemalloc-dev_5.3.0-3build1_amd64.deb ... 108s Unpacking libjemalloc-dev (5.3.0-3build1) ... 108s Selecting previously unselected package libsnappy-dev:amd64. 108s Preparing to unpack .../234-libsnappy-dev_1.2.2-2_amd64.deb ... 108s Unpacking libsnappy-dev:amd64 (1.2.2-2) ... 108s Selecting previously unselected package liblz4-dev:amd64. 108s Preparing to unpack .../235-liblz4-dev_1.10.0-6_amd64.deb ... 108s Unpacking liblz4-dev:amd64 (1.10.0-6) ... 108s Selecting previously unselected package libeigen3-dev. 108s Preparing to unpack .../236-libeigen3-dev_3.4.0-5_all.deb ... 108s Unpacking libeigen3-dev (3.4.0-5) ... 108s Selecting previously unselected package libopenblas-pthread-dev:amd64. 108s Preparing to unpack .../237-libopenblas-pthread-dev_0.3.30+ds-3_amd64.deb ... 108s Unpacking libopenblas-pthread-dev:amd64 (0.3.30+ds-3) ... 108s Selecting previously unselected package libopenblas-dev:amd64. 108s Preparing to unpack .../238-libopenblas-dev_0.3.30+ds-3_amd64.deb ... 108s Unpacking libopenblas-dev:amd64 (0.3.30+ds-3) ... 108s Selecting previously unselected package libeckit-dev:amd64. 108s Preparing to unpack .../239-libeckit-dev_1.32.3-1_amd64.deb ... 108s Unpacking libeckit-dev:amd64 (1.32.3-1) ... 108s Selecting previously unselected package libx11-xcb1:amd64. 108s Preparing to unpack .../240-libx11-xcb1_2%3a1.8.12-1build1_amd64.deb ... 108s Unpacking libx11-xcb1:amd64 (2:1.8.12-1build1) ... 108s Selecting previously unselected package libxcb-dri3-0:amd64. 108s Preparing to unpack .../241-libxcb-dri3-0_1.17.0-2build1_amd64.deb ... 108s Unpacking libxcb-dri3-0:amd64 (1.17.0-2build1) ... 108s Selecting previously unselected package libxcb-present0:amd64. 108s Preparing to unpack .../242-libxcb-present0_1.17.0-2build1_amd64.deb ... 108s Unpacking libxcb-present0:amd64 (1.17.0-2build1) ... 108s Selecting previously unselected package libxcb-randr0:amd64. 108s Preparing to unpack .../243-libxcb-randr0_1.17.0-2build1_amd64.deb ... 108s Unpacking libxcb-randr0:amd64 (1.17.0-2build1) ... 108s Selecting previously unselected package libxcb-sync1:amd64. 108s Preparing to unpack .../244-libxcb-sync1_1.17.0-2build1_amd64.deb ... 108s Unpacking libxcb-sync1:amd64 (1.17.0-2build1) ... 108s Selecting previously unselected package libxcb-xfixes0:amd64. 108s Preparing to unpack .../245-libxcb-xfixes0_1.17.0-2build1_amd64.deb ... 108s Unpacking libxcb-xfixes0:amd64 (1.17.0-2build1) ... 109s Selecting previously unselected package libxshmfence1:amd64. 109s Preparing to unpack .../246-libxshmfence1_1.3.3-1_amd64.deb ... 109s Unpacking libxshmfence1:amd64 (1.3.3-1) ... 109s Selecting previously unselected package mesa-libgallium:amd64. 109s Preparing to unpack .../247-mesa-libgallium_25.2.6-1ubuntu1_amd64.deb ... 109s Unpacking mesa-libgallium:amd64 (25.2.6-1ubuntu1) ... 109s Selecting previously unselected package libgbm1:amd64. 109s Preparing to unpack .../248-libgbm1_25.2.6-1ubuntu1_amd64.deb ... 109s Unpacking libgbm1:amd64 (25.2.6-1ubuntu1) ... 109s Selecting previously unselected package libwayland-client0:amd64. 109s Preparing to unpack .../249-libwayland-client0_1.24.0-2_amd64.deb ... 109s Unpacking libwayland-client0:amd64 (1.24.0-2) ... 109s Selecting previously unselected package libegl-mesa0:amd64. 109s Preparing to unpack .../250-libegl-mesa0_25.2.6-1ubuntu1_amd64.deb ... 109s Unpacking libegl-mesa0:amd64 (25.2.6-1ubuntu1) ... 109s Selecting previously unselected package libgeos3.13.1:amd64. 109s Preparing to unpack .../251-libgeos3.13.1_3.13.1-1_amd64.deb ... 109s Unpacking libgeos3.13.1:amd64 (3.13.1-1) ... 109s Selecting previously unselected package libgeos-c1t64:amd64. 109s Preparing to unpack .../252-libgeos-c1t64_3.13.1-1_amd64.deb ... 109s Unpacking libgeos-c1t64:amd64 (3.13.1-1) ... 109s Selecting previously unselected package libgeotiff5:amd64. 109s Preparing to unpack .../253-libgeotiff5_1.7.4-1_amd64.deb ... 109s Unpacking libgeotiff5:amd64 (1.7.4-1) ... 109s Selecting previously unselected package libvulkan1:amd64. 109s Preparing to unpack .../254-libvulkan1_1.4.328.1-1_amd64.deb ... 109s Unpacking libvulkan1:amd64 (1.4.328.1-1) ... 109s Selecting previously unselected package libgl1-mesa-dri:amd64. 109s Preparing to unpack .../255-libgl1-mesa-dri_25.2.6-1ubuntu1_amd64.deb ... 109s Unpacking libgl1-mesa-dri:amd64 (25.2.6-1ubuntu1) ... 109s Selecting previously unselected package libxcb-glx0:amd64. 109s Preparing to unpack .../256-libxcb-glx0_1.17.0-2build1_amd64.deb ... 109s Unpacking libxcb-glx0:amd64 (1.17.0-2build1) ... 109s Selecting previously unselected package libxxf86vm1:amd64. 109s Preparing to unpack .../257-libxxf86vm1_1%3a1.1.4-2_amd64.deb ... 109s Unpacking libxxf86vm1:amd64 (1:1.1.4-2) ... 109s Selecting previously unselected package libglx-mesa0:amd64. 109s Preparing to unpack .../258-libglx-mesa0_25.2.6-1ubuntu1_amd64.deb ... 109s Unpacking libglx-mesa0:amd64 (25.2.6-1ubuntu1) ... 109s Selecting previously unselected package libgraphite2-3:amd64. 109s Preparing to unpack .../259-libgraphite2-3_1.3.14-2ubuntu1_amd64.deb ... 109s Unpacking libgraphite2-3:amd64 (1.3.14-2ubuntu1) ... 109s Selecting previously unselected package libharfbuzz0b:amd64. 109s Preparing to unpack .../260-libharfbuzz0b_12.1.0-1_amd64.deb ... 109s Unpacking libharfbuzz0b:amd64 (12.1.0-1) ... 109s Selecting previously unselected package libhdf5-310:amd64. 109s Preparing to unpack .../261-libhdf5-310_1.14.5+repack-4_amd64.deb ... 109s Unpacking libhdf5-310:amd64 (1.14.5+repack-4) ... 109s Selecting previously unselected package libhdf5-hl-310:amd64. 109s Preparing to unpack .../262-libhdf5-hl-310_1.14.5+repack-4_amd64.deb ... 109s Unpacking libhdf5-hl-310:amd64 (1.14.5+repack-4) ... 109s Selecting previously unselected package libimagequant0:amd64. 109s Preparing to unpack .../263-libimagequant0_2.18.0-1build1_amd64.deb ... 109s Unpacking libimagequant0:amd64 (2.18.0-1build1) ... 109s Selecting previously unselected package libwacom-common. 109s Preparing to unpack .../264-libwacom-common_2.16.1-1_all.deb ... 109s Unpacking libwacom-common (2.16.1-1) ... 109s Selecting previously unselected package libwacom9:amd64. 109s Preparing to unpack .../265-libwacom9_2.16.1-1_amd64.deb ... 109s Unpacking libwacom9:amd64 (2.16.1-1) ... 109s Selecting previously unselected package libinput-bin. 109s Preparing to unpack .../266-libinput-bin_1.28.1-1ubuntu2_amd64.deb ... 109s Unpacking libinput-bin (1.28.1-1ubuntu2) ... 109s Selecting previously unselected package libmtdev1t64:amd64. 109s Preparing to unpack .../267-libmtdev1t64_1.1.7-1_amd64.deb ... 109s Unpacking libmtdev1t64:amd64 (1.1.7-1) ... 109s Selecting previously unselected package libinput10:amd64. 109s Preparing to unpack .../268-libinput10_1.28.1-1ubuntu2_amd64.deb ... 109s Unpacking libinput10:amd64 (1.28.1-1ubuntu2) ... 109s Selecting previously unselected package libjs-underscore. 109s Preparing to unpack .../269-libjs-underscore_1.13.4~dfsg+~1.11.4-3_all.deb ... 109s Unpacking libjs-underscore (1.13.4~dfsg+~1.11.4-3) ... 109s Selecting previously unselected package libjs-sphinxdoc. 109s Preparing to unpack .../270-libjs-sphinxdoc_8.2.3-1ubuntu2_all.deb ... 109s Unpacking libjs-sphinxdoc (8.2.3-1ubuntu2) ... 109s Selecting previously unselected package libjs-sprintf-js. 109s Preparing to unpack .../271-libjs-sprintf-js_1.1.2+ds1+~1.1.2-1_all.deb ... 109s Unpacking libjs-sprintf-js (1.1.2+ds1+~1.1.2-1) ... 109s Selecting previously unselected package libjson-perl. 109s Preparing to unpack .../272-libjson-perl_4.10000-1_all.deb ... 109s Unpacking libjson-perl (4.10000-1) ... 109s Selecting previously unselected package liblcms2-2:amd64. 109s Preparing to unpack .../273-liblcms2-2_2.17-1_amd64.deb ... 109s Unpacking liblcms2-2:amd64 (2.17-1) ... 109s Selecting previously unselected package liblua5.4-0:amd64. 109s Preparing to unpack .../274-liblua5.4-0_5.4.8-1_amd64.deb ... 109s Unpacking liblua5.4-0:amd64 (5.4.8-1) ... 109s Selecting previously unselected package liblzf1:amd64. 109s Preparing to unpack .../275-liblzf1_3.6-4_amd64.deb ... 109s Unpacking liblzf1:amd64 (3.6-4) ... 109s Selecting previously unselected package libmagics++-data. 109s Preparing to unpack .../276-libmagics++-data_4.16.0+really4.16.0-2_all.deb ... 109s Unpacking libmagics++-data (4.16.0+really4.16.0-2) ... 110s Selecting previously unselected package libnetcdf22:amd64. 110s Preparing to unpack .../277-libnetcdf22_1%3a4.9.3-1build1_amd64.deb ... 110s Unpacking libnetcdf22:amd64 (1:4.9.3-1build1) ... 110s Selecting previously unselected package libodc-0d:amd64. 110s Preparing to unpack .../278-libodc-0d_1.6.2-2_amd64.deb ... 110s Unpacking libodc-0d:amd64 (1.6.2-2) ... 110s Selecting previously unselected package libthai-data. 110s Preparing to unpack .../279-libthai-data_0.1.29-2build1_all.deb ... 110s Unpacking libthai-data (0.1.29-2build1) ... 110s Selecting previously unselected package libthai0:amd64. 110s Preparing to unpack .../280-libthai0_0.1.29-2build1_amd64.deb ... 110s Unpacking libthai0:amd64 (0.1.29-2build1) ... 110s Selecting previously unselected package libpango-1.0-0:amd64. 110s Preparing to unpack .../281-libpango-1.0-0_1.56.3-2_amd64.deb ... 110s Unpacking libpango-1.0-0:amd64 (1.56.3-2) ... 110s Selecting previously unselected package libpangoft2-1.0-0:amd64. 110s Preparing to unpack .../282-libpangoft2-1.0-0_1.56.3-2_amd64.deb ... 110s Unpacking libpangoft2-1.0-0:amd64 (1.56.3-2) ... 110s Selecting previously unselected package libpangocairo-1.0-0:amd64. 110s Preparing to unpack .../283-libpangocairo-1.0-0_1.56.3-2_amd64.deb ... 110s Unpacking libpangocairo-1.0-0:amd64 (1.56.3-2) ... 110s Selecting previously unselected package libpcre2-16-0:amd64. 110s Preparing to unpack .../284-libpcre2-16-0_10.46-1_amd64.deb ... 110s Unpacking libpcre2-16-0:amd64 (10.46-1) ... 110s Selecting previously unselected package libqt6core6t64:amd64. 110s Preparing to unpack .../285-libqt6core6t64_6.9.2+dfsg-3ubuntu1_amd64.deb ... 110s Unpacking libqt6core6t64:amd64 (6.9.2+dfsg-3ubuntu1) ... 110s Selecting previously unselected package libglvnd0:amd64. 110s Preparing to unpack .../286-libglvnd0_1.7.0-1build2_amd64.deb ... 110s Unpacking libglvnd0:amd64 (1.7.0-1build2) ... 110s Selecting previously unselected package libegl1:amd64. 110s Preparing to unpack .../287-libegl1_1.7.0-1build2_amd64.deb ... 110s Unpacking libegl1:amd64 (1.7.0-1build2) ... 110s Selecting previously unselected package libglx0:amd64. 110s Preparing to unpack .../288-libglx0_1.7.0-1build2_amd64.deb ... 110s Unpacking libglx0:amd64 (1.7.0-1build2) ... 110s Selecting previously unselected package libmd4c0:amd64. 110s Preparing to unpack .../289-libmd4c0_0.5.2-2_amd64.deb ... 110s Unpacking libmd4c0:amd64 (0.5.2-2) ... 110s Selecting previously unselected package libopengl0:amd64. 110s Preparing to unpack .../290-libopengl0_1.7.0-1build2_amd64.deb ... 110s Unpacking libopengl0:amd64 (1.7.0-1build2) ... 110s Selecting previously unselected package libqt6dbus6:amd64. 110s Preparing to unpack .../291-libqt6dbus6_6.9.2+dfsg-3ubuntu1_amd64.deb ... 110s Unpacking libqt6dbus6:amd64 (6.9.2+dfsg-3ubuntu1) ... 110s Selecting previously unselected package libts0t64:amd64. 110s Preparing to unpack .../292-libts0t64_1.22-1.1build1_amd64.deb ... 110s Unpacking libts0t64:amd64 (1.22-1.1build1) ... 110s Selecting previously unselected package libxcb-util1:amd64. 110s Preparing to unpack .../293-libxcb-util1_0.4.1-1_amd64.deb ... 110s Unpacking libxcb-util1:amd64 (0.4.1-1) ... 110s Selecting previously unselected package libxcb-image0:amd64. 110s Preparing to unpack .../294-libxcb-image0_0.4.0-2build1_amd64.deb ... 110s Unpacking libxcb-image0:amd64 (0.4.0-2build1) ... 110s Selecting previously unselected package libxcb-render-util0:amd64. 110s Preparing to unpack .../295-libxcb-render-util0_0.3.10-1_amd64.deb ... 110s Unpacking libxcb-render-util0:amd64 (0.3.10-1) ... 110s Selecting previously unselected package libxcb-cursor0:amd64. 110s Preparing to unpack .../296-libxcb-cursor0_0.1.5-1_amd64.deb ... 110s Unpacking libxcb-cursor0:amd64 (0.1.5-1) ... 110s Selecting previously unselected package libxcb-icccm4:amd64. 110s Preparing to unpack .../297-libxcb-icccm4_0.4.2-1_amd64.deb ... 110s Unpacking libxcb-icccm4:amd64 (0.4.2-1) ... 110s Selecting previously unselected package libxcb-keysyms1:amd64. 110s Preparing to unpack .../298-libxcb-keysyms1_0.4.1-1_amd64.deb ... 110s Unpacking libxcb-keysyms1:amd64 (0.4.1-1) ... 110s Selecting previously unselected package libxcb-shape0:amd64. 110s Preparing to unpack .../299-libxcb-shape0_1.17.0-2build1_amd64.deb ... 110s Unpacking libxcb-shape0:amd64 (1.17.0-2build1) ... 110s Selecting previously unselected package libxcb-xinput0:amd64. 110s Preparing to unpack .../300-libxcb-xinput0_1.17.0-2build1_amd64.deb ... 110s Unpacking libxcb-xinput0:amd64 (1.17.0-2build1) ... 110s Selecting previously unselected package libxcb-xkb1:amd64. 110s Preparing to unpack .../301-libxcb-xkb1_1.17.0-2build1_amd64.deb ... 110s Unpacking libxcb-xkb1:amd64 (1.17.0-2build1) ... 110s Selecting previously unselected package libxkbcommon-x11-0:amd64. 110s Preparing to unpack .../302-libxkbcommon-x11-0_1.12.3-1_amd64.deb ... 110s Unpacking libxkbcommon-x11-0:amd64 (1.12.3-1) ... 110s Selecting previously unselected package libqt6gui6:amd64. 110s Preparing to unpack .../303-libqt6gui6_6.9.2+dfsg-3ubuntu1_amd64.deb ... 110s Unpacking libqt6gui6:amd64 (6.9.2+dfsg-3ubuntu1) ... 110s Selecting previously unselected package libqt6widgets6:amd64. 110s Preparing to unpack .../304-libqt6widgets6_6.9.2+dfsg-3ubuntu1_amd64.deb ... 110s Unpacking libqt6widgets6:amd64 (6.9.2+dfsg-3ubuntu1) ... 110s Selecting previously unselected package mysql-common. 110s Preparing to unpack .../305-mysql-common_5.8+1.1.1ubuntu1_all.deb ... 110s Unpacking mysql-common (5.8+1.1.1ubuntu1) ... 110s Selecting previously unselected package libmysqlclient24:amd64. 110s Preparing to unpack .../306-libmysqlclient24_8.4.7-0ubuntu2_amd64.deb ... 110s Unpacking libmysqlclient24:amd64 (8.4.7-0ubuntu2) ... 110s Selecting previously unselected package libpq5:amd64. 110s Preparing to unpack .../307-libpq5_18.1-1_amd64.deb ... 110s Unpacking libpq5:amd64 (18.1-1) ... 111s Selecting previously unselected package libterralib3t64:amd64. 111s Preparing to unpack .../308-libterralib3t64_4.3.0+dfsg.2-12.2build2_amd64.deb ... 111s Unpacking libterralib3t64:amd64 (4.3.0+dfsg.2-12.2build2) ... 111s Selecting previously unselected package libmagplus3v5:amd64. 111s Preparing to unpack .../309-libmagplus3v5_4.16.0+really4.16.0-2_amd64.deb ... 111s Unpacking libmagplus3v5:amd64 (4.16.0+really4.16.0-2) ... 111s Selecting previously unselected package libmagics++-metview-dev:amd64. 111s Preparing to unpack .../310-libmagics++-metview-dev_4.16.0+really4.16.0-2_amd64.deb ... 111s Unpacking libmagics++-metview-dev:amd64 (4.16.0+really4.16.0-2) ... 111s Selecting previously unselected package libterralib-dev:amd64. 111s Preparing to unpack .../311-libterralib-dev_4.3.0+dfsg.2-12.2build2_amd64.deb ... 111s Unpacking libterralib-dev:amd64 (4.3.0+dfsg.2-12.2build2) ... 111s Selecting previously unselected package magics++. 111s Preparing to unpack .../312-magics++_4.16.0+really4.16.0-2_amd64.deb ... 111s Unpacking magics++ (4.16.0+really4.16.0-2) ... 111s Selecting previously unselected package odc. 111s Preparing to unpack .../313-odc_1.6.2-2_amd64.deb ... 111s Unpacking odc (1.6.2-2) ... 111s Selecting previously unselected package libodc-dev:amd64. 111s Preparing to unpack .../314-libodc-dev_1.6.2-2_amd64.deb ... 111s Unpacking libodc-dev:amd64 (1.6.2-2) ... 111s Selecting previously unselected package libmagics++-dev:amd64. 111s Preparing to unpack .../315-libmagics++-dev_4.16.0+really4.16.0-2_amd64.deb ... 111s Unpacking libmagics++-dev:amd64 (4.16.0+really4.16.0-2) ... 111s Selecting previously unselected package node-xtend. 111s Preparing to unpack .../316-node-xtend_4.0.2-3_all.deb ... 111s Unpacking node-xtend (4.0.2-3) ... 111s Selecting previously unselected package node-corepack. 111s Preparing to unpack .../317-node-corepack_0.24.0-5_all.deb ... 111s Unpacking node-corepack (0.24.0-5) ... 111s Selecting previously unselected package nodejs. 111s Preparing to unpack .../318-nodejs_20.19.4+dfsg-1_amd64.deb ... 111s Unpacking nodejs (20.19.4+dfsg-1) ... 111s Selecting previously unselected package node-acorn. 111s Preparing to unpack .../319-node-acorn_8.8.1+ds+~cs25.17.7-2_all.deb ... 111s Unpacking node-acorn (8.8.1+ds+~cs25.17.7-2) ... 111s Selecting previously unselected package node-cjs-module-lexer. 111s Preparing to unpack .../320-node-cjs-module-lexer_1.2.3+dfsg-1_all.deb ... 111s Unpacking node-cjs-module-lexer (1.2.3+dfsg-1) ... 111s Selecting previously unselected package node-balanced-match. 111s Preparing to unpack .../321-node-balanced-match_2.0.0-1_all.deb ... 111s Unpacking node-balanced-match (2.0.0-1) ... 111s Selecting previously unselected package node-brace-expansion. 111s Preparing to unpack .../322-node-brace-expansion_2.0.1+~1.1.0-2_all.deb ... 111s Unpacking node-brace-expansion (2.0.1+~1.1.0-2) ... 111s Selecting previously unselected package node-minimatch. 111s Preparing to unpack .../323-node-minimatch_9.0.3-6_all.deb ... 111s Unpacking node-minimatch (9.0.3-6) ... 111s Selecting previously unselected package node-ms. 111s Preparing to unpack .../324-node-ms_2.1.3+~cs0.7.31-3_all.deb ... 111s Unpacking node-ms (2.1.3+~cs0.7.31-3) ... 111s Selecting previously unselected package node-debug. 111s Preparing to unpack .../325-node-debug_4.4.1+~4.1.12-1_all.deb ... 111s Unpacking node-debug (4.4.1+~4.1.12-1) ... 111s Selecting previously unselected package node-lru-cache. 111s Preparing to unpack .../326-node-lru-cache_10.0.1-3_all.deb ... 111s Unpacking node-lru-cache (10.0.1-3) ... 111s Selecting previously unselected package node-semver. 111s Preparing to unpack .../327-node-semver_7.6.1+~7.5.8-2_all.deb ... 111s Unpacking node-semver (7.6.1+~7.5.8-2) ... 111s Selecting previously unselected package node-llhttp. 111s Preparing to unpack .../328-node-llhttp_9.3.3~really9.3.0+~cs12.11.8-3_all.deb ... 111s Unpacking node-llhttp (9.3.3~really9.3.0+~cs12.11.8-3) ... 111s Selecting previously unselected package node-undici. 111s Preparing to unpack .../329-node-undici_7.16.0+dfsg+~cs3.2.0-2_all.deb ... 111s Unpacking node-undici (7.16.0+dfsg+~cs3.2.0-2) ... 111s Selecting previously unselected package libnode115:amd64. 111s Preparing to unpack .../330-libnode115_20.19.4+dfsg-1_amd64.deb ... 111s Unpacking libnode115:amd64 (20.19.4+dfsg-1) ... 111s Selecting previously unselected package libnorm1t64:amd64. 111s Preparing to unpack .../331-libnorm1t64_1.5.9+dfsg-4_amd64.deb ... 111s Unpacking libnorm1t64:amd64 (1.5.9+dfsg-4) ... 111s Selecting previously unselected package libpgm-5.3-0t64:amd64. 111s Preparing to unpack .../332-libpgm-5.3-0t64_5.3.128~dfsg-2.1build1_amd64.deb ... 111s Unpacking libpgm-5.3-0t64:amd64 (5.3.128~dfsg-2.1build1) ... 111s Selecting previously unselected package libpython3.14-stdlib:amd64. 111s Preparing to unpack .../333-libpython3.14-stdlib_3.14.0-4_amd64.deb ... 111s Unpacking libpython3.14-stdlib:amd64 (3.14.0-4) ... 111s Selecting previously unselected package libraqm0:amd64. 111s Preparing to unpack .../334-libraqm0_0.10.3-1_amd64.deb ... 111s Unpacking libraqm0:amd64 (0.10.3-1) ... 111s Selecting previously unselected package libsodium23:amd64. 112s Preparing to unpack .../335-libsodium23_1.0.18-1build3_amd64.deb ... 112s Unpacking libsodium23:amd64 (1.0.18-1build3) ... 112s Selecting previously unselected package libwebpdemux2:amd64. 112s Preparing to unpack .../336-libwebpdemux2_1.5.0-0.1_amd64.deb ... 112s Unpacking libwebpdemux2:amd64 (1.5.0-0.1) ... 112s Selecting previously unselected package libwebpmux3:amd64. 112s Preparing to unpack .../337-libwebpmux3_1.5.0-0.1_amd64.deb ... 112s Unpacking libwebpmux3:amd64 (1.5.0-0.1) ... 112s Selecting previously unselected package libxslt1.1:amd64. 112s Preparing to unpack .../338-libxslt1.1_1.1.43-0.3_amd64.deb ... 112s Unpacking libxslt1.1:amd64 (1.1.43-0.3) ... 112s Selecting previously unselected package libzmq5:amd64. 112s Preparing to unpack .../339-libzmq5_4.3.5-1build2_amd64.deb ... 112s Unpacking libzmq5:amd64 (4.3.5-1build2) ... 112s Selecting previously unselected package libzopfli1. 112s Preparing to unpack .../340-libzopfli1_1.0.3-3_amd64.deb ... 112s Unpacking libzopfli1 (1.0.3-3) ... 112s Selecting previously unselected package python3-mypy-extensions. 112s Preparing to unpack .../341-python3-mypy-extensions_1.1.0-1_all.deb ... 112s Unpacking python3-mypy-extensions (1.1.0-1) ... 112s Selecting previously unselected package python3-psutil. 112s Preparing to unpack .../342-python3-psutil_7.1.0-1ubuntu1_amd64.deb ... 112s Unpacking python3-psutil (7.1.0-1ubuntu1) ... 112s Selecting previously unselected package python3-mypy. 112s Preparing to unpack .../343-python3-mypy_1.15.0-5_amd64.deb ... 112s Unpacking python3-mypy (1.15.0-5) ... 112s Selecting previously unselected package mypy. 112s Preparing to unpack .../344-mypy_1.15.0-5_all.deb ... 112s Unpacking mypy (1.15.0-5) ... 112s Selecting previously unselected package node-esprima. 112s Preparing to unpack .../345-node-esprima_4.0.1+ds+~4.0.3-2_all.deb ... 112s Unpacking node-esprima (4.0.1+ds+~4.0.3-2) ... 112s Selecting previously unselected package node-fortawesome-fontawesome-free. 112s Preparing to unpack .../346-node-fortawesome-fontawesome-free_6.7.2+ds1-1_all.deb ... 112s Unpacking node-fortawesome-fontawesome-free (6.7.2+ds1-1) ... 112s Selecting previously unselected package node-sprintf-js. 112s Preparing to unpack .../347-node-sprintf-js_1.1.2+ds1+~1.1.2-1_all.deb ... 112s Unpacking node-sprintf-js (1.1.2+ds1+~1.1.2-1) ... 112s Selecting previously unselected package node-argparse. 112s Preparing to unpack .../348-node-argparse_2.0.1-2_all.deb ... 112s Unpacking node-argparse (2.0.1-2) ... 112s Selecting previously unselected package node-js-yaml. 112s Preparing to unpack .../349-node-js-yaml_4.1.0+dfsg+~4.0.5-7_all.deb ... 112s Unpacking node-js-yaml (4.1.0+dfsg+~4.0.5-7) ... 112s Selecting previously unselected package pandoc-data. 112s Preparing to unpack .../350-pandoc-data_3.1.11.1-3build1_all.deb ... 112s Unpacking pandoc-data (3.1.11.1-3build1) ... 112s Selecting previously unselected package pandoc. 112s Preparing to unpack .../351-pandoc_3.1.11.1+ds-4_amd64.deb ... 112s Unpacking pandoc (3.1.11.1+ds-4) ... 113s Selecting previously unselected package pybuild-plugin-autopkgtest. 113s Preparing to unpack .../352-pybuild-plugin-autopkgtest_6.20250414_all.deb ... 113s Unpacking pybuild-plugin-autopkgtest (6.20250414) ... 113s Selecting previously unselected package python3-pyproject-hooks. 113s Preparing to unpack .../353-python3-pyproject-hooks_1.2.0-1_all.deb ... 113s Unpacking python3-pyproject-hooks (1.2.0-1) ... 113s Selecting previously unselected package python3-wheel. 113s Preparing to unpack .../354-python3-wheel_0.46.1-2_all.deb ... 113s Unpacking python3-wheel (0.46.1-2) ... 113s Selecting previously unselected package python3-build. 113s Preparing to unpack .../355-python3-build_1.2.2-4_all.deb ... 113s Unpacking python3-build (1.2.2-4) ... 113s Selecting previously unselected package python3-installer. 113s Preparing to unpack .../356-python3-installer_0.7.0+dfsg1-3_all.deb ... 113s Unpacking python3-installer (0.7.0+dfsg1-3) ... 113s Selecting previously unselected package pybuild-plugin-pyproject. 113s Preparing to unpack .../357-pybuild-plugin-pyproject_6.20250414_all.deb ... 113s Unpacking pybuild-plugin-pyproject (6.20250414) ... 113s Selecting previously unselected package python-cartopy-data. 113s Preparing to unpack .../358-python-cartopy-data_0.25.0+dfsg-1_all.deb ... 113s Unpacking python-cartopy-data (0.25.0+dfsg-1) ... 113s Selecting previously unselected package libjs-mathjax. 113s Preparing to unpack .../359-libjs-mathjax_2.7.9+dfsg-1_all.deb ... 113s Unpacking libjs-mathjax (2.7.9+dfsg-1) ... 113s Selecting previously unselected package python-dask-doc. 113s Preparing to unpack .../360-python-dask-doc_2024.12.1+dfsg-2_all.deb ... 113s Unpacking python-dask-doc (2024.12.1+dfsg-2) ... 113s Selecting previously unselected package python-matplotlib-data. 113s Preparing to unpack .../361-python-matplotlib-data_3.10.7+dfsg1-1_all.deb ... 113s Unpacking python-matplotlib-data (3.10.7+dfsg1-1) ... 113s Selecting previously unselected package python-pandas-doc. 113s Preparing to unpack .../362-python-pandas-doc_2.3.3+dfsg-1ubuntu1_all.deb ... 113s Unpacking python-pandas-doc (2.3.3+dfsg-1ubuntu1) ... 114s Selecting previously unselected package python-tinycss2-common. 114s Preparing to unpack .../363-python-tinycss2-common_1.4.0-2_all.deb ... 114s Unpacking python-tinycss2-common (1.4.0-2) ... 114s Selecting previously unselected package libjs-requirejs. 114s Preparing to unpack .../364-libjs-requirejs_2.3.7+ds+~2.1.37-1_all.deb ... 114s Unpacking libjs-requirejs (2.3.7+ds+~2.1.37-1) ... 114s Selecting previously unselected package python-xarray-doc. 114s Preparing to unpack .../365-python-xarray-doc_2025.03.1-8_all.deb ... 114s Unpacking python-xarray-doc (2025.03.1-8) ... 114s Selecting previously unselected package python3-accessible-pygments. 114s Preparing to unpack .../366-python3-accessible-pygments_0.0.5-2_all.deb ... 114s Unpacking python3-accessible-pygments (0.0.5-2) ... 114s Selecting previously unselected package python3.14. 114s Preparing to unpack .../367-python3.14_3.14.0-4_amd64.deb ... 114s Unpacking python3.14 (3.14.0-4) ... 114s Selecting previously unselected package python3-all. 114s Preparing to unpack .../368-python3-all_3.13.7-2_amd64.deb ... 114s Unpacking python3-all (3.13.7-2) ... 114s Selecting previously unselected package python3-defusedxml. 114s Preparing to unpack .../369-python3-defusedxml_0.7.1-3_all.deb ... 114s Unpacking python3-defusedxml (0.7.1-3) ... 114s Selecting previously unselected package sphinx-common. 114s Preparing to unpack .../370-sphinx-common_8.2.3-1ubuntu2_all.deb ... 114s Unpacking sphinx-common (8.2.3-1ubuntu2) ... 114s Selecting previously unselected package python3-alabaster. 114s Preparing to unpack .../371-python3-alabaster_0.7.16-0.1_all.deb ... 114s Unpacking python3-alabaster (0.7.16-0.1) ... 114s Selecting previously unselected package python3-roman. 114s Preparing to unpack .../372-python3-roman_5.1-1_all.deb ... 114s Unpacking python3-roman (5.1-1) ... 114s Selecting previously unselected package python3-docutils. 114s Preparing to unpack .../373-python3-docutils_0.21.2+dfsg-2_all.deb ... 114s Unpacking python3-docutils (0.21.2+dfsg-2) ... 114s Selecting previously unselected package python3-imagesize. 114s Preparing to unpack .../374-python3-imagesize_1.4.1-1_all.deb ... 114s Unpacking python3-imagesize (1.4.1-1) ... 114s Selecting previously unselected package python3-snowballstemmer. 114s Preparing to unpack .../375-python3-snowballstemmer_3.0.1-1_all.deb ... 114s Unpacking python3-snowballstemmer (3.0.1-1) ... 114s Selecting previously unselected package python3-sphinx. 114s Preparing to unpack .../376-python3-sphinx_8.2.3-1ubuntu2_all.deb ... 114s Unpacking python3-sphinx (8.2.3-1ubuntu2) ... 115s Selecting previously unselected package python3-autodocsumm. 115s Preparing to unpack .../377-python3-autodocsumm_0.2.14-2_all.deb ... 115s Unpacking python3-autodocsumm (0.2.14-2) ... 115s Selecting previously unselected package python3-webencodings. 115s Preparing to unpack .../378-python3-webencodings_0.5.1-5_all.deb ... 115s Unpacking python3-webencodings (0.5.1-5) ... 115s Selecting previously unselected package python3-html5lib. 115s Preparing to unpack .../379-python3-html5lib_1.2-2_all.deb ... 115s Unpacking python3-html5lib (1.2-2) ... 115s Selecting previously unselected package python3-bleach. 115s Preparing to unpack .../380-python3-bleach_6.2.0-1_all.deb ... 115s Unpacking python3-bleach (6.2.0-1) ... 115s Selecting previously unselected package python3-bottleneck. 115s Preparing to unpack .../381-python3-bottleneck_1.4.2+ds1-2build2_amd64.deb ... 115s Unpacking python3-bottleneck (1.4.2+ds1-2build2) ... 115s Selecting previously unselected package python3-brotli. 115s Preparing to unpack .../382-python3-brotli_1.1.0-2build6_amd64.deb ... 115s Unpacking python3-brotli (1.1.0-2build6) ... 115s Selecting previously unselected package python3-soupsieve. 115s Preparing to unpack .../383-python3-soupsieve_2.7-2_all.deb ... 115s Unpacking python3-soupsieve (2.7-2) ... 115s Selecting previously unselected package python3-bs4. 115s Preparing to unpack .../384-python3-bs4_4.13.4-3_all.deb ... 115s Unpacking python3-bs4 (4.13.4-3) ... 115s Selecting previously unselected package python3-pil:amd64. 115s Preparing to unpack .../385-python3-pil_11.3.0-1ubuntu2_amd64.deb ... 115s Unpacking python3-pil:amd64 (11.3.0-1ubuntu2) ... 115s Selecting previously unselected package python3.14-tk. 115s Preparing to unpack .../386-python3.14-tk_3.14.0-4_amd64.deb ... 115s Unpacking python3.14-tk (3.14.0-4) ... 115s Selecting previously unselected package python3.13-tk. 115s Preparing to unpack .../387-python3.13-tk_3.13.9-1_amd64.deb ... 115s Unpacking python3.13-tk (3.13.9-1) ... 115s Selecting previously unselected package python3-tk:amd64. 115s Preparing to unpack .../388-python3-tk_3.13.9-1_amd64.deb ... 115s Unpacking python3-tk:amd64 (3.13.9-1) ... 115s Selecting previously unselected package python3-pil.imagetk:amd64. 115s Preparing to unpack .../389-python3-pil.imagetk_11.3.0-1ubuntu2_amd64.deb ... 115s Unpacking python3-pil.imagetk:amd64 (11.3.0-1ubuntu2) ... 115s Selecting previously unselected package python3-contourpy. 115s Preparing to unpack .../390-python3-contourpy_1.3.1-2_amd64.deb ... 115s Unpacking python3-contourpy (1.3.1-2) ... 115s Selecting previously unselected package python3-cycler. 115s Preparing to unpack .../391-python3-cycler_0.12.1-2_all.deb ... 115s Unpacking python3-cycler (0.12.1-2) ... 115s Selecting previously unselected package python3-platformdirs. 115s Preparing to unpack .../392-python3-platformdirs_4.3.7-1_all.deb ... 115s Unpacking python3-platformdirs (4.3.7-1) ... 115s Selecting previously unselected package python3-fs. 115s Preparing to unpack .../393-python3-fs_2.4.16-9ubuntu1_all.deb ... 115s Unpacking python3-fs (2.4.16-9ubuntu1) ... 115s Selecting previously unselected package python3-lxml:amd64. 115s Preparing to unpack .../394-python3-lxml_6.0.2-1_amd64.deb ... 115s Unpacking python3-lxml:amd64 (6.0.2-1) ... 115s Selecting previously unselected package python3-lz4. 115s Preparing to unpack .../395-python3-lz4_4.4.4+dfsg-3_amd64.deb ... 115s Unpacking python3-lz4 (4.4.4+dfsg-3) ... 115s Selecting previously unselected package python3-scipy. 115s Preparing to unpack .../396-python3-scipy_1.15.3-1ubuntu1_amd64.deb ... 115s Unpacking python3-scipy (1.15.3-1ubuntu1) ... 115s Selecting previously unselected package python3-mpmath. 115s Preparing to unpack .../397-python3-mpmath_1.3.0-2_all.deb ... 115s Unpacking python3-mpmath (1.3.0-2) ... 115s Selecting previously unselected package python3-sympy. 115s Preparing to unpack .../398-python3-sympy_1.14.0-2_all.deb ... 115s Unpacking python3-sympy (1.14.0-2) ... 116s Selecting previously unselected package python3-ufolib2. 116s Preparing to unpack .../399-python3-ufolib2_0.17.1+dfsg1-1_all.deb ... 116s Unpacking python3-ufolib2 (0.17.1+dfsg1-1) ... 116s Selecting previously unselected package python3-zopfli. 116s Preparing to unpack .../400-python3-zopfli_0.4.0-1_amd64.deb ... 116s Unpacking python3-zopfli (0.4.0-1) ... 116s Selecting previously unselected package unicode-data. 116s Preparing to unpack .../401-unicode-data_16.0.0-1_all.deb ... 116s Unpacking unicode-data (16.0.0-1) ... 116s Selecting previously unselected package python3-fonttools. 116s Preparing to unpack .../402-python3-fonttools_4.57.0-2build1_amd64.deb ... 116s Unpacking python3-fonttools (4.57.0-2build1) ... 116s Selecting previously unselected package python3-kiwisolver. 116s Preparing to unpack .../403-python3-kiwisolver_1.4.10~rc0-1_amd64.deb ... 116s Unpacking python3-kiwisolver (1.4.10~rc0-1) ... 116s Selecting previously unselected package python3-matplotlib. 116s Preparing to unpack .../404-python3-matplotlib_3.10.7+dfsg1-1_amd64.deb ... 116s Unpacking python3-matplotlib (3.10.7+dfsg1-1) ... 116s Selecting previously unselected package python3-pyproj. 116s Preparing to unpack .../405-python3-pyproj_3.7.2-1_amd64.deb ... 116s Unpacking python3-pyproj (3.7.2-1) ... 116s Selecting previously unselected package python3-pyshp. 116s Preparing to unpack .../406-python3-pyshp_2.3.1-3_all.deb ... 116s Unpacking python3-pyshp (2.3.1-3) ... 116s Selecting previously unselected package python3-shapely. 116s Preparing to unpack .../407-python3-shapely_2.1.2-1_amd64.deb ... 116s Unpacking python3-shapely (2.1.2-1) ... 116s Selecting previously unselected package python3-cartopy. 116s Preparing to unpack .../408-python3-cartopy_0.25.0+dfsg-1_amd64.deb ... 116s Unpacking python3-cartopy (0.25.0+dfsg-1) ... 116s Selecting previously unselected package python3-ply. 116s Preparing to unpack .../409-python3-ply_3.11-9_all.deb ... 116s Unpacking python3-ply (3.11-9) ... 116s Selecting previously unselected package python3-pycparser. 116s Preparing to unpack .../410-python3-pycparser_2.23-1_all.deb ... 116s Unpacking python3-pycparser (2.23-1) ... 116s Selecting previously unselected package python3-cffi. 116s Preparing to unpack .../411-python3-cffi_2.0.0-2_all.deb ... 116s Unpacking python3-cffi (2.0.0-2) ... 116s Selecting previously unselected package python3-click. 116s Preparing to unpack .../412-python3-click_8.2.0+0.really.8.1.8-1_all.deb ... 116s Unpacking python3-click (8.2.0+0.really.8.1.8-1) ... 116s Selecting previously unselected package python3-findlibs. 116s Preparing to unpack .../413-python3-findlibs_0.0.5-1build1_amd64.deb ... 116s Unpacking python3-findlibs (0.0.5-1build1) ... 116s Selecting previously unselected package python3-ecmwflibs. 116s Preparing to unpack .../414-python3-ecmwflibs_2%3a0.6.3-2build2_amd64.deb ... 116s Unpacking python3-ecmwflibs (2:0.6.3-2build2) ... 116s Selecting previously unselected package python3-eccodes. 116s Preparing to unpack .../415-python3-eccodes_2%3a2.43.0-1_amd64.deb ... 116s Unpacking python3-eccodes (2:2.43.0-1) ... 116s Selecting previously unselected package python3-pytz. 116s Preparing to unpack .../416-python3-pytz_2025.2-4_all.deb ... 116s Unpacking python3-pytz (2025.2-4) ... 116s Selecting previously unselected package python3-pandas-lib:amd64. 116s Preparing to unpack .../417-python3-pandas-lib_2.3.3+dfsg-1ubuntu1_amd64.deb ... 116s Unpacking python3-pandas-lib:amd64 (2.3.3+dfsg-1ubuntu1) ... 117s Selecting previously unselected package python3-pandas. 117s Preparing to unpack .../418-python3-pandas_2.3.3+dfsg-1ubuntu1_all.deb ... 117s Unpacking python3-pandas (2.3.3+dfsg-1ubuntu1) ... 117s Selecting previously unselected package python3-xarray. 117s Preparing to unpack .../419-python3-xarray_2025.03.1-8_all.deb ... 117s Unpacking python3-xarray (2025.03.1-8) ... 117s Selecting previously unselected package python3-cfgrib. 117s Preparing to unpack .../420-python3-cfgrib_0.9.15.1-1_amd64.deb ... 117s Unpacking python3-cfgrib (0.9.15.1-1) ... 117s Selecting previously unselected package python3-cftime. 117s Preparing to unpack .../421-python3-cftime_1.6.5-1_amd64.deb ... 117s Unpacking python3-cftime (1.6.5-1) ... 117s Selecting previously unselected package python3-cloudpickle. 117s Preparing to unpack .../422-python3-cloudpickle_3.1.1-1_all.deb ... 117s Unpacking python3-cloudpickle (3.1.1-1) ... 117s Selecting previously unselected package python3-comm. 117s Preparing to unpack .../423-python3-comm_0.2.1-1_all.deb ... 117s Unpacking python3-comm (0.2.1-1) ... 117s Selecting previously unselected package python3-coverage. 117s Preparing to unpack .../424-python3-coverage_7.8.2+dfsg1-1_amd64.deb ... 117s Unpacking python3-coverage (7.8.2+dfsg1-1) ... 117s Selecting previously unselected package python3-crc32c. 117s Preparing to unpack .../425-python3-crc32c_2.7.1-1build1_amd64.deb ... 117s Unpacking python3-crc32c (2.7.1-1build1) ... 117s Selecting previously unselected package python3-fsspec. 117s Preparing to unpack .../426-python3-fsspec_2025.3.2-1ubuntu1_all.deb ... 117s Unpacking python3-fsspec (2025.3.2-1ubuntu1) ... 117s Selecting previously unselected package python3-toolz. 117s Preparing to unpack .../427-python3-toolz_1.0.0-2_all.deb ... 117s Unpacking python3-toolz (1.0.0-2) ... 117s Selecting previously unselected package python3-locket. 117s Preparing to unpack .../428-python3-locket_1.0.0-2_all.deb ... 117s Unpacking python3-locket (1.0.0-2) ... 117s Selecting previously unselected package python3-partd. 117s Preparing to unpack .../429-python3-partd_1.4.2-1_all.deb ... 117s Unpacking python3-partd (1.4.2-1) ... 117s Selecting previously unselected package python3-dask. 117s Preparing to unpack .../430-python3-dask_2024.12.1+dfsg-2_all.deb ... 117s Unpacking python3-dask (2024.12.1+dfsg-2) ... 117s Selecting previously unselected package python3-debugpy. 117s Preparing to unpack .../431-python3-debugpy_1.8.12+ds-1ubuntu1_amd64.deb ... 117s Unpacking python3-debugpy (1.8.12+ds-1ubuntu1) ... 117s Selecting previously unselected package python3.13-doc. 117s Preparing to unpack .../432-python3.13-doc_3.13.9-1_all.deb ... 117s Unpacking python3.13-doc (3.13.9-1) ... 117s Selecting previously unselected package python3-doc. 117s Preparing to unpack .../433-python3-doc_3.13.7-2_all.deb ... 117s Unpacking python3-doc (3.13.7-2) ... 117s Selecting previously unselected package python3-donfig. 117s Preparing to unpack .../434-python3-donfig_0.8.1+dfsg-3_all.deb ... 117s Unpacking python3-donfig (0.8.1+dfsg-3) ... 117s Selecting previously unselected package python3-execnet. 117s Preparing to unpack .../435-python3-execnet_2.1.1-1_all.deb ... 117s Unpacking python3-execnet (2.1.1-1) ... 117s Selecting previously unselected package python3-fastjsonschema. 117s Preparing to unpack .../436-python3-fastjsonschema_2.21.1-1_all.deb ... 117s Unpacking python3-fastjsonschema (2.21.1-1) ... 117s Selecting previously unselected package python3-flexcache. 117s Preparing to unpack .../437-python3-flexcache_0.3-2_all.deb ... 117s Unpacking python3-flexcache (0.3-2) ... 117s Selecting previously unselected package python3-flexparser. 117s Preparing to unpack .../438-python3-flexparser_0.4-1_all.deb ... 117s Unpacking python3-flexparser (0.4-1) ... 117s Selecting previously unselected package python3-h5py-serial. 117s Preparing to unpack .../439-python3-h5py-serial_3.13.0-1ubuntu1_amd64.deb ... 117s Unpacking python3-h5py-serial (3.13.0-1ubuntu1) ... 117s Selecting previously unselected package python3-h5py. 117s Preparing to unpack .../440-python3-h5py_3.13.0-1ubuntu1_all.deb ... 117s Unpacking python3-h5py (3.13.0-1ubuntu1) ... 117s Selecting previously unselected package python3-h5netcdf. 117s Preparing to unpack .../441-python3-h5netcdf_1.6.1-1_all.deb ... 117s Unpacking python3-h5netcdf (1.6.1-1) ... 117s Selecting previously unselected package python3-sortedcontainers. 117s Preparing to unpack .../442-python3-sortedcontainers_2.4.0-2_all.deb ... 117s Unpacking python3-sortedcontainers (2.4.0-2) ... 118s Selecting previously unselected package python3-hypothesis. 118s Preparing to unpack .../443-python3-hypothesis_6.130.5-2_all.deb ... 118s Unpacking python3-hypothesis (6.130.5-2) ... 118s Selecting previously unselected package python3-iniconfig. 118s Preparing to unpack .../444-python3-iniconfig_2.1.0-1_all.deb ... 118s Unpacking python3-iniconfig (2.1.0-1) ... 118s Selecting previously unselected package python3-jupyter-core. 118s Preparing to unpack .../445-python3-jupyter-core_5.7.2-5_all.deb ... 118s Unpacking python3-jupyter-core (5.7.2-5) ... 118s Selecting previously unselected package python3-tornado. 118s Preparing to unpack .../446-python3-tornado_6.5.2-3_amd64.deb ... 118s Unpacking python3-tornado (6.5.2-3) ... 118s Selecting previously unselected package python3-zmq. 118s Preparing to unpack .../447-python3-zmq_27.1.0-1_amd64.deb ... 118s Unpacking python3-zmq (27.1.0-1) ... 118s Selecting previously unselected package python3-jupyter-client. 118s Preparing to unpack .../448-python3-jupyter-client_8.6.3-3_all.deb ... 118s Unpacking python3-jupyter-client (8.6.3-3) ... 118s Selecting previously unselected package python3-nest-asyncio. 118s Preparing to unpack .../449-python3-nest-asyncio_1.5.4-1_all.deb ... 118s Unpacking python3-nest-asyncio (1.5.4-1) ... 118s Selecting previously unselected package python3-ipykernel. 118s Preparing to unpack .../450-python3-ipykernel_6.29.5-2_all.deb ... 118s Unpacking python3-ipykernel (6.29.5-2) ... 118s Selecting previously unselected package python3-jupyter-console. 118s Preparing to unpack .../451-python3-jupyter-console_6.6.3-2_all.deb ... 118s Unpacking python3-jupyter-console (6.6.3-2) ... 118s Selecting previously unselected package python3-jupyterlab-pygments. 118s Preparing to unpack .../452-python3-jupyterlab-pygments_0.2.2-3_all.deb ... 118s Unpacking python3-jupyterlab-pygments (0.2.2-3) ... 118s Selecting previously unselected package python3-mistune. 118s Preparing to unpack .../453-python3-mistune_3.1.4-1_all.deb ... 118s Unpacking python3-mistune (3.1.4-1) ... 118s Selecting previously unselected package python3-nbformat. 118s Preparing to unpack .../454-python3-nbformat_5.9.1-1_all.deb ... 118s Unpacking python3-nbformat (5.9.1-1) ... 118s Selecting previously unselected package python3-nbclient. 118s Preparing to unpack .../455-python3-nbclient_0.8.0-2_all.deb ... 118s Unpacking python3-nbclient (0.8.0-2) ... 118s Selecting previously unselected package python3-tinycss2. 118s Preparing to unpack .../456-python3-tinycss2_1.4.0-2_all.deb ... 118s Unpacking python3-tinycss2 (1.4.0-2) ... 118s Selecting previously unselected package python3-pandocfilters. 118s Preparing to unpack .../457-python3-pandocfilters_1.5.1-1_all.deb ... 118s Unpacking python3-pandocfilters (1.5.1-1) ... 118s Selecting previously unselected package python3-nbconvert. 118s Preparing to unpack .../458-python3-nbconvert_7.16.6-1_all.deb ... 118s Unpacking python3-nbconvert (7.16.6-1) ... 118s Selecting previously unselected package python3-nbsphinx. 118s Preparing to unpack .../459-python3-nbsphinx_0.9.5+ds-1_all.deb ... 118s Unpacking python3-nbsphinx (0.9.5+ds-1) ... 118s Selecting previously unselected package python3-netcdf4. 118s Preparing to unpack .../460-python3-netcdf4_1.7.2-1build4_amd64.deb ... 118s Unpacking python3-netcdf4 (1.7.2-1build4) ... 118s Selecting previously unselected package python3-pydata-sphinx-theme. 118s Preparing to unpack .../461-python3-pydata-sphinx-theme_0.16.1+dfsg-3_all.deb ... 118s Unpacking python3-pydata-sphinx-theme (0.16.1+dfsg-3) ... 118s Selecting previously unselected package python3-numcodecs. 118s Preparing to unpack .../462-python3-numcodecs_0.16.3+ds-1_amd64.deb ... 118s Unpacking python3-numcodecs (0.16.3+ds-1) ... 118s Selecting previously unselected package python3-numpydoc. 118s Preparing to unpack .../463-python3-numpydoc_1.9.0-1_all.deb ... 118s Unpacking python3-numpydoc (1.9.0-1) ... 118s Selecting previously unselected package python3-pickleshare. 118s Preparing to unpack .../464-python3-pickleshare_0.7.5-5_all.deb ... 118s Unpacking python3-pickleshare (0.7.5-5) ... 118s Selecting previously unselected package python3-pint. 118s Preparing to unpack .../465-python3-pint_0.24.4-2_all.deb ... 118s Unpacking python3-pint (0.24.4-2) ... 118s Selecting previously unselected package python3-pip. 118s Preparing to unpack .../466-python3-pip_25.1.1+dfsg-1ubuntu2_all.deb ... 118s Unpacking python3-pip (25.1.1+dfsg-1ubuntu2) ... 118s Selecting previously unselected package python3-pluggy. 118s Preparing to unpack .../467-python3-pluggy_1.6.0-1_all.deb ... 118s Unpacking python3-pluggy (1.6.0-1) ... 118s Selecting previously unselected package python3-pooch. 118s Preparing to unpack .../468-python3-pooch_1.8.2-1_all.deb ... 118s Unpacking python3-pooch (1.8.2-1) ... 118s Selecting previously unselected package python3-pytest. 118s Preparing to unpack .../469-python3-pytest_8.3.5-2_all.deb ... 118s Unpacking python3-pytest (8.3.5-2) ... 118s Selecting previously unselected package python3-regex. 118s Preparing to unpack .../470-python3-regex_0.1.20250918-1_amd64.deb ... 118s Unpacking python3-regex (0.1.20250918-1) ... 118s Selecting previously unselected package python3-tomlkit. 118s Preparing to unpack .../471-python3-tomlkit_0.13.3-2_all.deb ... 118s Unpacking python3-tomlkit (0.13.3-2) ... 118s Selecting previously unselected package python3-pytest-mypy. 118s Preparing to unpack .../472-python3-pytest-mypy_3.2.0-2_all.deb ... 118s Unpacking python3-pytest-mypy (3.2.0-2) ... 118s Selecting previously unselected package python3-pytest-xdist. 118s Preparing to unpack .../473-python3-pytest-xdist_3.8.0-2_all.deb ... 118s Unpacking python3-pytest-xdist (3.8.0-2) ... 118s Selecting previously unselected package python3-seaborn. 118s Preparing to unpack .../474-python3-seaborn_0.13.2-5_all.deb ... 118s Unpacking python3-seaborn (0.13.2-5) ... 118s Selecting previously unselected package python3-setuptools-scm. 118s Preparing to unpack .../475-python3-setuptools-scm_8.2.1-3_all.deb ... 118s Unpacking python3-setuptools-scm (8.2.1-3) ... 118s Selecting previously unselected package python3-sphinx-book-theme. 118s Preparing to unpack .../476-python3-sphinx-book-theme_1.1.4-2_all.deb ... 118s Unpacking python3-sphinx-book-theme (1.1.4-2) ... 118s Selecting previously unselected package python3-sphinx-copybutton. 118s Preparing to unpack .../477-python3-sphinx-copybutton_0.5.2-3_all.deb ... 118s Unpacking python3-sphinx-copybutton (0.5.2-3) ... 118s Selecting previously unselected package python3-sphinx-design. 118s Preparing to unpack .../478-python3-sphinx-design_0.6.1-2_all.deb ... 118s Unpacking python3-sphinx-design (0.6.1-2) ... 119s Selecting previously unselected package python3-sphinx-gallery. 119s Preparing to unpack .../479-python3-sphinx-gallery_0.17.1-1_all.deb ... 119s Unpacking python3-sphinx-gallery (0.17.1-1) ... 119s Selecting previously unselected package python3-sphinx-inline-tabs. 119s Preparing to unpack .../480-python3-sphinx-inline-tabs_2023.4.21-3_all.deb ... 119s Unpacking python3-sphinx-inline-tabs (2023.4.21-3) ... 119s Selecting previously unselected package python3-sphinx-remove-toctrees. 119s Preparing to unpack .../481-python3-sphinx-remove-toctrees_1.0.0-1_all.deb ... 119s Unpacking python3-sphinx-remove-toctrees (1.0.0-1) ... 119s Selecting previously unselected package sphinx-rtd-theme-common. 119s Preparing to unpack .../482-sphinx-rtd-theme-common_3.0.2+dfsg-3_all.deb ... 119s Unpacking sphinx-rtd-theme-common (3.0.2+dfsg-3) ... 119s Selecting previously unselected package python3-sphinxcontrib.jquery. 119s Preparing to unpack .../483-python3-sphinxcontrib.jquery_4.1-6_all.deb ... 119s Unpacking python3-sphinxcontrib.jquery (4.1-6) ... 119s Selecting previously unselected package python3-sphinx-rtd-theme. 119s Preparing to unpack .../484-python3-sphinx-rtd-theme_3.0.2+dfsg-3_all.deb ... 119s Unpacking python3-sphinx-rtd-theme (3.0.2+dfsg-3) ... 119s Selecting previously unselected package python3-sphinxcontrib-mermaid. 119s Preparing to unpack .../485-python3-sphinxcontrib-mermaid_1.0.0-1_all.deb ... 119s Unpacking python3-sphinxcontrib-mermaid (1.0.0-1) ... 119s Selecting previously unselected package python3-sphinxext-opengraph. 119s Preparing to unpack .../486-python3-sphinxext-opengraph_0.12.0-1_all.deb ... 119s Unpacking python3-sphinxext-opengraph (0.12.0-1) ... 119s Selecting previously unselected package python3-sphinxext-rediraffe. 119s Preparing to unpack .../487-python3-sphinxext-rediraffe_0.3.0-1_all.deb ... 119s Unpacking python3-sphinxext-rediraffe (0.3.0-1) ... 119s Selecting previously unselected package python3-zarr. 119s Preparing to unpack .../488-python3-zarr_3.1.3-1_all.deb ... 119s Unpacking python3-zarr (3.1.3-1) ... 119s Selecting previously unselected package tzdata-legacy. 119s Preparing to unpack .../489-tzdata-legacy_2025b-5ubuntu1_all.deb ... 119s Unpacking tzdata-legacy (2025b-5ubuntu1) ... 119s Selecting previously unselected package python-hypothesis-doc. 119s Preparing to unpack .../490-python-hypothesis-doc_6.130.5-2_all.deb ... 119s Unpacking python-hypothesis-doc (6.130.5-2) ... 119s Selecting previously unselected package python-scipy-doc. 119s Preparing to unpack .../491-python-scipy-doc_1.15.3-1ubuntu1_all.deb ... 119s Unpacking python-scipy-doc (1.15.3-1ubuntu1) ... 119s Setting up dh-python (6.20250414) ... 119s Setting up libgraphite2-3:amd64 (1.3.14-2ubuntu1) ... 119s Setting up libgnutls-openssl27t64:amd64 (3.8.9-3ubuntu2) ... 119s Setting up libxcb-dri3-0:amd64 (1.17.0-2build1) ... 119s Setting up liblcms2-2:amd64 (2.17-1) ... 119s Setting up python3-iniconfig (2.1.0-1) ... 119s Setting up libpixman-1-0:amd64 (0.46.4-1) ... 119s Setting up python3-tornado (6.5.2-3) ... 120s Setting up libnorm1t64:amd64 (1.5.9+dfsg-4) ... 120s Setting up libsharpyuv0:amd64 (1.5.0-0.1) ... 120s Setting up libx11-xcb1:amd64 (2:1.8.12-1build1) ... 120s Setting up libpciaccess0:amd64 (0.18.1-1ubuntu2) ... 120s Setting up mysql-common (5.8+1.1.1ubuntu1) ... 120s update-alternatives: using /etc/mysql/my.cnf.fallback to provide /etc/mysql/my.cnf (my.cnf) in auto mode 120s Setting up python3-pure-eval (0.2.3-1) ... 120s Setting up libdouble-conversion3:amd64 (3.3.1-2) ... 120s Setting up node-lru-cache (10.0.1-3) ... 120s Setting up fonts-lato (2.015-1) ... 120s Setting up libjs-sprintf-js (1.1.2+ds1+~1.1.2-1) ... 120s Setting up fonts-mathjax (2.7.9+dfsg-1) ... 120s Setting up libsodium23:amd64 (1.0.18-1build3) ... 120s Setting up libxcb-xfixes0:amd64 (1.17.0-2build1) ... 120s Setting up libzstd-dev:amd64 (1.5.7+dfsg-2) ... 120s Setting up liblerc4:amd64 (4.0.0+ds-5ubuntu1) ... 120s Setting up proj-data (9.7.0-1) ... 120s Setting up libjs-mathjax (2.7.9+dfsg-1) ... 120s Setting up libxcb-xinput0:amd64 (1.17.0-2build1) ... 120s Setting up libxrender1:amd64 (1:0.9.12-1) ... 120s Setting up libdatrie1:amd64 (0.2.13-4) ... 120s Setting up python3-parso (0.8.5-1) ... 120s Setting up libgeos3.13.1:amd64 (3.13.1-1) ... 120s Setting up gcc-14-base:amd64 (14.3.0-10ubuntu1) ... 120s Setting up python3-lz4 (4.4.4+dfsg-3) ... 120s Setting up libxcb-render0:amd64 (1.17.0-2build1) ... 120s Setting up python3-defusedxml (0.7.1-3) ... 120s Setting up libarchive-zip-perl (1.68-1) ... 120s Setting up python3-asttokens (3.0.0-2) ... 121s Setting up libevent-pthreads-2.1-7t64:amd64 (2.1.12-stable-10build1) ... 121s Setting up libglvnd0:amd64 (1.7.0-1build2) ... 121s Setting up python3-alabaster (0.7.16-0.1) ... 121s Setting up libgeos-c1t64:amd64 (3.13.1-1) ... 121s Setting up fonts-lyx (2.4.4-2) ... 121s Setting up python3-mypy-extensions (1.1.0-1) ... 121s Setting up libts0t64:amd64 (1.22-1.1build1) ... 121s Setting up libijs-0.35:amd64 (0.35-16) ... 121s Setting up libxcb-glx0:amd64 (1.17.0-2build1) ... 121s Setting up libdebhelper-perl (13.24.2ubuntu1) ... 121s Setting up libgs-common (10.05.0dfsg1-0ubuntu4) ... 121s Setting up python3-fsspec (2025.3.2-1ubuntu1) ... 121s Setting up python3-ply (3.11-9) ... 122s Setting up libpython3.14-minimal:amd64 (3.14.0-4) ... 122s Setting up libevent-openssl-2.1-7t64:amd64 (2.1.12-stable-10build1) ... 122s Setting up libdrm-intel1:amd64 (2.4.127-1ubuntu1) ... 122s Setting up libxcb-keysyms1:amd64 (0.4.1-1) ... 122s Setting up libxcb-shape0:amd64 (1.17.0-2build1) ... 122s Setting up x11-common (1:7.7+24ubuntu1) ... 122s Setting up libpq5:amd64 (18.1-1) ... 122s Setting up libibumad3:amd64 (56.1-1ubuntu1) ... 122s Setting up libdeflate0:amd64 (1.23-2) ... 122s Setting up libeccodes-data (2.41.0-1) ... 122s Setting up m4 (1.4.20-2) ... 122s Setting up libevent-2.1-7t64:amd64 (2.1.12-stable-10build1) ... 122s Setting up libqhull-r8.0:amd64 (2020.2-7) ... 122s Setting up libxcb-render-util0:amd64 (0.3.10-1) ... 122s Setting up python3-coverage (7.8.2+dfsg1-1) ... 122s Setting up python3-pyshp (2.3.1-3) ... 122s Setting up node-cjs-module-lexer (1.2.3+dfsg-1) ... 122s Setting up libdxflib3:amd64 (3.26.4-2) ... 122s Setting up python3-pytz (2025.2-4) ... 123s Setting up libxcb-shm0:amd64 (1.17.0-2build1) ... 123s Setting up libibmad5:amd64 (56.1-1ubuntu1) ... 123s Setting up libxcb-icccm4:amd64 (0.4.2-1) ... 123s Setting up python3-sortedcontainers (2.4.0-2) ... 123s Setting up node-fortawesome-fontawesome-free (6.7.2+ds1-1) ... 123s Setting up libboost-iostreams1.88.0:amd64 (1.88.0-1.4ubuntu2) ... 123s Setting up python3-pandocfilters (1.5.1-1) ... 123s Setting up libgomp1:amd64 (15.2.0-7ubuntu1) ... 123s Setting up python3-click (8.2.0+0.really.8.1.8-1) ... 123s Setting up libjs-requirejs (2.3.7+ds+~2.1.37-1) ... 123s Setting up fonts-open-sans (1.11-2) ... 123s Setting up libmysqlclient24:amd64 (8.4.7-0ubuntu2) ... 123s Setting up python3-wheel (0.46.1-2) ... 123s Setting up libjbig0:amd64 (2.1-6.1ubuntu2) ... 123s Setting up python3-webencodings (0.5.1-5) ... 123s Setting up libpcre2-16-0:amd64 (10.46-1) ... 123s Setting up python3-setuptools-scm (8.2.1-3) ... 124s Setting up libaec0:amd64 (1.1.4-2) ... 124s Setting up python3-platformdirs (4.3.7-1) ... 124s Setting up python3-psutil (7.1.0-1ubuntu1) ... 124s Setting up libze1:amd64 (1.24.1-2) ... 124s Setting up libsource-highlight-common (3.1.9-4.3build1) ... 124s Setting up tzdata-legacy (2025b-5ubuntu1) ... 124s Setting up libopengl0:amd64 (1.7.0-1build2) ... 124s Setting up libmagics++-data (4.16.0+really4.16.0-2) ... 124s Setting up python3-pycparser (2.23-1) ... 124s Setting up libxcb-util1:amd64 (0.4.1-1) ... 124s Setting up libpsl-dev:amd64 (0.21.2-1.1build1) ... 124s Setting up libxxf86vm1:amd64 (1:1.1.4-2) ... 124s Setting up python3-cloudpickle (3.1.1-1) ... 124s Setting up libsnappy1v5:amd64 (1.2.2-2) ... 124s Setting up poppler-data (0.4.12-1) ... 124s Setting up libxcb-xkb1:amd64 (1.17.0-2build1) ... 124s Setting up librsync2t64:amd64 (2.3.4-1.1ubuntu2) ... 124s Setting up libxcb-image0:amd64 (0.4.0-2build1) ... 124s Setting up libnuma-dev:amd64 (2.0.19-1) ... 124s Setting up python3-fs (2.4.16-9ubuntu1) ... 125s Setting up libxnvctrl0:amd64 (510.47.03-0ubuntu4) ... 125s Setting up libxcb-present0:amd64 (1.17.0-2build1) ... 125s Setting up unicode-data (16.0.0-1) ... 125s Setting up python3-jupyterlab-pygments (0.2.2-3) ... 125s Setting up libjemalloc-dev (5.3.0-3build1) ... 125s Setting up python3-roman (5.1-1) ... 125s Setting up libpgm-5.3-0t64:amd64 (5.3.128~dfsg-2.1build1) ... 125s Setting up python3-decorator (5.2.1-2) ... 125s Setting up libfontenc1:amd64 (1:1.1.8-1build1) ... 125s Setting up autotools-dev (20240727.1) ... 125s Setting up libboost-thread1.88.0:amd64 (1.88.0-1.4ubuntu2) ... 125s Setting up libunbound8:amd64 (1.22.0-2ubuntu4) ... 125s Setting up libpkgconf3:amd64 (1.8.1-4build1) ... 125s Setting up libgmpxx4ldbl:amd64 (2:6.3.0+dfsg-5ubuntu1) ... 125s Setting up python3-flexparser (0.4-1) ... 125s Setting up python3-wcwidth (0.2.13+dfsg1-1) ... 126s Setting up python3-pyproject-hooks (1.2.0-1) ... 126s Setting up node-sprintf-js (1.1.2+ds1+~1.1.2-1) ... 126s Setting up libzopfli1 (1.0.3-3) ... 126s Setting up libgnutls-dane0t64:amd64 (3.8.9-3ubuntu2) ... 126s Setting up python3-accessible-pygments (0.0.5-2) ... 126s Setting up python3-typeshed (0.0~git20241223.ea91db2-4) ... 126s Setting up libxcb-sync1:amd64 (1.17.0-2build1) ... 126s Setting up libjbig2dec0:amd64 (0.20-1build3) ... 126s Setting up python3-executing (2.2.0-0.2) ... 126s Setting up python3-snowballstemmer (3.0.1-1) ... 126s Setting up node-balanced-match (2.0.0-1) ... 126s Setting up python-cartopy-data (0.25.0+dfsg-1) ... 126s Setting up python3-pooch (1.8.2-1) ... 127s Setting up libgssrpc4t64:amd64 (1.21.3-5ubuntu2) ... 127s Setting up node-brace-expansion (2.0.1+~1.1.0-2) ... 127s Setting up libldap-dev:amd64 (2.6.10+dfsg-1ubuntu2) ... 127s Setting up libllvm21:amd64 (1:21.1.2-2ubuntu6) ... 127s Setting up python3-nest-asyncio (1.5.4-1) ... 127s Setting up libxcb-cursor0:amd64 (0.1.5-1) ... 127s Setting up python3-brotli (1.1.0-2build6) ... 127s Setting up libavahi-common-data:amd64 (0.8-16ubuntu3) ... 127s Setting up liblzf1:amd64 (3.6-4) ... 127s Setting up xfonts-encodings (1:1.0.5-0ubuntu2) ... 127s Setting up libquadmath0:amd64 (15.2.0-7ubuntu1) ... 127s Setting up python3-cycler (0.12.1-2) ... 127s Setting up libimagequant0:amd64 (2.18.0-1build1) ... 127s Setting up comerr-dev:amd64 (2.1-1.47.2-3ubuntu2) ... 127s Setting up libxkbcommon-x11-0:amd64 (1.12.3-1) ... 127s Setting up fonts-dejavu-mono (2.37-8) ... 127s Setting up libssl-dev:amd64 (3.5.3-1ubuntu2) ... 127s Setting up python3-kiwisolver (1.4.10~rc0-1) ... 127s Setting up libhwloc15:amd64 (2.12.2-1) ... 127s Setting up libcares2:amd64 (1.34.5-1) ... 127s Setting up libmpc3:amd64 (1.3.1-2) ... 127s Setting up python3-numpy-dev:amd64 (1:2.3.4+ds-3ubuntu1) ... 127s Setting up libidn12:amd64 (1.43-2) ... 127s Setting up python3-mypy (1.15.0-5) ... 129s Setting up libtcl8.6:amd64 (8.6.17+dfsg-1) ... 129s Setting up autopoint (0.23.2-1) ... 129s Setting up libipt2 (2.1.2-3) ... 129s Setting up fonts-dejavu-core (2.37-8) ... 129s Setting up libqhullcpp8.0:amd64 (2020.2-7) ... 129s Setting up pkgconf-bin (1.8.1-4build1) ... 129s Setting up python3-pip (25.1.1+dfsg-1ubuntu2) ... 130s Setting up libjpeg-turbo8:amd64 (2.1.5-4ubuntu2) ... 130s Setting up python3-regex (0.1.20250918-1) ... 130s Setting up python3-html5lib (1.2-2) ... 131s Setting up libltdl7:amd64 (2.5.4-7) ... 131s Setting up libidn2-dev:amd64 (2.3.8-4) ... 131s Setting up libbabeltrace1:amd64 (1.5.11-4build3) ... 131s Setting up python3-pickleshare (0.7.5-5) ... 131s Setting up python3-crc32c (2.7.1-1build1) ... 131s Setting up python3-installer (0.7.0+dfsg1-3) ... 131s Setting up libgfortran5:amd64 (15.2.0-7ubuntu1) ... 131s Setting up libvulkan1:amd64 (1.4.328.1-1) ... 131s Setting up autoconf (2.72-3.1ubuntu1) ... 131s Setting up libxxhash-dev:amd64 (0.8.3-2) ... 131s Setting up python3-pluggy (1.6.0-1) ... 131s Setting up libevent-extra-2.1-7t64:amd64 (2.1.12-stable-10build1) ... 131s Setting up libwebp7:amd64 (1.5.0-0.1) ... 131s Setting up libubsan1:amd64 (15.2.0-7ubuntu1) ... 131s Setting up python3-fastjsonschema (2.21.1-1) ... 131s Setting up zlib1g-dev:amd64 (1:1.3.dfsg+really1.3.1-1ubuntu2) ... 131s Setting up fonts-dejavu-extra (2.37-8) ... 131s Setting up dwz (0.16-2) ... 131s Setting up libnl-3-dev:amd64 (3.11.0-2) ... 131s Setting up libmtdev1t64:amd64 (1.1.7-1) ... 131s Setting up ocl-icd-libopencl1:amd64 (2.3.4-1) ... 131s Setting up libxshmfence1:amd64 (1.3.3-1) ... 131s Setting up libhwasan0:amd64 (15.2.0-7ubuntu1) ... 131s Setting up libxcb-randr0:amd64 (1.17.0-2build1) ... 131s Setting up libamd-comgr3:amd64 (7.0.2+dfsg-1) ... 131s Setting up python3-traitlets (5.14.3+really5.14.3-1) ... 131s Setting up libasan8:amd64 (15.2.0-7ubuntu1) ... 131s Setting up python-tinycss2-common (1.4.0-2) ... 131s Setting up libjson-perl (4.10000-1) ... 131s Setting up libxslt1.1:amd64 (1.1.43-0.3) ... 131s Setting up libblosc1:amd64 (1.21.5+ds-2) ... 131s Setting up libpsm2-2 (11.2.185-2.1) ... 131s Setting up openmpi-common (5.0.8-8ubuntu1) ... 131s Setting up debugedit (1:5.2-3) ... 131s Setting up libmd4c0:amd64 (0.5.2-2) ... 131s Setting up mypy (1.15.0-5) ... 131s Setting up librdmacm1t64:amd64 (56.1-1ubuntu1) ... 131s Setting up liblua5.4-0:amd64 (5.4.8-1) ... 131s Setting up libopenjp2-7:amd64 (2.5.3-2.1) ... 131s Setting up python3-toolz (1.0.0-2) ... 132s Setting up python3-findlibs (0.0.5-1build1) ... 132s Setting up libharfbuzz0b:amd64 (12.1.0-1) ... 132s Setting up libthai-data (0.1.29-2build1) ... 132s Setting up python3-flexcache (0.3-2) ... 132s Setting up sgml-base (1.31+nmu1) ... 132s Setting up python3-donfig (0.8.1+dfsg-3) ... 132s Setting up libxss1:amd64 (1:1.2.3-1build3) ... 132s Setting up node-minimatch (9.0.3-6) ... 132s Setting up libpaper2:amd64 (2.2.5-0.3) ... 132s Setting up pandoc-data (3.1.11.1-3build1) ... 132s Setting up libtsan2:amd64 (15.2.0-7ubuntu1) ... 132s Setting up libjs-jquery (3.6.1+dfsg+~3.5.14-1) ... 132s Setting up python3-mpmath (1.3.0-2) ... 133s Setting up node-xtend (4.0.2-3) ... 133s Setting up libisl23:amd64 (0.27-1) ... 133s Setting up python3-build (1.2.2-4) ... 133s Setting up python3-execnet (2.1.1-1) ... 133s Setting up python-matplotlib-data (3.10.7+dfsg1-1) ... 133s Setting up libtasn1-6-dev:amd64 (4.20.0-2build1) ... 133s Setting up python3-tomlkit (0.13.3-2) ... 133s Setting up libwebpmux3:amd64 (1.5.0-0.1) ... 133s Setting up python3-locket (1.0.0-2) ... 133s Setting up python3-mistune (3.1.4-1) ... 134s Setting up python3-stack-data (0.6.3-1) ... 134s Setting up python3-soupsieve (2.7-2) ... 134s Setting up fonts-font-awesome (5.0.10+really4.7.0~dfsg-4.1) ... 134s Setting up sphinx-rtd-theme-common (3.0.2+dfsg-3) ... 134s Setting up python3.14-minimal (3.14.0-4) ... 135s Setting up libcc1-0:amd64 (15.2.0-7ubuntu1) ... 135s Setting up libbrotli-dev:amd64 (1.1.0-2build6) ... 135s Setting up python3-jupyter-core (5.7.2-5) ... 135s Setting up liblsan0:amd64 (15.2.0-7ubuntu1) ... 135s Setting up libhsakmt1:amd64 (6.4.3+dfsg-3) ... 135s Setting up libp11-kit-dev:amd64 (0.25.9-2) ... 135s Setting up libsz2:amd64 (1.1.4-2) ... 135s Setting up libitm1:amd64 (15.2.0-7ubuntu1) ... 135s Setting up libjs-underscore (1.13.4~dfsg+~1.11.4-3) ... 135s Setting up libkadm5clnt-mit12:amd64 (1.21.3-5ubuntu2) ... 135s Setting up python3-imagesize (1.4.1-1) ... 135s Setting up libwacom-common (2.16.1-1) ... 135s Setting up libbz2-dev:amd64 (1.0.8-6build1) ... 135s Setting up libwayland-client0:amd64 (1.24.0-2) ... 135s Setting up libjpeg8:amd64 (8c-2ubuntu11) ... 135s Setting up automake (1:1.18.1-2) ... 135s update-alternatives: using /usr/bin/automake-1.18 to provide /usr/bin/automake (automake) in auto mode 135s Setting up python3-prompt-toolkit (3.0.52-1) ... 135s Setting up libb2-1:amd64 (0.98.1-1.1build1) ... 135s Setting up libfile-stripnondeterminism-perl (1.15.0-1) ... 135s Setting up python3-partd (1.4.2-1) ... 135s Setting up libfabric1:amd64 (2.1.0-1.1) ... 135s Setting up python3-sympy (1.14.0-2) ... 144s /usr/lib/python3/dist-packages/sympy/testing/runtests.py:283: SyntaxWarning: 'return' in a 'finally' block 144s return p.returncode 145s Setting up libice6:amd64 (2:1.1.1-1) ... 145s Setting up libqt6core6t64:amd64 (6.9.2+dfsg-3ubuntu1) ... 145s Setting up mesa-libgallium:amd64 (25.2.6-1ubuntu1) ... 145s Setting up libjpeg-turbo8-dev:amd64 (2.1.5-4ubuntu2) ... 145s Setting up librados2 (19.2.3-0ubuntu2) ... 145s Setting up gettext (0.23.2-1) ... 145s Setting up python3-tinycss2 (1.4.0-2) ... 145s Setting up libopenblas0-pthread:amd64 (0.3.30+ds-3) ... 145s update-alternatives: using /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 to provide /usr/lib/x86_64-linux-gnu/libblas.so.3 (libblas.so.3-x86_64-linux-gnu) in auto mode 145s update-alternatives: using /usr/lib/x86_64-linux-gnu/openblas-pthread/liblapack.so.3 to provide /usr/lib/x86_64-linux-gnu/liblapack.so.3 (liblapack.so.3-x86_64-linux-gnu) in auto mode 145s update-alternatives: using /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblas.so.0 to provide /usr/lib/x86_64-linux-gnu/libopenblas.so.0 (libopenblas.so.0-x86_64-linux-gnu) in auto mode 145s Setting up libgcc-15-dev:amd64 (15.2.0-7ubuntu1) ... 145s Setting up libgmp-dev:amd64 (2:6.3.0+dfsg-5ubuntu1) ... 145s Setting up libzmq5:amd64 (4.3.5-1build2) ... 145s Setting up nettle-dev:amd64 (3.10.2-1) ... 145s Setting up python3-jedi (0.19.1+ds1-1) ... 145s Setting up libkdb5-10t64:amd64 (1.21.3-5ubuntu2) ... 145s Setting up libgbm1:amd64 (25.2.6-1ubuntu1) ... 145s Setting up libpython3.14-stdlib:amd64 (3.14.0-4) ... 145s Setting up libwacom9:amd64 (2.16.1-1) ... 145s Setting up pybuild-plugin-pyproject (6.20250414) ... 145s Setting up fontconfig-config (2.15.0-2.3ubuntu1) ... 145s Setting up python3-pytest (8.3.5-2) ... 146s Setting up libwebpdemux2:amd64 (1.5.0-0.1) ... 146s Setting up python3-hypothesis (6.130.5-2) ... 146s Setting up python3-cffi (2.0.0-2) ... 146s Setting up libsnappy-dev:amd64 (1.2.2-2) ... 146s Setting up libgl1-mesa-dri:amd64 (25.2.6-1ubuntu1) ... 146s Setting up libpng-dev:amd64 (1.6.50-1) ... 146s Setting up libaec-dev:amd64 (1.1.4-2) ... 146s Setting up libavahi-common3:amd64 (0.8-16ubuntu3) ... 146s Setting up python3-dask (2024.12.1+dfsg-2) ... 148s Setting up libsource-highlight4t64:amd64 (3.1.9-4.3build1) ... 148s Setting up python3-nbformat (5.9.1-1) ... 149s Setting up cpp-15-x86-64-linux-gnu (15.2.0-7ubuntu1) ... 149s Setting up xfonts-utils (1:7.7+7) ... 149s Setting up libhwloc-plugins:amd64 (2.12.2-1) ... 149s Setting up libgfortran-15-dev:amd64 (15.2.0-7ubuntu1) ... 149s Setting up python3-bs4 (4.13.4-3) ... 149s Setting up python3-zopfli (0.4.0-1) ... 149s Setting up pkgconf:amd64 (1.8.1-4build1) ... 149s Setting up libinput-bin (1.28.1-1ubuntu2) ... 149s Setting up intltool-debian (0.35.0+20060710.6) ... 149s Setting up python3-bleach (6.2.0-1) ... 149s Setting up python3-matplotlib-inline (0.1.7-1) ... 149s Setting up python3-comm (0.2.1-1) ... 149s Setting up gcc-15-x86-64-linux-gnu (15.2.0-7ubuntu1) ... 149s Setting up libnl-route-3-dev:amd64 (3.11.0-2) ... 149s Setting up python3-pint (0.24.4-2) ... 150s Setting up python3.13-doc (3.13.9-1) ... 150s Setting up libltdl-dev:amd64 (2.5.4-7) ... 150s Setting up libthai0:amd64 (0.1.29-2build1) ... 150s Setting up libegl-mesa0:amd64 (25.2.6-1ubuntu1) ... 150s Setting up gdb (16.3-1ubuntu2) ... 150s Setting up libstdc++-15-dev:amd64 (15.2.0-7ubuntu1) ... 150s Setting up libjs-jquery-ui (1.13.2+dfsg-1) ... 150s Setting up pandoc (3.1.11.1+ds-4) ... 150s Setting up python3-ipython (8.35.0-2) ... 150s /usr/lib/python3/dist-packages/IPython/core/interactiveshell.py:3141: SyntaxWarning: 'return' in a 'finally' block 150s return result 151s Setting up python3-zmq (27.1.0-1) ... 151s Setting up libraqm0:amd64 (0.10.3-1) ... 151s Setting up python-scipy-doc (1.15.3-1ubuntu1) ... 151s Setting up libevent-dev (2.1.12-stable-10build1) ... 151s Setting up libeigen3-dev (3.4.0-5) ... 151s Setting up liblz4-dev:amd64 (1.10.0-6) ... 151s Setting up cpp-14-x86-64-linux-gnu (14.3.0-10ubuntu1) ... 151s Setting up libeccodes0:amd64 (2.41.0-1) ... 151s Setting up libssh2-1-dev:amd64 (1.11.1-1build1) ... 151s Setting up python3-numpy (1:2.3.4+ds-3ubuntu1) ... 153s Setting up libjs-sphinxdoc (8.2.3-1ubuntu2) ... 153s Setting up cpp-14 (14.3.0-10ubuntu1) ... 153s Setting up dh-strip-nondeterminism (1.15.0-1) ... 153s Setting up libhdf5-310:amd64 (1.14.5+repack-4) ... 153s Setting up libopenblas0:amd64 (0.3.30+ds-3) ... 153s Setting up cpp-15 (15.2.0-7ubuntu1) ... 153s Setting up python3-lxml:amd64 (6.0.2-1) ... 153s Setting up libtiff6:amd64 (4.7.0-3ubuntu3) ... 153s Setting up libhsa-runtime64-1:amd64 (6.4.3+dfsg-3) ... 153s Setting up xml-core (0.19) ... 154s Setting up libkadm5srv-mit12:amd64 (1.21.3-5ubuntu2) ... 154s Setting up libegl1:amd64 (1.7.0-1build2) ... 154s Setting up python3-pytest-mypy (3.2.0-2) ... 154s Setting up python3-jupyter-client (8.6.3-3) ... 154s Setting up python3-contourpy (1.3.1-2) ... 154s Setting up ipython3 (8.35.0-2) ... 154s Setting up libhwloc-dev:amd64 (2.12.2-1) ... 154s Setting up libfontconfig1:amd64 (2.15.0-2.3ubuntu1) ... 154s Setting up python3.14 (3.14.0-4) ... 155s Setting up libgcc-14-dev:amd64 (14.3.0-10ubuntu1) ... 155s Setting up libjpeg8-dev:amd64 (8c-2ubuntu11) ... 155s Setting up libsm6:amd64 (2:1.2.6-1) ... 155s Setting up libavahi-client3:amd64 (0.8-16ubuntu3) ... 155s Setting up python3-doc (3.13.7-2) ... 155s Setting up libqt6dbus6:amd64 (6.9.2+dfsg-3ubuntu1) ... 155s Setting up krb5-multidev:amd64 (1.21.3-5ubuntu2) ... 155s Setting up cpp-x86-64-linux-gnu (4:15.2.0-4ubuntu1) ... 155s Setting up libopenblas-pthread-dev:amd64 (0.3.30+ds-3) ... 155s update-alternatives: using /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so to provide /usr/lib/x86_64-linux-gnu/libblas.so (libblas.so-x86_64-linux-gnu) in auto mode 155s update-alternatives: using /usr/lib/x86_64-linux-gnu/openblas-pthread/liblapack.so to provide /usr/lib/x86_64-linux-gnu/liblapack.so (liblapack.so-x86_64-linux-gnu) in auto mode 155s update-alternatives: using /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblas.so to provide /usr/lib/x86_64-linux-gnu/libopenblas.so (libopenblas.so-x86_64-linux-gnu) in auto mode 155s Setting up libgfortran-14-dev:amd64 (14.3.0-10ubuntu1) ... 155s Setting up libgnutls28-dev:amd64 (3.8.9-3ubuntu2) ... 155s Setting up libinput10:amd64 (1.28.1-1ubuntu2) ... 155s Setting up gfortran-15-x86-64-linux-gnu (15.2.0-7ubuntu1) ... 155s Setting up libnghttp2-dev:amd64 (1.64.0-1.1ubuntu1) ... 155s Setting up libhdf5-hl-310:amd64 (1.14.5+repack-4) ... 155s Setting up g++-15-x86-64-linux-gnu (15.2.0-7ubuntu1) ... 155s Setting up fontconfig (2.15.0-2.3ubuntu1) ... 157s Regenerating fonts cache... done. 157s Setting up python3-shapely (2.1.2-1) ... 158s Setting up libxft2:amd64 (2.3.6-1build1) ... 158s Setting up libglx-mesa0:amd64 (25.2.6-1ubuntu1) ... 158s Setting up python-xarray-doc (2025.03.1-8) ... 158s Setting up python3-scipy (1.15.3-1ubuntu1) ... 161s /usr/lib/python3/dist-packages/scipy/optimize/_optimize.py:921: SyntaxWarning: 'break' in a 'finally' block 161s break 163s Setting up python3-pytest-xdist (3.8.0-2) ... 163s Setting up gcc-x86-64-linux-gnu (4:15.2.0-4ubuntu1) ... 163s Setting up libglx0:amd64 (1.7.0-1build2) ... 163s Setting up python-hypothesis-doc (6.130.5-2) ... 163s Setting up libproj25:amd64 (9.7.0-1) ... 163s Setting up python-pandas-doc (2.3.3+dfsg-1ubuntu1) ... 163s Setting up po-debconf (1.0.21+nmu1) ... 163s Setting up libtk8.6:amd64 (8.6.17-1) ... 163s Setting up python3-pandas-lib:amd64 (2.3.3+dfsg-1ubuntu1) ... 163s Setting up libpango-1.0-0:amd64 (1.56.3-2) ... 163s Setting up libnetcdf22:amd64 (1:4.9.3-1build1) ... 163s Setting up libjpeg-dev:amd64 (8c-2ubuntu11) ... 163s Setting up python3-h5py-serial (3.13.0-1ubuntu1) ... 163s Setting up python3-all (3.13.7-2) ... 163s Setting up fonts-urw-base35 (20200910-8) ... 163s Setting up python3-debugpy (1.8.12+ds-1ubuntu1) ... 164s Setting up libibverbs-dev:amd64 (56.1-1ubuntu1) ... 164s Setting up python3-pyproj (3.7.2-1) ... 164s Setting up libcairo2:amd64 (1.18.4-1build1) ... 164s Setting up python3.13-tk (3.13.9-1) ... 164s Setting up libgeotiff5:amd64 (1.7.4-1) ... 164s Setting up python3-nbclient (0.8.0-2) ... 165s Setting up libkrb5-dev:amd64 (1.21.3-5ubuntu2) ... 165s Setting up python3-pil:amd64 (11.3.0-1ubuntu2) ... 165s Setting up gcc-15 (15.2.0-7ubuntu1) ... 165s Setting up libopenblas-dev:amd64 (0.3.30+ds-3) ... 165s Setting up libqt6gui6:amd64 (6.9.2+dfsg-3ubuntu1) ... 165s Setting up python3-pandas (2.3.3+dfsg-1ubuntu1) ... 172s Setting up sphinx-common (8.2.3-1ubuntu2) ... 172s Setting up libamdhip64-6:amd64 (6.4.3-3) ... 172s Setting up libxt6t64:amd64 (1:1.2.1-1.3) ... 172s Setting up librtmp-dev:amd64 (2.4+20151223.gitfa8646d.1-3) ... 172s Setting up python3-ipykernel (6.29.5-2) ... 172s Setting up python3-h5py (3.13.0-1ubuntu1) ... 172s Setting up python3-bottleneck (1.4.2+ds1-2build2) ... 172s Setting up python3-cftime (1.6.5-1) ... 172s Setting up python3-nbconvert (7.16.6-1) ... 173s Setting up cpp (4:15.2.0-4ubuntu1) ... 173s Setting up g++-x86-64-linux-gnu (4:15.2.0-4ubuntu1) ... 173s Setting up gcc-14-x86-64-linux-gnu (14.3.0-10ubuntu1) ... 173s Setting up libpangoft2-1.0-0:amd64 (1.56.3-2) ... 173s Setting up g++-15 (15.2.0-7ubuntu1) ... 173s Setting up libcups2t64:amd64 (2.4.12-0ubuntu3) ... 173s Setting up python3-netcdf4 (1.7.2-1build4) ... 173s Setting up gfortran-15 (15.2.0-7ubuntu1) ... 173s Setting up libpangocairo-1.0-0:amd64 (1.56.3-2) ... 173s Setting up libgs10-common (10.05.0dfsg1-0ubuntu4) ... 173s Setting up libterralib3t64:amd64 (4.3.0+dfsg.2-12.2build2) ... 173s Setting up tk8.6-blt2.5 (2.5.3+dfsg-8) ... 173s Setting up libucx0:amd64 (1.19.0+ds-1build1) ... 173s Setting up python3.14-tk (3.14.0-4) ... 173s Setting up libtool (2.5.4-7) ... 173s Setting up blt (2.5.3+dfsg-8) ... 173s Setting up python3-xarray (2025.03.1-8) ... 175s Setting up python3-tk:amd64 (3.13.9-1) ... 175s Setting up libcurl4-gnutls-dev:amd64 (8.14.1-2ubuntu1) ... 175s Setting up python3-jupyter-console (6.6.3-2) ... 175s Setting up gcc (4:15.2.0-4ubuntu1) ... 175s Setting up gcc-14 (14.3.0-10ubuntu1) ... 175s Setting up gfortran-14-x86-64-linux-gnu (14.3.0-10ubuntu1) ... 175s Setting up libqt6widgets6:amd64 (6.9.2+dfsg-3ubuntu1) ... 175s Setting up dh-autoreconf (21) ... 175s Setting up python3-h5netcdf (1.6.1-1) ... 175s Setting up libterralib-dev:amd64 (4.3.0+dfsg.2-12.2build2) ... 175s Setting up python3-pil.imagetk:amd64 (11.3.0-1ubuntu2) ... 175s Setting up g++ (4:15.2.0-4ubuntu1) ... 175s update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode 175s Setting up build-essential (12.12ubuntu1) ... 175s Setting up gfortran-14 (14.3.0-10ubuntu1) ... 175s Setting up libgs10:amd64 (10.05.0dfsg1-0ubuntu4) ... 175s Setting up libopenmpi40:amd64 (5.0.8-8ubuntu1) ... 175s Setting up debhelper (13.24.2ubuntu1) ... 175s Setting up ghostscript (10.05.0dfsg1-0ubuntu4) ... 175s Setting up libeccodes-dev:amd64 (2.41.0-1) ... 175s Setting up libeckit0d:amd64 (1.32.3-1) ... 175s Setting up openmpi-bin (5.0.8-8ubuntu1) ... 175s update-alternatives: using /usr/bin/mpirun.openmpi to provide /usr/bin/mpirun (mpirun) in auto mode 175s update-alternatives: warning: skip creation of /usr/share/man/man1/mpiexec.1.gz because associated file /usr/share/man/man1/mpiexec.openmpi.1.gz (of link group mpirun) doesn't exist 175s update-alternatives: using /usr/bin/mpicc.openmpi to provide /usr/bin/mpicc (mpi) in auto mode 175s Setting up pybuild-plugin-autopkgtest (6.20250414) ... 175s Setting up libeckit-utils (1.32.3-1) ... 175s Setting up libodc-0d:amd64 (1.6.2-2) ... 175s Setting up libopenmpi-dev:amd64 (5.0.8-8ubuntu1) ... 175s update-alternatives: using /usr/lib/x86_64-linux-gnu/openmpi/include to provide /usr/include/x86_64-linux-gnu/mpi (mpi-x86_64-linux-gnu) in auto mode 175s Setting up odc (1.6.2-2) ... 175s Setting up libmagplus3v5:amd64 (4.16.0+really4.16.0-2) ... 175s Setting up mpi-default-dev (1.19) ... 175s Setting up magics++ (4.16.0+really4.16.0-2) ... 175s Setting up libeckit-dev:amd64 (1.32.3-1) ... 175s Setting up libmagics++-metview-dev:amd64 (4.16.0+really4.16.0-2) ... 175s Setting up libodc-dev:amd64 (1.6.2-2) ... 175s Setting up libmagics++-dev:amd64 (4.16.0+really4.16.0-2) ... 175s Setting up python3-ecmwflibs (2:0.6.3-2build2) ... 175s Setting up python3-eccodes (2:2.43.0-1) ... 176s Setting up python3-cfgrib (0.9.15.1-1) ... 176s Setting up node-ms (2.1.3+~cs0.7.31-3) ... 176s Setting up node-semver (7.6.1+~7.5.8-2) ... 176s Setting up node-corepack (0.24.0-5) ... 176s Setting up node-debug (4.4.1+~4.1.12-1) ... 176s Setting up node-llhttp (9.3.3~really9.3.0+~cs12.11.8-3) ... 176s Setting up python3-fonttools (4.57.0-2build1) ... 177s Setting up python3-ufolib2 (0.17.1+dfsg1-1) ... 177s Setting up node-acorn (8.8.1+ds+~cs25.17.7-2) ... 177s Setting up node-undici (7.16.0+dfsg+~cs3.2.0-2) ... 177s Setting up libnode115:amd64 (20.19.4+dfsg-1) ... 177s Setting up python3-matplotlib (3.10.7+dfsg1-1) ... 179s Setting up python3-cartopy (0.25.0+dfsg-1) ... 180s Setting up python3-seaborn (0.13.2-5) ... 180s Setting up nodejs (20.19.4+dfsg-1) ... 180s update-alternatives: using /usr/bin/nodejs to provide /usr/bin/js (js) in auto mode 180s Setting up node-argparse (2.0.1-2) ... 180s Setting up node-esprima (4.0.1+ds+~4.0.3-2) ... 180s Setting up node-js-yaml (4.1.0+dfsg+~4.0.5-7) ... 180s Setting up python-dask-doc (2024.12.1+dfsg-2) ... 180s Processing triggers for install-info (7.2-5) ... 181s Processing triggers for libc-bin (2.42-2ubuntu2) ... 181s Processing triggers for systemd (257.9-0ubuntu2) ... 181s Processing triggers for man-db (2.13.1-1) ... 182s Processing triggers for udev (257.9-0ubuntu2) ... 182s Processing triggers for sgml-base (1.31+nmu1) ... 182s Setting up docutils-common (0.21.2+dfsg-2) ... 182s Processing triggers for sgml-base (1.31+nmu1) ... 182s Setting up python3-docutils (0.21.2+dfsg-2) ... 183s Setting up python3-sphinx (8.2.3-1ubuntu2) ... 184s Setting up python3-sphinx-gallery (0.17.1-1) ... 184s Setting up python3-sphinx-copybutton (0.5.2-3) ... 184s Setting up python3-sphinx-design (0.6.1-2) ... 184s Setting up python3-nbsphinx (0.9.5+ds-1) ... 185s Setting up python3-sphinxext-rediraffe (0.3.0-1) ... 185s Setting up python3-sphinxcontrib-mermaid (1.0.0-1) ... 185s Setting up python3-sphinxcontrib.jquery (4.1-6) ... 185s Setting up python3-numpydoc (1.9.0-1) ... 185s Setting up python3-pydata-sphinx-theme (0.16.1+dfsg-3) ... 185s Setting up python3-sphinxext-opengraph (0.12.0-1) ... 185s Setting up python3-autodocsumm (0.2.14-2) ... 186s Setting up python3-sphinx-remove-toctrees (1.0.0-1) ... 186s Setting up python3-sphinx-inline-tabs (2023.4.21-3) ... 186s Setting up python3-sphinx-book-theme (1.1.4-2) ... 186s Setting up python3-sphinx-rtd-theme (3.0.2+dfsg-3) ... 186s Setting up python3-numcodecs (0.16.3+ds-1) ... 186s Setting up python3-zarr (3.1.3-1) ... 188s autopkgtest [10:34:54]: test pybuild-autopkgtest: pybuild-autopkgtest 188s autopkgtest [10:34:54]: test pybuild-autopkgtest: [----------------------- 188s pybuild-autopkgtest 188s I: pybuild base:311: cd /tmp/autopkgtest.cdpOi4/autopkgtest_tmp/build; python3.14 -m pytest --deselect=tests/test_weighted.py::test_weighted_operations_keep_attr --deselect=tests/test_variable.py::TestVariable::test_reduce_keepdims --deselect=tests/test_backends.py::test_zarr_region_chunk_partial_offset --deselect=tests/test_backends.py::test_chunk_encoding_with_dask --pyargs xarray 197s ============================= test session starts ============================== 197s platform linux -- Python 3.14.0, pytest-8.3.5, pluggy-1.6.0 197s rootdir: /tmp/autopkgtest.cdpOi4/autopkgtest_tmp/build 197s configfile: pyproject.toml 197s plugins: zarr-3.1.3, xdist-3.8.0, mypy-plugins-3.2.0, hypothesis-6.130.5, typeguard-4.4.2 197s collected 21888 items / 51 deselected / 4 skipped / 21837 selected 197s 197s tests/test_accessor_dt.py .............................................. [ 0%] 198s ........................................................................ [ 0%] 198s ........................................................................ [ 0%] 199s ........................................................................ [ 1%] 200s ........................................................................ [ 1%] 200s .................... [ 1%] 200s tests/test_accessor_str.py ............................................. [ 1%] 200s ........................................................................ [ 2%] 200s ........................................................................ [ 2%] 200s ...................................... [ 2%] 200s tests/test_assertions.py .............................. [ 2%] 200s tests/test_backends.py .ssssssssssssssssssssssssssssssssssssssssssssssss [ 3%] 200s ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 3%] 200s ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 3%] 202s ssssssssssssssssssssssss.................s...............XxXsXsssss..... [ 4%] 205s ..s..................Fs........s.s.................ss................... [ 4%] 208s ..........................................................s............. [ 4%] 212s ..XxXsXsssss.......s..................Fs........s.s.................ss.. [ 5%] 217s ........................................................................ [ 5%] 221s ...s...............XxXsXsssss.......s..................Fs........s.s.... [ 5%] 225s .............ss......................................................... [ 5%] 233s .....FFF.......s..............FFFFF...F.....Fs....FFFFFFFFF..xxxsxsssssF [ 6%] 244s FFFFFFs.s.F.F..FFFF..FFFFFsFFF.FFF.ss.FFFF...F....F..ssFFFFFFFFFFFFFFFFF [ 6%] 257s FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF.FF.FF.FFF...FFFFFF...F.....Fs....FFFFF [ 6%] 269s FFFF..xxxsxsssssFFFFFFFs.s.F.F..FFFF..FFFFFsFFF.FFF.ss.FFFF...F....F..ss [ 7%] 284s FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF.FF.FF.FFF...FFFFFF... [ 7%] 296s F.....Fs....FFFFFFFFF..xxxsxsssssFFFFFFFs.s.F.F..FFFF..FFFFFsFFF.FFF.ss. [ 7%] 309s FFFF...F....F..ssFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF.FF.F [ 8%] 317s F.FFF...FFFFFFFFFF.s..FF.F.F.FFFFFs..................s...............XxX [ 8%] 318s sXXxXsX.......s.s................................s...............XxXsXXx [ 8%] 319s XsX.......s.s...............ss.................s...............XxXsXXxXs [ 9%] 320s X.......s.s................F.sssssssssssssssssssssssssssssssssssssssssss [ 9%] 320s ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 9%] 330s sssssssssssssssssssssss.FFFFFFFFFFFFFFFsFFFFFFFFFFFFF.FxxxsxxxxsxFFFFFFF [ 10%] 334s sFs.FFFFFFFFFFF.FF...Fssssssssssssssssssssssssssssssssssssssssssssssssss [ 10%] 334s ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 10%] 334s ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 11%] 334s ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 11%] 334s ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 11%] 334s ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssFF [ 12%] 340s FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFssssssssssssssssssssssssssssssssss [ 12%] 342s sssssssssssssssssssssssssssssssss.sxsFFFF.F.s..s..s..s.sss.FFsFFFFFFFFFF [ 12%] 350s FFFFFFFFFFFFFFFFFFFFFFxxxFFFFFFFFFFFFFFFFFFFF....ssFFFFFFFFFFFFs.sssssss [ 13%] 350s s [ 13%] 350s tests/test_backends_api.py s....................... [ 13%] 350s tests/test_backends_common.py ... [ 13%] 352s tests/test_backends_datatree.py sssssssssssssssss.F.FFF.F.......F.F.F.F. [ 13%] 353s F.F.F.F...... [ 13%] 356s tests/test_backends_file_manager.py ............................... [ 13%] 356s tests/test_backends_locks.py . [ 13%] 356s tests/test_backends_lru_cache.py ........ [ 13%] 357s tests/test_calendar_ops.py ........................... [ 13%] 357s tests/test_cftime_offsets.py ........................................... [ 14%] 357s ........................................................................ [ 14%] 357s ........................................................................ [ 14%] 358s ........................................................................ [ 15%] 358s ........................................................................ [ 15%] 358s ........................................................................ [ 15%] 358s ........................................................................ [ 16%] 358s ........................................................................ [ 16%] 358s ........................................................................ [ 16%] 358s ........................................................................ [ 17%] 358s ........................................................................ [ 17%] 358s ........................................................................ [ 17%] 358s ........................................................................ [ 18%] 358s ........................................................................ [ 18%] 358s ........................................................................ [ 18%] 358s ........................................................................ [ 19%] 358s ........................................................................ [ 19%] 358s ........................................................................ [ 19%] 358s ........................................................................ [ 20%] 358s ........................................................................ [ 20%] 358s ........................................................................ [ 20%] 358s ........................................................................ [ 21%] 358s ........................................................................ [ 21%] 358s ........................................................................ [ 21%] 358s ........................................................................ [ 22%] 358s ........................................................................ [ 22%] 358s ........................................................................ [ 22%] 358s ........................................................................ [ 23%] 359s ........................................................................ [ 23%] 359s ........................................................................ [ 23%] 359s ........................................................................ [ 24%] 359s ........................................................................ [ 24%] 359s ........................................................................ [ 24%] 359s ........................................................................ [ 24%] 359s ........................................................................ [ 25%] 359s ........................................................................ [ 25%] 359s ........................................................................ [ 25%] 359s ........................................................................ [ 26%] 359s ........................................................................ [ 26%] 359s .............ssssssssssssssssssssssssssssssssssssssssssssssssssssssss... [ 26%] 359s .ssss....ssss....ssss....ssss.................................. [ 27%] 359s tests/test_cftimeindex.py .............................................. [ 27%] 359s ........................................................................ [ 27%] 359s ........................................................................ [ 28%] 359s ........................................................................ [ 28%] 359s ........................................................................ [ 28%] 359s ........................................................................ [ 29%] 360s ........................................................................ [ 29%] 360s ........................................................................ [ 29%] 360s ........................................................................ [ 30%] 360s ........................................................................ [ 30%] 360s ........................................................................ [ 30%] 360s ........................................................................ [ 31%] 360s ...........................................x............................ [ 31%] 360s ........................................................................ [ 31%] 360s ................................................ [ 31%] 361s tests/test_cftimeindex_resample.py ..................................... [ 32%] 361s ........................................................................ [ 32%] 362s ........................................................................ [ 32%] 362s ........................................................................ [ 33%] 362s ........................................................................ [ 33%] 363s ........................................................................ [ 33%] 363s ........................................................................ [ 34%] 363s ................................................ [ 34%] 364s tests/test_coarsen.py .................................................. [ 34%] 364s ........................................................................ [ 34%] 365s ..........s.......s.......s.......s.......s.......s.......s.......s..... [ 35%] 365s .... [ 35%] 365s tests/test_coding.py ............................... [ 35%] 365s tests/test_coding_strings.py ....................... [ 35%] 365s tests/test_coding_times.py ............................................. [ 35%] 365s ........................................................................ [ 36%] 365s ........................................................................ [ 36%] 365s ........................................................................ [ 36%] 365s ........................................................................ [ 37%] 366s ........................................................................ [ 37%] 366s ........................................................................ [ 37%] 366s ........................................................................ [ 38%] 366s ........................................................................ [ 38%] 366s ........................................................................ [ 38%] 366s ...................s.................................................... [ 39%] 366s ........................................................................ [ 39%] 366s ........................................................................ [ 39%] 366s ......................................ssssssss......s......s......s..... [ 39%] 367s .s......s............................................................... [ 40%] 367s .......................................................... [ 40%] 368s tests/test_combine.py .......................................x.......... [ 40%] 368s ...................................................... [ 41%] 368s tests/test_computation.py .............................................. [ 41%] 369s ........................................................................ [ 41%] 371s ........................................................................ [ 41%] 373s ........................................................................ [ 42%] 373s ..................................XxXx. [ 42%] 374s tests/test_concat.py ................................................... [ 42%] 374s ................................................. [ 42%] 374s tests/test_conventions.py .................................sssssssssssss [ 43%] 374s ssssssssssssssssssssssssssssssssssssssssssssssssssssss........ [ 43%] 374s tests/test_coordinate_transform.py ............ [ 43%] 374s tests/test_coordinates.py ...................... [ 43%] 375s tests/test_dask.py ..................................................... [ 43%] 385s ..........XXx.X......................................................... [ 44%] 385s .......................................................F................ [ 44%] 386s ...................... [ 44%] 386s tests/test_dataarray.py ................................................ [ 44%] 387s ........................................................................ [ 45%] 387s ........................................................................ [ 45%] 387s ........................................................................ [ 45%] 388s s...ss......................................Xx.......................... [ 46%] 389s ..........................ss....ss...................................... [ 46%] 391s ............x.....................................x.......x............. [ 46%] 391s ................sssssssssssss.................ss...... [ 47%] 434s tests/test_dataarray_typing.yml .............. [ 47%] 436s tests/test_dataset.py .................................................. [ 47%] 437s ........................................................................ [ 47%] 437s ......Xx...................................................s............ [ 47%] 437s ..............................................s......................... [ 48%] 438s ........................................................................ [ 48%] 438s ...............................................................ss....ss. [ 48%] 440s ......................................................................ss [ 49%] 440s ... [ 49%] 467s tests/test_dataset_typing.yml .............. [ 49%] 468s tests/test_datatree.py ............................xx..........x......x. [ 49%] 468s ........................................................................ [ 49%] 468s ........x.......... [ 49%] 468s tests/test_datatree_mapping.py .............x........ [ 50%] 497s tests/test_datatree_typing.yml .............. [ 50%] 497s tests/test_deprecation_helpers.py .. [ 50%] 497s tests/test_dtypes.py ................................................... [ 50%] 497s ...sss... [ 50%] 497s tests/test_duck_array_ops.py ......s...........s........................ [ 50%] 498s ..................................................................s..... [ 50%] 498s ..................................ss..............ss..............ss.... [ 51%] 499s ..ss......ss..............ss............................................ [ 51%] 500s ..........ss......ss..............................ss..............ss.... [ 51%] 501s ..........ss......ss......ss..............ss............................ [ 52%] 502s ..........................ss......ss................ssssssssss.......... [ 52%] 502s ssssssssss..........ssssssssss..........ssssssssss..........ssssss...... [ 52%] 503s ........ssssss..............ssssss..............ssssss..............ssss [ 53%] 503s sssssss.s.s.s.s.sssssssssss.s.s.s.s.sssssssssss.s.s.s.s.sssssssssss.s.s. [ 53%] 504s s.s.sssssss.s.s.s.s.s.s.sssssss.s.s.s.s.s.s.sssssss.s.s.s.s.s.s.sssssss. [ 53%] 504s s.s.s.s.s.s............................................................. [ 54%] 505s ........................................................................ [ 54%] 506s ........................................................................ [ 54%] 506s ........................................................................ [ 55%] 507s ........................................................................ [ 55%] 508s ........................................................................ [ 55%] 510s ........................................................ [ 56%] 510s tests/test_duck_array_wrapping.py s.s.ss.s.ss.s.ss.s.ss.s.ss.s.ss.sxss.s [ 56%] 511s .ss.s.ss.s.ss.sxss.s.ss.s.ss.s.ss.s.ss.s.ssXsxss.sxss.sxss.sxss.s.ss.s.s [ 56%] 511s sxsxssxsxssxsxss.s.ss.sxss.s.ss.s.ss.s.ss.s.ss.sxss.sxssxsxss.s.ss.s.ss. [ 57%] 511s sxss.sxss.s.ss.s.ss.s.ss.s.ss.sxss.s.ss.s.ss.s.ss.s.ssXsxss.s.ss.sxss.sx [ 57%] 511s ss.sxss.sxss.sxss.sxss.sxss.sxss.sxss.sxss.s.ss.s.ss.s.ss.s.ss.s.ss.s.ss [ 57%] 512s .s.ss.s.ss.s.ss.s.ss.s.ss.s.ss.s.ss.s.ss.s.ss.s.ss.s.ss.s.ss.s.ss.s.ssxs [ 57%] 512s xss.s.ss.s.ss.s.ssxs.ss.s.ssxsxss.s.ss.s.ss.s.ssxsxss.s.ss.s.ss.s.ss.s.s [ 58%] 512s s.s.ss.s.ss.s.ss.s.s [ 58%] 512s tests/test_error_messages.py .. [ 58%] 512s tests/test_extensions.py .... [ 58%] 512s tests/test_formatting.py .....................................s......... [ 58%] 512s ..... [ 58%] 512s tests/test_formatting_html.py ........................ [ 58%] 513s tests/test_groupby.py ......................s........................... [ 59%] 514s ...............................ss....................................... [ 59%] 515s ........................................................................ [ 59%] 516s .............................................................sssssssss.. [ 60%] 517s ..s..............sssssssssss............. [ 60%] 517s tests/test_hashable.py ........ [ 60%] 517s tests/test_indexes.py .................................................. [ 60%] 517s ........................ [ 60%] 517s tests/test_indexing.py ................................................. [ 60%] 517s ........................................................................ [ 61%] 517s ............... [ 61%] 524s tests/test_interp.py ................................................... [ 61%] 529s .x...................................................................... [ 61%] 539s ................................................................sss..sss [ 62%] 551s ..sss..sss..sss..sss..sss..sss............... [ 62%] 551s tests/test_merge.py .................................................... [ 62%] 551s ... [ 62%] 552s tests/test_missing.py .................................................. [ 62%] 553s ..................s...........................................x.. [ 63%] 553s tests/test_namedarray.py ....x...........................s.............. [ 63%] 553s .. [ 63%] 553s tests/test_nputils.py .. [ 63%] 553s tests/test_options.py ................... [ 63%] 554s tests/test_pandas_to_xarray.py xxxxxxxxxxxxxxxxxxxxxxxsxxxxxx........... [ 63%] 554s ....................... [ 63%] 554s tests/test_parallelcompat.py ............... [ 63%] 555s tests/test_plot.py ..................................................... [ 63%] 556s ........................................................................ [ 64%] 560s ........................................................................ [ 64%] 562s ...............................................s........................ [ 64%] 565s .............X.......................................................x.. [ 65%] 579s ss.ssss................................................................. [ 65%] 580s .......sss.............................................................. [ 65%] 581s .......................................... [ 66%] 581s tests/test_plugins.py ...........F. [ 66%] 581s tests/test_print_versions.py . [ 66%] 584s tests/test_rolling.py .................................................. [ 66%] 586s ........................................................................ [ 66%] 588s ........................................................................ [ 67%] 589s ........................................................................ [ 67%] 591s ........................................................................ [ 67%] 593s ........................................................................ [ 68%] 593s ........................................................................ [ 68%] 594s ........................................................................ [ 68%] 594s ........................................................................ [ 69%] 594s ........................................................................ [ 69%] 596s ........................................................................ [ 69%] 599s ........................................................................ [ 70%] 601s ........................................................................ [ 70%] 604s ........................................................................ [ 70%] 605s ........................................................................ [ 71%] 605s ........................................................................ [ 71%] 605s ........................................................................ [ 71%] 606s ........................................................................ [ 72%] 608s ........................................................................ [ 72%] 610s ........................................................................ [ 72%] 613s ........................................................................ [ 73%] 614s ........................................................................ [ 73%] 614s ........................................................................ [ 73%] 615s ........................................................................ [ 74%] 615s ........................................................................ [ 74%] 619s ........................................................................ [ 74%] 622s ........................................................................ [ 75%] 624s ........................................................................ [ 75%] 625s ........................................................................ [ 75%] 625s ........................................................................ [ 76%] 626s ........................................................................ [ 76%] 630s ........................................................................ [ 76%] 632s ...........ssssssssssssssssssssssssssssssssssssssssss................... [ 77%] 633s ........................................................................ [ 77%] 633s ........................................................................ [ 77%] 633s ........................................................................ [ 78%] 634s ........................................................................ [ 78%] 634s ........................................................................ [ 78%] 634s ........................................................ssssssssssssssss [ 78%] 635s ........................................................................ [ 79%] 635s ........................................................................ [ 79%] 636s ........................................................................ [ 79%] 636s ........................................................................ [ 80%] 639s ........................................................................ [ 80%] 643s ........................................................................ [ 80%] 646s ssssssssssssssss........................................................ [ 81%] 650s ........................................................................ [ 81%] 654s ........................................................................ [ 81%] 657s ........................................................................ [ 82%] 662s ........................................................................ [ 82%] 662s ........sss [ 82%] 672s tests/test_strategies.py ..................... [ 82%] 672s tests/test_treenode.py .................................. [ 82%] 673s tests/test_tutorial.py xxss [ 82%] 673s tests/test_typed_ops.py ..... [ 82%] 674s tests/test_ufuncs.py ................................................... [ 83%] 674s .......................................................................x [ 83%] 674s .. [ 83%] 674s tests/test_units.py .s..s..s..s......sssssxxxxx.....sssss.xxxx.....sssss [ 83%] 677s xxxxx.....sssss.xxxx.....sssssxxxxx.....sssss.xxxx.....sssssxxxxx.....ss [ 84%] 678s sss.xxxx.........sssss..........sssss..........sssss..........sssss..... [ 84%] 678s .....sssss..........sssss..........sssss..........sssss..........sssss.. [ 84%] 678s ........sssss..........sssss..........sssss......s..s..s..s..s..s..s..s. [ 85%] 679s .sx.sx.sx.sx............................................................ [ 85%] 679s ........................................................................ [ 85%] 679s ...................ssssssssss..........ssssssssss....................... [ 86%] 679s ........................................................................ [ 86%] 679s ...................................ss..XX............ss..XX............. [ 86%] 679s ........................................................................ [ 87%] 679s .....................s..s..ss....ss......ss..s.......................ss. [ 87%] 679s .s...................................................................... [ 87%] 684s ....x....x......................xxxxx.....xxxxx.x.x.x.x.x.x.x.x.x.x..... [ 88%] 686s .xxxx................................................................... [ 88%] 686s ...............x...............sssss.....sssssssssssssss.....sssss.....s [ 88%] 686s ssssssssssssss.....sssss..........sssss..................s..s..s..s.ssss [ 89%] 686s ss.s..s..s..s..s..s..s..s.ssssss.s..s..s..s...........ssssssssssssssssss [ 89%] 686s ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 89%] 688s ........................................................xx..xx..ssssssss [ 90%] 690s ssssssssssssxx..xx..ssssssssssssssssssss......ss....s......s..s.s.s.s.s. [ 90%] 690s s...ss....ss....ss....ss....ss....ss....ss....ss...s..s..s.xs.sss.s..s.. [ 90%] 690s s..s.xs.sss.s.....ss....ss....ss....ss....ss....ss....ss....ss.......sss [ 91%] 691s ss..........sssss.......ss....ss........................................ [ 91%] 692s ....................xxxx................................................ [ 91%] 692s ..................................xx.....sssss.....sssss.....sssss.....s [ 92%] 693s ssssssssssssss.....sssss.....sssssssssssssss.....sssss.....sssss........ [ 92%] 693s .......sss...sssxx....s......s......ssssssssssssssssssssssssssssssssssss [ 92%] 693s ssssssssssssssssssssssssssssssssssssssssssssssssssssss...sss......sss... [ 93%] 695s ..................................................xx..xx..ssssssssssssss [ 93%] 696s ssssssxx..xx..ssssssssssssssssssss............ssssssssssss.............. [ 93%] 697s ..........ssssssssssss...............xx.ssssss...Xx....xx.ssssss...Xx..s [ 93%] 698s ..s...........ssssssssss....................ssssssssss.................. [ 94%] 699s s.....ssssssssssssss........s.............s.....ssssssssssssss........s. [ 94%] 699s .........sssss..........sssss.......x.x.x.... [ 94%] 699s tests/test_utils.py .................................................... [ 95%] 699s .............. [ 95%] 700s tests/test_variable.py ................................................. [ 95%] 700s ........................................................................ [ 95%] 700s ........................................................................ [ 96%] 700s ........................................................................ [ 96%] 700s ........................................................................ [ 96%] 707s .................ssss...............x.xX.......xX.......xx.......xx..... [ 97%] 707s ..xx.......s............................................................ [ 97%] 708s ........................ssssssssssssssssssssssssssssssssssssssssssssssss [ 97%] 708s sssssss..........................ssss....................... [ 97%] 708s tests/test_weighted.py ................................................. [ 98%] 708s ........................................................ssssssssssssssss [ 98%] 708s ssssssssssssssssssssssssssssssssssssssssssssssssssssssss................ [ 98%] 710s ........................................................................ [ 99%] 711s ........................................................................ [ 99%] 714s ........................................................................ [ 99%] 716s ................................... [100%] 716s 716s =================================== FAILURES =================================== 716s _________________ TestZarrDictStore.test_non_existent_store[2] _________________ 716s 716s self = 716s 716s def test_non_existent_store(self) -> None: 716s with pytest.raises( 716s FileNotFoundError, match="(No such file or directory|Unable to find group)" 716s ): 716s > xr.open_zarr(f"{uuid.uuid4()}") 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2346: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 716s ds = open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1608: in open_dataset 716s store = ZarrStore.open_group( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:732: in open_group 716s ) = _get_open_params( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1811: in _get_open_params 716s zarr_root_group = zarr.open_consolidated(store, **open_kwargs) 716s /usr/lib/python3/dist-packages/zarr/api/synchronous.py:231: in open_consolidated 716s sync(async_api.open_consolidated(*args, use_consolidated=use_consolidated, **kwargs)) 716s /usr/lib/python3/dist-packages/zarr/core/sync.py:163: in sync 716s raise return_result 716s /usr/lib/python3/dist-packages/zarr/core/sync.py:119: in _runner 716s return await coro 716s /usr/lib/python3/dist-packages/zarr/api/asynchronous.py:408: in open_consolidated 716s return await open_group(*args, use_consolidated=use_consolidated, **kwargs) 716s /usr/lib/python3/dist-packages/zarr/api/asynchronous.py:851: in open_group 716s store_path = await make_store_path(store, mode=mode, storage_options=storage_options, path=path) 716s /usr/lib/python3/dist-packages/zarr/storage/_common.py:418: in make_store_path 716s store = await make_store(store_like, mode=mode, storage_options=storage_options) 716s /usr/lib/python3/dist-packages/zarr/storage/_common.py:349: in make_store 716s return await make_store(Path(store_like), mode=mode, storage_options=storage_options) 716s /usr/lib/python3/dist-packages/zarr/storage/_common.py:339: in make_store 716s return await LocalStore.open(root=store_like, mode=mode, read_only=_read_only) 716s /usr/lib/python3/dist-packages/zarr/storage/_local.py:160: in open 716s await store._open() 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = LocalStore('file:///tmp/autopkgtest.cdpOi4/autopkgtest_tmp/build/4c1e68a9-48f8-4dad-9d46-b39884720db9') 716s 716s async def _open(self, *, mode: AccessModeLiteral | None = None) -> None: 716s if not self.read_only: 716s self.root.mkdir(parents=True, exist_ok=True) 716s 716s if not self.root.exists(): 716s > raise FileNotFoundError(f"{self.root} does not exist") 716s E FileNotFoundError: /tmp/autopkgtest.cdpOi4/autopkgtest_tmp/build/4c1e68a9-48f8-4dad-9d46-b39884720db9 does not exist 716s 716s /usr/lib/python3/dist-packages/zarr/storage/_local.py:172: FileNotFoundError 716s 716s During handling of the above exception, another exception occurred: 716s 716s self = 716s 716s def test_non_existent_store(self) -> None: 716s > with pytest.raises( 716s FileNotFoundError, match="(No such file or directory|Unable to find group)" 716s ): 716s E AssertionError: Regex pattern did not match. 716s E Regex: '(No such file or directory|Unable to find group)' 716s E Input: '/tmp/autopkgtest.cdpOi4/autopkgtest_tmp/build/4c1e68a9-48f8-4dad-9d46-b39884720db9 does not exist' 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2343: AssertionError 716s ______________ TestZarrDirectoryStore.test_non_existent_store[2] _______________ 716s 716s self = 716s 716s def test_non_existent_store(self) -> None: 716s with pytest.raises( 716s FileNotFoundError, match="(No such file or directory|Unable to find group)" 716s ): 716s > xr.open_zarr(f"{uuid.uuid4()}") 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2346: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 716s ds = open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1608: in open_dataset 716s store = ZarrStore.open_group( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:732: in open_group 716s ) = _get_open_params( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1811: in _get_open_params 716s zarr_root_group = zarr.open_consolidated(store, **open_kwargs) 716s /usr/lib/python3/dist-packages/zarr/api/synchronous.py:231: in open_consolidated 716s sync(async_api.open_consolidated(*args, use_consolidated=use_consolidated, **kwargs)) 716s /usr/lib/python3/dist-packages/zarr/core/sync.py:163: in sync 716s raise return_result 716s /usr/lib/python3/dist-packages/zarr/core/sync.py:119: in _runner 716s return await coro 716s /usr/lib/python3/dist-packages/zarr/api/asynchronous.py:408: in open_consolidated 716s return await open_group(*args, use_consolidated=use_consolidated, **kwargs) 716s /usr/lib/python3/dist-packages/zarr/api/asynchronous.py:851: in open_group 716s store_path = await make_store_path(store, mode=mode, storage_options=storage_options, path=path) 716s /usr/lib/python3/dist-packages/zarr/storage/_common.py:418: in make_store_path 716s store = await make_store(store_like, mode=mode, storage_options=storage_options) 716s /usr/lib/python3/dist-packages/zarr/storage/_common.py:349: in make_store 716s return await make_store(Path(store_like), mode=mode, storage_options=storage_options) 716s /usr/lib/python3/dist-packages/zarr/storage/_common.py:339: in make_store 716s return await LocalStore.open(root=store_like, mode=mode, read_only=_read_only) 716s /usr/lib/python3/dist-packages/zarr/storage/_local.py:160: in open 716s await store._open() 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = LocalStore('file:///tmp/autopkgtest.cdpOi4/autopkgtest_tmp/build/9d388802-2d8e-4d8c-8694-2a05b1c995e3') 716s 716s async def _open(self, *, mode: AccessModeLiteral | None = None) -> None: 716s if not self.read_only: 716s self.root.mkdir(parents=True, exist_ok=True) 716s 716s if not self.root.exists(): 716s > raise FileNotFoundError(f"{self.root} does not exist") 716s E FileNotFoundError: /tmp/autopkgtest.cdpOi4/autopkgtest_tmp/build/9d388802-2d8e-4d8c-8694-2a05b1c995e3 does not exist 716s 716s /usr/lib/python3/dist-packages/zarr/storage/_local.py:172: FileNotFoundError 716s 716s During handling of the above exception, another exception occurred: 716s 716s self = 716s 716s def test_non_existent_store(self) -> None: 716s > with pytest.raises( 716s FileNotFoundError, match="(No such file or directory|Unable to find group)" 716s ): 716s E AssertionError: Regex pattern did not match. 716s E Regex: '(No such file or directory|Unable to find group)' 716s E Input: '/tmp/autopkgtest.cdpOi4/autopkgtest_tmp/build/9d388802-2d8e-4d8c-8694-2a05b1c995e3 does not exist' 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2343: AssertionError 716s ________________ TestZarrWriteEmpty.test_non_existent_store[2] _________________ 716s 716s self = 716s 716s def test_non_existent_store(self) -> None: 716s with pytest.raises( 716s FileNotFoundError, match="(No such file or directory|Unable to find group)" 716s ): 716s > xr.open_zarr(f"{uuid.uuid4()}") 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2346: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 716s ds = open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1608: in open_dataset 716s store = ZarrStore.open_group( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:732: in open_group 716s ) = _get_open_params( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1811: in _get_open_params 716s zarr_root_group = zarr.open_consolidated(store, **open_kwargs) 716s /usr/lib/python3/dist-packages/zarr/api/synchronous.py:231: in open_consolidated 716s sync(async_api.open_consolidated(*args, use_consolidated=use_consolidated, **kwargs)) 716s /usr/lib/python3/dist-packages/zarr/core/sync.py:163: in sync 716s raise return_result 716s /usr/lib/python3/dist-packages/zarr/core/sync.py:119: in _runner 716s return await coro 716s /usr/lib/python3/dist-packages/zarr/api/asynchronous.py:408: in open_consolidated 716s return await open_group(*args, use_consolidated=use_consolidated, **kwargs) 716s /usr/lib/python3/dist-packages/zarr/api/asynchronous.py:851: in open_group 716s store_path = await make_store_path(store, mode=mode, storage_options=storage_options, path=path) 716s /usr/lib/python3/dist-packages/zarr/storage/_common.py:418: in make_store_path 716s store = await make_store(store_like, mode=mode, storage_options=storage_options) 716s /usr/lib/python3/dist-packages/zarr/storage/_common.py:349: in make_store 716s return await make_store(Path(store_like), mode=mode, storage_options=storage_options) 716s /usr/lib/python3/dist-packages/zarr/storage/_common.py:339: in make_store 716s return await LocalStore.open(root=store_like, mode=mode, read_only=_read_only) 716s /usr/lib/python3/dist-packages/zarr/storage/_local.py:160: in open 716s await store._open() 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = LocalStore('file:///tmp/autopkgtest.cdpOi4/autopkgtest_tmp/build/6df79716-968d-4c3f-a475-026da631ce0a') 716s 716s async def _open(self, *, mode: AccessModeLiteral | None = None) -> None: 716s if not self.read_only: 716s self.root.mkdir(parents=True, exist_ok=True) 716s 716s if not self.root.exists(): 716s > raise FileNotFoundError(f"{self.root} does not exist") 716s E FileNotFoundError: /tmp/autopkgtest.cdpOi4/autopkgtest_tmp/build/6df79716-968d-4c3f-a475-026da631ce0a does not exist 716s 716s /usr/lib/python3/dist-packages/zarr/storage/_local.py:172: FileNotFoundError 716s 716s During handling of the above exception, another exception occurred: 716s 716s self = 716s 716s def test_non_existent_store(self) -> None: 716s > with pytest.raises( 716s FileNotFoundError, match="(No such file or directory|Unable to find group)" 716s ): 716s E AssertionError: Regex pattern did not match. 716s E Regex: '(No such file or directory|Unable to find group)' 716s E Input: '/tmp/autopkgtest.cdpOi4/autopkgtest_tmp/build/6df79716-968d-4c3f-a475-026da631ce0a does not exist' 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2343: AssertionError 716s _______________ TestZarrWriteEmpty.test_write_empty[2-True-True] _______________ 716s 716s self = 716s consolidated = True, write_empty = True 716s 716s @pytest.mark.parametrize("consolidated", [True, False, None]) 716s @pytest.mark.parametrize("write_empty", [True, False, None]) 716s def test_write_empty( 716s self, 716s consolidated: bool | None, 716s write_empty: bool | None, 716s ) -> None: 716s def assert_expected_files(expected: list[str], store: str) -> None: 716s """Convenience for comparing with actual files written""" 716s ls = [] 716s test_root = os.path.join(store, "test") 716s for root, _, files in os.walk(test_root): 716s ls.extend( 716s [ 716s os.path.join(root, f).removeprefix(test_root).lstrip("/") 716s for f in files 716s ] 716s ) 716s 716s assert set(expected) == set( 716s [ 716s file.lstrip("c/") 716s for file in ls 716s if (file not in (".zattrs", ".zarray", "zarr.json")) 716s ] 716s ) 716s 716s # The zarr format is set by the `default_zarr_format` 716s # pytest fixture that acts on a superclass 716s zarr_format_3 = has_zarr_v3 and zarr.config.config["default_zarr_format"] == 3 716s if (write_empty is False) or (write_empty is None and has_zarr_v3): 716s expected = ["0.1.0"] 716s else: 716s expected = [ 716s "0.0.0", 716s "0.0.1", 716s "0.1.0", 716s "0.1.1", 716s ] 716s 716s if zarr_format_3: 716s data = np.array([0.0, 0, 1.0, 0]).reshape((1, 2, 2)) 716s # transform to the path style of zarr 3 716s # e.g. 0/0/1 716s expected = [e.replace(".", "/") for e in expected] 716s else: 716s # use nan for default fill_value behaviour 716s data = np.array([np.nan, np.nan, 1.0, np.nan]).reshape((1, 2, 2)) 716s 716s ds = xr.Dataset(data_vars={"test": (("Z", "Y", "X"), data)}) 716s 716s if has_dask: 716s ds["test"] = ds["test"].chunk(1) 716s encoding = None 716s else: 716s encoding = {"test": {"chunks": (1, 1, 1)}} 716s 716s with self.temp_dir() as (d, store): 716s ds.to_zarr( 716s store, 716s mode="w", 716s encoding=encoding, 716s write_empty_chunks=write_empty, 716s ) 716s 716s # check expected files after a write 716s assert_expected_files(expected, store) 716s 716s with self.roundtrip_dir( 716s ds, 716s store, 716s save_kwargs={ 716s "mode": "a", 716s "append_dim": "Z", 716s "write_empty_chunks": write_empty, 716s }, 716s ) as a_ds: 716s expected_ds = xr.concat([ds, ds], dim="Z") 716s 716s assert_identical(a_ds, expected_ds.compute()) 716s # add the new files we expect to be created by the append 716s # that was performed by the roundtrip_dir 716s if (write_empty is False) or (write_empty is None and has_zarr_v3): 716s expected.append("1.1.0") 716s else: 716s if not has_zarr_v3: 716s # TODO: remove zarr3 if once zarr issue is fixed 716s # https://github.com/zarr-developers/zarr-python/issues/2931 716s expected.extend( 716s [ 716s "1.1.0", 716s "1.0.0", 716s "1.0.1", 716s "1.1.1", 716s ] 716s ) 716s else: 716s expected.append("1.1.0") 716s if zarr_format_3: 716s expected = [e.replace(".", "/") for e in expected] 716s > assert_expected_files(expected, store) 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3793: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s expected = ['0.0.0', '0.0.1', '0.1.0', '0.1.1', '1.1.0'] 716s store = '/tmp/tmphi2bh41e/test.zarr' 716s 716s def assert_expected_files(expected: list[str], store: str) -> None: 716s """Convenience for comparing with actual files written""" 716s ls = [] 716s test_root = os.path.join(store, "test") 716s for root, _, files in os.walk(test_root): 716s ls.extend( 716s [ 716s os.path.join(root, f).removeprefix(test_root).lstrip("/") 716s for f in files 716s ] 716s ) 716s 716s > assert set(expected) == set( 716s [ 716s file.lstrip("c/") 716s for file in ls 716s if (file not in (".zattrs", ".zarray", "zarr.json")) 716s ] 716s ) 716s E AssertionError: assert {'0.0.0', '0....1.1', '1.1.0'} == {'0.0.0', '0.... '1.0.1', ...} 716s E 716s E Extra items in the right set: 716s E '1.1.1' 716s E '1.0.1' 716s E '1.0.0' 716s E Use -v to get more diff 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3712: AssertionError 716s ______________ TestZarrWriteEmpty.test_write_empty[2-True-False] _______________ 716s 716s self = 716s consolidated = False, write_empty = True 716s 716s @pytest.mark.parametrize("consolidated", [True, False, None]) 716s @pytest.mark.parametrize("write_empty", [True, False, None]) 716s def test_write_empty( 716s self, 716s consolidated: bool | None, 716s write_empty: bool | None, 716s ) -> None: 716s def assert_expected_files(expected: list[str], store: str) -> None: 716s """Convenience for comparing with actual files written""" 716s ls = [] 716s test_root = os.path.join(store, "test") 716s for root, _, files in os.walk(test_root): 716s ls.extend( 716s [ 716s os.path.join(root, f).removeprefix(test_root).lstrip("/") 716s for f in files 716s ] 716s ) 716s 716s assert set(expected) == set( 716s [ 716s file.lstrip("c/") 716s for file in ls 716s if (file not in (".zattrs", ".zarray", "zarr.json")) 716s ] 716s ) 716s 716s # The zarr format is set by the `default_zarr_format` 716s # pytest fixture that acts on a superclass 716s zarr_format_3 = has_zarr_v3 and zarr.config.config["default_zarr_format"] == 3 716s if (write_empty is False) or (write_empty is None and has_zarr_v3): 716s expected = ["0.1.0"] 716s else: 716s expected = [ 716s "0.0.0", 716s "0.0.1", 716s "0.1.0", 716s "0.1.1", 716s ] 716s 716s if zarr_format_3: 716s data = np.array([0.0, 0, 1.0, 0]).reshape((1, 2, 2)) 716s # transform to the path style of zarr 3 716s # e.g. 0/0/1 716s expected = [e.replace(".", "/") for e in expected] 716s else: 716s # use nan for default fill_value behaviour 716s data = np.array([np.nan, np.nan, 1.0, np.nan]).reshape((1, 2, 2)) 716s 716s ds = xr.Dataset(data_vars={"test": (("Z", "Y", "X"), data)}) 716s 716s if has_dask: 716s ds["test"] = ds["test"].chunk(1) 716s encoding = None 716s else: 716s encoding = {"test": {"chunks": (1, 1, 1)}} 716s 716s with self.temp_dir() as (d, store): 716s ds.to_zarr( 716s store, 716s mode="w", 716s encoding=encoding, 716s write_empty_chunks=write_empty, 716s ) 716s 716s # check expected files after a write 716s assert_expected_files(expected, store) 716s 716s with self.roundtrip_dir( 716s ds, 716s store, 716s save_kwargs={ 716s "mode": "a", 716s "append_dim": "Z", 716s "write_empty_chunks": write_empty, 716s }, 716s ) as a_ds: 716s expected_ds = xr.concat([ds, ds], dim="Z") 716s 716s assert_identical(a_ds, expected_ds.compute()) 716s # add the new files we expect to be created by the append 716s # that was performed by the roundtrip_dir 716s if (write_empty is False) or (write_empty is None and has_zarr_v3): 716s expected.append("1.1.0") 716s else: 716s if not has_zarr_v3: 716s # TODO: remove zarr3 if once zarr issue is fixed 716s # https://github.com/zarr-developers/zarr-python/issues/2931 716s expected.extend( 716s [ 716s "1.1.0", 716s "1.0.0", 716s "1.0.1", 716s "1.1.1", 716s ] 716s ) 716s else: 716s expected.append("1.1.0") 716s if zarr_format_3: 716s expected = [e.replace(".", "/") for e in expected] 716s > assert_expected_files(expected, store) 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3793: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s expected = ['0.0.0', '0.0.1', '0.1.0', '0.1.1', '1.1.0'] 716s store = '/tmp/tmp5gu7a97m/test.zarr' 716s 716s def assert_expected_files(expected: list[str], store: str) -> None: 716s """Convenience for comparing with actual files written""" 716s ls = [] 716s test_root = os.path.join(store, "test") 716s for root, _, files in os.walk(test_root): 716s ls.extend( 716s [ 716s os.path.join(root, f).removeprefix(test_root).lstrip("/") 716s for f in files 716s ] 716s ) 716s 716s > assert set(expected) == set( 716s [ 716s file.lstrip("c/") 716s for file in ls 716s if (file not in (".zattrs", ".zarray", "zarr.json")) 716s ] 716s ) 716s E AssertionError: assert {'0.0.0', '0....1.1', '1.1.0'} == {'0.0.0', '0.... '1.0.1', ...} 716s E 716s E Extra items in the right set: 716s E '1.1.1' 716s E '1.0.1' 716s E '1.0.0' 716s E Use -v to get more diff 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3712: AssertionError 716s _______________ TestZarrWriteEmpty.test_write_empty[2-True-None] _______________ 716s 716s self = 716s consolidated = None, write_empty = True 716s 716s @pytest.mark.parametrize("consolidated", [True, False, None]) 716s @pytest.mark.parametrize("write_empty", [True, False, None]) 716s def test_write_empty( 716s self, 716s consolidated: bool | None, 716s write_empty: bool | None, 716s ) -> None: 716s def assert_expected_files(expected: list[str], store: str) -> None: 716s """Convenience for comparing with actual files written""" 716s ls = [] 716s test_root = os.path.join(store, "test") 716s for root, _, files in os.walk(test_root): 716s ls.extend( 716s [ 716s os.path.join(root, f).removeprefix(test_root).lstrip("/") 716s for f in files 716s ] 716s ) 716s 716s assert set(expected) == set( 716s [ 716s file.lstrip("c/") 716s for file in ls 716s if (file not in (".zattrs", ".zarray", "zarr.json")) 716s ] 716s ) 716s 716s # The zarr format is set by the `default_zarr_format` 716s # pytest fixture that acts on a superclass 716s zarr_format_3 = has_zarr_v3 and zarr.config.config["default_zarr_format"] == 3 716s if (write_empty is False) or (write_empty is None and has_zarr_v3): 716s expected = ["0.1.0"] 716s else: 716s expected = [ 716s "0.0.0", 716s "0.0.1", 716s "0.1.0", 716s "0.1.1", 716s ] 716s 716s if zarr_format_3: 716s data = np.array([0.0, 0, 1.0, 0]).reshape((1, 2, 2)) 716s # transform to the path style of zarr 3 716s # e.g. 0/0/1 716s expected = [e.replace(".", "/") for e in expected] 716s else: 716s # use nan for default fill_value behaviour 716s data = np.array([np.nan, np.nan, 1.0, np.nan]).reshape((1, 2, 2)) 716s 716s ds = xr.Dataset(data_vars={"test": (("Z", "Y", "X"), data)}) 716s 716s if has_dask: 716s ds["test"] = ds["test"].chunk(1) 716s encoding = None 716s else: 716s encoding = {"test": {"chunks": (1, 1, 1)}} 716s 716s with self.temp_dir() as (d, store): 716s ds.to_zarr( 716s store, 716s mode="w", 716s encoding=encoding, 716s write_empty_chunks=write_empty, 716s ) 716s 716s # check expected files after a write 716s assert_expected_files(expected, store) 716s 716s with self.roundtrip_dir( 716s ds, 716s store, 716s save_kwargs={ 716s "mode": "a", 716s "append_dim": "Z", 716s "write_empty_chunks": write_empty, 716s }, 716s ) as a_ds: 716s expected_ds = xr.concat([ds, ds], dim="Z") 716s 716s assert_identical(a_ds, expected_ds.compute()) 716s # add the new files we expect to be created by the append 716s # that was performed by the roundtrip_dir 716s if (write_empty is False) or (write_empty is None and has_zarr_v3): 716s expected.append("1.1.0") 716s else: 716s if not has_zarr_v3: 716s # TODO: remove zarr3 if once zarr issue is fixed 716s # https://github.com/zarr-developers/zarr-python/issues/2931 716s expected.extend( 716s [ 716s "1.1.0", 716s "1.0.0", 716s "1.0.1", 716s "1.1.1", 716s ] 716s ) 716s else: 716s expected.append("1.1.0") 716s if zarr_format_3: 716s expected = [e.replace(".", "/") for e in expected] 716s > assert_expected_files(expected, store) 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3793: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s expected = ['0.0.0', '0.0.1', '0.1.0', '0.1.1', '1.1.0'] 716s store = '/tmp/tmpwj2lukcq/test.zarr' 716s 716s def assert_expected_files(expected: list[str], store: str) -> None: 716s """Convenience for comparing with actual files written""" 716s ls = [] 716s test_root = os.path.join(store, "test") 716s for root, _, files in os.walk(test_root): 716s ls.extend( 716s [ 716s os.path.join(root, f).removeprefix(test_root).lstrip("/") 716s for f in files 716s ] 716s ) 716s 716s > assert set(expected) == set( 716s [ 716s file.lstrip("c/") 716s for file in ls 716s if (file not in (".zattrs", ".zarray", "zarr.json")) 716s ] 716s ) 716s E AssertionError: assert {'0.0.0', '0....1.1', '1.1.0'} == {'0.0.0', '0.... '1.0.1', ...} 716s E 716s E Extra items in the right set: 716s E '1.1.1' 716s E '1.0.1' 716s E '1.0.0' 716s E Use -v to get more diff 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3712: AssertionError 716s _____________ TestZarrDictStore.test_zero_dimensional_variable[3] ______________ 716s 716s self = 716s 716s def test_zero_dimensional_variable(self) -> None: 716s expected = create_test_data() 716s expected["float_var"] = ([], 1.0e9, {"units": "units of awesome"}) 716s expected["bytes_var"] = ([], b"foobar") 716s expected["string_var"] = ([], "foobar") 716s > with self.roundtrip(expected) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:408: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ____________________ TestZarrDictStore.test_write_store[3] _____________________ 716s 716s self = 716s 716s def test_write_store(self) -> None: 716s expected = create_test_data() 716s with self.create_store() as store: 716s expected.dump_to_store(store) 716s # we need to cf decode the store because it has time and 716s # non-dimension coordinates 716s > with xr.decode_cf(store) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:417: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/conventions.py:570: in decode_cf 716s vars, attrs = obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'var3' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ________________ TestZarrDictStore.test_roundtrip_test_data[3] _________________ 716s 716s self = 716s 716s def test_roundtrip_test_data(self) -> None: 716s expected = create_test_data() 716s > with self.roundtrip(expected) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:441: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ________________________ TestZarrDictStore.test_load[3] ________________________ 716s 716s self = 716s 716s def test_load(self) -> None: 716s expected = create_test_data() 716s 716s @contextlib.contextmanager 716s def assert_loads(vars=None): 716s if vars is None: 716s vars = expected 716s with self.roundtrip(expected) as actual: 716s for k, v in actual.variables.items(): 716s # IndexVariables are eagerly loaded into memory 716s assert v._in_memory == (k in actual.dims) 716s yield actual 716s for k, v in actual.variables.items(): 716s if k in vars: 716s assert v._in_memory 716s assert_identical(expected, actual) 716s 716s with pytest.raises(AssertionError): 716s # make sure the contextmanager works! 716s > with assert_loads() as ds: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:464: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:452: in assert_loads 716s with self.roundtrip(expected) as actual: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s __________________ TestZarrDictStore.test_dataset_compute[3] ___________________ 716s 716s self = 716s 716s def test_dataset_compute(self) -> None: 716s expected = create_test_data() 716s 716s > with self.roundtrip(expected) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:481: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _______________ TestZarrDictStore.test_roundtrip_object_dtype[3] _______________ 716s 716s self = 716s 716s def test_roundtrip_object_dtype(self) -> None: 716s floats = np.array([0.0, 0.0, 1.0, 2.0, 3.0], dtype=object) 716s floats_nans = np.array([np.nan, np.nan, 1.0, 2.0, 3.0], dtype=object) 716s bytes_ = np.array([b"ab", b"cdef", b"g"], dtype=object) 716s bytes_nans = np.array([b"ab", b"cdef", np.nan], dtype=object) 716s strings = np.array(["ab", "cdef", "g"], dtype=object) 716s strings_nans = np.array(["ab", "cdef", np.nan], dtype=object) 716s all_nans = np.array([np.nan, np.nan], dtype=object) 716s original = Dataset( 716s { 716s "floats": ("a", floats), 716s "floats_nans": ("a", floats_nans), 716s "bytes": ("b", bytes_), 716s "bytes_nans": ("b", bytes_nans), 716s "strings": ("b", strings), 716s "strings_nans": ("b", strings_nans), 716s "all_nans": ("c", all_nans), 716s "nan": ([], np.nan), 716s } 716s ) 716s expected = original.copy(deep=True) 716s > with self.roundtrip(original) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:558: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'nan' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _______________ TestZarrDictStore.test_roundtrip_float64_data[3] _______________ 716s 716s self = 716s 716s def test_roundtrip_float64_data(self) -> None: 716s expected = Dataset({"x": ("y", np.array([1.0, 2.0, np.pi], dtype="float64"))}) 716s > with self.roundtrip(expected) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:646: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'x' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ________________ TestZarrDictStore.test_orthogonal_indexing[3] _________________ 716s 716s self = 716s 716s def test_orthogonal_indexing(self) -> None: 716s in_memory = create_test_data() 716s > with self.roundtrip(in_memory) as on_disk: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:713: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ________________ TestZarrDictStore.test_vectorized_indexing[3] _________________ 716s 716s self = 716s 716s def test_vectorized_indexing(self) -> None: 716s in_memory = create_test_data() 716s > with self.roundtrip(in_memory) as on_disk: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:727: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _________ TestZarrDictStore.test_vectorized_indexing_negative_step[3] __________ 716s 716s self = 716s 716s def test_vectorized_indexing_negative_step(self) -> None: 716s # use dask explicitly when present 716s open_kwargs: dict[str, Any] | None 716s if has_dask: 716s open_kwargs = {"chunks": {}} 716s else: 716s open_kwargs = None 716s in_memory = create_test_data() 716s 716s def multiple_indexing(indexers): 716s # make sure a sequence of lazy indexings certainly works. 716s with self.roundtrip(in_memory, open_kwargs=open_kwargs) as on_disk: 716s actual = on_disk["var3"] 716s expected = in_memory["var3"] 716s for ind in indexers: 716s actual = actual.isel(ind) 716s expected = expected.isel(ind) 716s # make sure the array is not yet loaded into memory 716s assert not actual.variable._in_memory 716s assert_identical(expected, actual.load()) 716s 716s # with negative step slice. 716s indexers = [ 716s { 716s "dim1": DataArray([[0, 7], [2, 6], [3, 5]], dims=["a", "b"]), 716s "dim3": slice(-1, 1, -1), 716s } 716s ] 716s > multiple_indexing(indexers) 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:817: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:800: in multiple_indexing 716s with self.roundtrip(in_memory, open_kwargs=open_kwargs) as on_disk: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ______________ TestZarrDictStore.test_outer_indexing_reversed[3] _______________ 716s 716s self = 716s 716s def test_outer_indexing_reversed(self) -> None: 716s # regression test for GH6560 716s ds = xr.Dataset( 716s {"z": (("t", "p", "y", "x"), np.ones((1, 1, 31, 40)))}, 716s ) 716s 716s > with self.roundtrip(ds) as on_disk: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:834: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'z' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ___________________ TestZarrDictStore.test_isel_dataarray[3] ___________________ 716s 716s self = 716s 716s def test_isel_dataarray(self) -> None: 716s # Make sure isel works lazily. GH:issue:1688 716s in_memory = create_test_data() 716s > with self.roundtrip(in_memory) as on_disk: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:841: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _____________ TestZarrDictStore.test_array_type_after_indexing[3] ______________ 716s 716s self = 716s 716s def test_array_type_after_indexing(self) -> None: 716s in_memory = create_test_data() 716s > with self.roundtrip(in_memory) as on_disk: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:868: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _______________________ TestZarrDictStore.test_dropna[3] _______________________ 716s 716s self = 716s 716s def test_dropna(self) -> None: 716s # regression test for GH:issue:1694 716s a = np.random.randn(4, 3) 716s a[1, 1] = np.nan 716s in_memory = xr.Dataset( 716s {"a": (("y", "x"), a)}, coords={"y": np.arange(4), "x": np.arange(3)} 716s ) 716s 716s assert_identical( 716s in_memory.dropna(dim="x"), in_memory.isel(x=slice(None, None, 2)) 716s ) 716s 716s > with self.roundtrip(in_memory) as on_disk: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:893: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'a' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _________________ TestZarrDictStore.test_ondisk_after_print[3] _________________ 716s 716s self = 716s 716s def test_ondisk_after_print(self) -> None: 716s """Make sure print does not load file into memory""" 716s in_memory = create_test_data() 716s > with self.roundtrip(in_memory) as on_disk: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:902: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s __________ TestZarrDictStore.test_roundtrip_bytes_with_fill_value[3] ___________ 716s 716s self = 716s 716s def test_roundtrip_bytes_with_fill_value(self) -> None: 716s values = np.array([b"ab", b"cdef", np.nan], dtype=object) 716s encoding = {"_FillValue": b"X", "dtype": "S1"} 716s original = Dataset({"x": ("t", values, {}, encoding)}) 716s expected = original.copy(deep=True) 716s > with self.roundtrip(original) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:913: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'x' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'NullTerminatedBytes' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ________ TestZarrDictStore.test_roundtrip_unsigned[3-fill_value0-False] ________ 716s 716s self = 716s fill_value = np.int8(-1), exp_fill_warning = False 716s 716s @pytest.mark.parametrize( 716s ("fill_value", "exp_fill_warning"), 716s [ 716s (np.int8(-1), False), 716s (np.uint8(255), True), 716s (-1, False), 716s (255, True), 716s ], 716s ) 716s def test_roundtrip_unsigned(self, fill_value, exp_fill_warning): 716s @contextlib.contextmanager 716s def _roundtrip_with_warnings(*args, **kwargs): 716s is_np2 = module_available("numpy", minversion="2.0.0.dev0") 716s if exp_fill_warning and is_np2: 716s warn_checker: contextlib.AbstractContextManager = pytest.warns( 716s SerializationWarning, 716s match="_FillValue attribute can't be represented", 716s ) 716s else: 716s warn_checker = contextlib.nullcontext() 716s with warn_checker: 716s with self.roundtrip(*args, **kwargs) as actual: 716s yield actual 716s 716s # regression/numpy2 test for 716s encoding = { 716s "_FillValue": fill_value, 716s "_Unsigned": "true", 716s "dtype": "i1", 716s } 716s x = np.array([0, 1, 127, 128, 254, np.nan], dtype=np.float32) 716s decoded = Dataset({"x": ("t", x, {}, encoding)}) 716s 716s attributes = { 716s "_FillValue": fill_value, 716s "_Unsigned": "true", 716s } 716s # Create unsigned data corresponding to [0, 1, 127, 128, 255] unsigned 716s sb = np.asarray([0, 1, 127, -128, -2, -1], dtype="i1") 716s encoded = Dataset({"x": ("t", sb, attributes)}) 716s unsigned_dtype = np.dtype(f"u{sb.dtype.itemsize}") 716s 716s > with _roundtrip_with_warnings(decoded) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1066: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1045: in _roundtrip_with_warnings 716s with self.roundtrip(*args, **kwargs) as actual: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'x' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Int8' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ________ TestZarrDictStore.test_roundtrip_unsigned[3-fill_value1-True] _________ 716s 716s self = 716s fill_value = np.uint8(255), exp_fill_warning = True 716s 716s @pytest.mark.parametrize( 716s ("fill_value", "exp_fill_warning"), 716s [ 716s (np.int8(-1), False), 716s (np.uint8(255), True), 716s (-1, False), 716s (255, True), 716s ], 716s ) 716s def test_roundtrip_unsigned(self, fill_value, exp_fill_warning): 716s @contextlib.contextmanager 716s def _roundtrip_with_warnings(*args, **kwargs): 716s is_np2 = module_available("numpy", minversion="2.0.0.dev0") 716s if exp_fill_warning and is_np2: 716s warn_checker: contextlib.AbstractContextManager = pytest.warns( 716s SerializationWarning, 716s match="_FillValue attribute can't be represented", 716s ) 716s else: 716s warn_checker = contextlib.nullcontext() 716s with warn_checker: 716s with self.roundtrip(*args, **kwargs) as actual: 716s yield actual 716s 716s # regression/numpy2 test for 716s encoding = { 716s "_FillValue": fill_value, 716s "_Unsigned": "true", 716s "dtype": "i1", 716s } 716s x = np.array([0, 1, 127, 128, 254, np.nan], dtype=np.float32) 716s decoded = Dataset({"x": ("t", x, {}, encoding)}) 716s 716s attributes = { 716s "_FillValue": fill_value, 716s "_Unsigned": "true", 716s } 716s # Create unsigned data corresponding to [0, 1, 127, 128, 255] unsigned 716s sb = np.asarray([0, 1, 127, -128, -2, -1], dtype="i1") 716s encoded = Dataset({"x": ("t", sb, attributes)}) 716s unsigned_dtype = np.dtype(f"u{sb.dtype.itemsize}") 716s 716s > with _roundtrip_with_warnings(decoded) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1066: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1045: in _roundtrip_with_warnings 716s with self.roundtrip(*args, **kwargs) as actual: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'x' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Int8' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ____________ TestZarrDictStore.test_roundtrip_unsigned[3--1-False] _____________ 716s 716s self = 716s fill_value = -1, exp_fill_warning = False 716s 716s @pytest.mark.parametrize( 716s ("fill_value", "exp_fill_warning"), 716s [ 716s (np.int8(-1), False), 716s (np.uint8(255), True), 716s (-1, False), 716s (255, True), 716s ], 716s ) 716s def test_roundtrip_unsigned(self, fill_value, exp_fill_warning): 716s @contextlib.contextmanager 716s def _roundtrip_with_warnings(*args, **kwargs): 716s is_np2 = module_available("numpy", minversion="2.0.0.dev0") 716s if exp_fill_warning and is_np2: 716s warn_checker: contextlib.AbstractContextManager = pytest.warns( 716s SerializationWarning, 716s match="_FillValue attribute can't be represented", 716s ) 716s else: 716s warn_checker = contextlib.nullcontext() 716s with warn_checker: 716s with self.roundtrip(*args, **kwargs) as actual: 716s yield actual 716s 716s # regression/numpy2 test for 716s encoding = { 716s "_FillValue": fill_value, 716s "_Unsigned": "true", 716s "dtype": "i1", 716s } 716s x = np.array([0, 1, 127, 128, 254, np.nan], dtype=np.float32) 716s decoded = Dataset({"x": ("t", x, {}, encoding)}) 716s 716s attributes = { 716s "_FillValue": fill_value, 716s "_Unsigned": "true", 716s } 716s # Create unsigned data corresponding to [0, 1, 127, 128, 255] unsigned 716s sb = np.asarray([0, 1, 127, -128, -2, -1], dtype="i1") 716s encoded = Dataset({"x": ("t", sb, attributes)}) 716s unsigned_dtype = np.dtype(f"u{sb.dtype.itemsize}") 716s 716s > with _roundtrip_with_warnings(decoded) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1066: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1045: in _roundtrip_with_warnings 716s with self.roundtrip(*args, **kwargs) as actual: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'x' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Int8' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ____________ TestZarrDictStore.test_roundtrip_unsigned[3-255-True] _____________ 716s 716s self = 716s fill_value = 255, exp_fill_warning = True 716s 716s @pytest.mark.parametrize( 716s ("fill_value", "exp_fill_warning"), 716s [ 716s (np.int8(-1), False), 716s (np.uint8(255), True), 716s (-1, False), 716s (255, True), 716s ], 716s ) 716s def test_roundtrip_unsigned(self, fill_value, exp_fill_warning): 716s @contextlib.contextmanager 716s def _roundtrip_with_warnings(*args, **kwargs): 716s is_np2 = module_available("numpy", minversion="2.0.0.dev0") 716s if exp_fill_warning and is_np2: 716s warn_checker: contextlib.AbstractContextManager = pytest.warns( 716s SerializationWarning, 716s match="_FillValue attribute can't be represented", 716s ) 716s else: 716s warn_checker = contextlib.nullcontext() 716s with warn_checker: 716s with self.roundtrip(*args, **kwargs) as actual: 716s yield actual 716s 716s # regression/numpy2 test for 716s encoding = { 716s "_FillValue": fill_value, 716s "_Unsigned": "true", 716s "dtype": "i1", 716s } 716s x = np.array([0, 1, 127, 128, 254, np.nan], dtype=np.float32) 716s decoded = Dataset({"x": ("t", x, {}, encoding)}) 716s 716s attributes = { 716s "_FillValue": fill_value, 716s "_Unsigned": "true", 716s } 716s # Create unsigned data corresponding to [0, 1, 127, 128, 255] unsigned 716s sb = np.asarray([0, 1, 127, -128, -2, -1], dtype="i1") 716s encoded = Dataset({"x": ("t", sb, attributes)}) 716s unsigned_dtype = np.dtype(f"u{sb.dtype.itemsize}") 716s 716s > with _roundtrip_with_warnings(decoded) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1066: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1045: in _roundtrip_with_warnings 716s with self.roundtrip(*args, **kwargs) as actual: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'x' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Int8' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _ TestZarrDictStore.test_grid_mapping_and_bounds_are_not_coordinates_in_file[3] _ 716s 716s self = 716s 716s def test_grid_mapping_and_bounds_are_not_coordinates_in_file(self) -> None: 716s original = self._create_cf_dataset() 716s > with self.roundtrip(original, open_kwargs={"decode_coords": False}) as ds: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1142: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = 716s name = 'det_lim' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ____ TestZarrDictStore.test_coordinate_variables_after_dataset_roundtrip[3] ____ 716s 716s self = 716s 716s def test_coordinate_variables_after_dataset_roundtrip(self) -> None: 716s original = self._create_cf_dataset() 716s > with self.roundtrip(original, open_kwargs={"decode_coords": "all"}) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1150: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = 716s name = 'det_lim' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _ TestZarrDictStore.test_grid_mapping_and_bounds_are_coordinates_after_dataarray_roundtrip[3] _ 716s 716s self = 716s 716s def test_grid_mapping_and_bounds_are_coordinates_after_dataarray_roundtrip( 716s self, 716s ) -> None: 716s original = self._create_cf_dataset() 716s # The DataArray roundtrip should have the same warnings as the 716s # Dataset, but we already tested for those, so just go for the 716s # new warnings. It would appear that there is no way to tell 716s # pytest "This warning and also this warning should both be 716s # present". 716s # xarray/tests/test_conventions.py::TestCFEncodedDataStore 716s # needs the to_dataset. The other backends should be fine 716s # without it. 716s with pytest.warns( 716s UserWarning, 716s match=( 716s r"Variable\(s\) referenced in bounds not in variables: " 716s r"\['l(at|ong)itude_bnds'\]" 716s ), 716s ): 716s > with self.roundtrip( 716s original["variable"].to_dataset(), open_kwargs={"decode_coords": "all"} 716s ) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1182: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'ln_p' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s 716s During handling of the above exception, another exception occurred: 716s 716s self = 716s 716s def test_grid_mapping_and_bounds_are_coordinates_after_dataarray_roundtrip( 716s self, 716s ) -> None: 716s original = self._create_cf_dataset() 716s # The DataArray roundtrip should have the same warnings as the 716s # Dataset, but we already tested for those, so just go for the 716s # new warnings. It would appear that there is no way to tell 716s # pytest "This warning and also this warning should both be 716s # present". 716s # xarray/tests/test_conventions.py::TestCFEncodedDataStore 716s # needs the to_dataset. The other backends should be fine 716s # without it. 716s > with pytest.warns( 716s UserWarning, 716s match=( 716s r"Variable\(s\) referenced in bounds not in variables: " 716s r"\['l(at|ong)itude_bnds'\]" 716s ), 716s ): 716s E Failed: DID NOT WARN. No warnings of type (,) matching the regex were emitted. 716s E Regex: Variable\(s\) referenced in bounds not in variables: \['l(at|ong)itude_bnds'\] 716s E Emitted warnings: [ ZarrUserWarning('Consolidated metadata is currently not part in the Zarr format 3 specification. It may not be supported by other zarr implementations and may change in the future.')]. 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1175: Failed 716s ___________________ TestZarrDictStore.test_encoding_kwarg[3] ___________________ 716s 716s self = 716s 716s def test_encoding_kwarg(self) -> None: 716s ds = Dataset({"x": ("y", np.arange(10.0))}) 716s 716s kwargs: dict[str, Any] = dict(encoding={"x": {"dtype": "f4"}}) 716s > with self.roundtrip(ds, save_kwargs=kwargs) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1277: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'x' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float32' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _________________ TestZarrDictStore.test_default_fill_value[3] _________________ 716s 716s self = 716s 716s def test_default_fill_value(self) -> None: 716s # Test default encoding for float: 716s ds = Dataset({"x": ("y", np.arange(10.0))}) 716s kwargs = dict(encoding={"x": {"dtype": "f4"}}) 716s > with self.roundtrip(ds, save_kwargs=kwargs) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1319: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'x' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float32' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ________ TestZarrDictStore.test_explicitly_omit_fill_value_in_coord[3] _________ 716s 716s self = 716s 716s def test_explicitly_omit_fill_value_in_coord(self) -> None: 716s ds = Dataset({"x": ("y", [np.pi, -np.pi])}, coords={"y": [0.0, 1.0]}) 716s ds.y.encoding["_FillValue"] = None 716s > with self.roundtrip(ds) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1355: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'x' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _ TestZarrDictStore.test_explicitly_omit_fill_value_in_coord_via_encoding_kwarg[3] _ 716s 716s self = 716s 716s def test_explicitly_omit_fill_value_in_coord_via_encoding_kwarg(self) -> None: 716s ds = Dataset({"x": ("y", [np.pi, -np.pi])}, coords={"y": [0.0, 1.0]}) 716s kwargs = dict(encoding={"y": {"_FillValue": None}}) 716s > with self.roundtrip(ds, save_kwargs=kwargs) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1361: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'x' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ________________ TestZarrDictStore.test_encoding_same_dtype[3] _________________ 716s 716s self = 716s 716s def test_encoding_same_dtype(self) -> None: 716s ds = Dataset({"x": ("y", np.arange(10.0, dtype="f4"))}) 716s kwargs = dict(encoding={"x": {"dtype": "f4"}}) 716s > with self.roundtrip(ds, save_kwargs=kwargs) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1368: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'x' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float32' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ______________ TestZarrDictStore.test_append_overwrite_values[3] _______________ 716s 716s self = 716s 716s def test_append_overwrite_values(self) -> None: 716s # regression for GH1215 716s data = create_test_data() 716s with create_tmp_file(allow_cleanup_failure=False) as tmp_file: 716s self.save(data, tmp_file, mode="w") 716s data["var2"][:] = -999 716s data["var9"] = data["var2"] * 3 716s > self.save(data[["var2", "var9"]], tmp_file, mode="a") 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1387: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2296: in save 716s return dataset.to_zarr(store=store_target, **kwargs, **self.version_kwargs) 716s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 716s return to_zarr( # type: ignore[call-overload,misc] 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 716s dump_to_store(dataset, zstore, writer, encoding=encoding) 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 716s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 716s k: self.open_store_variable(name=k) for k in existing_variable_names 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ____________ TestZarrDictStore.test_roundtrip_consolidated[3-False] ____________ 716s 716s self = 716s consolidated = False 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s def test_roundtrip_consolidated(self, consolidated) -> None: 716s expected = create_test_data() 716s > with self.roundtrip( 716s expected, 716s save_kwargs={"consolidated": consolidated}, 716s open_kwargs={"backend_kwargs": {"consolidated": consolidated}}, 716s ) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2321: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'var3' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ____________ TestZarrDictStore.test_roundtrip_consolidated[3-True] _____________ 716s 716s self = 716s consolidated = True 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s def test_roundtrip_consolidated(self, consolidated) -> None: 716s expected = create_test_data() 716s > with self.roundtrip( 716s expected, 716s save_kwargs={"consolidated": consolidated}, 716s open_kwargs={"backend_kwargs": {"consolidated": consolidated}}, 716s ) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2321: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ____________ TestZarrDictStore.test_roundtrip_consolidated[3-None] _____________ 716s 716s self = 716s consolidated = None 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s def test_roundtrip_consolidated(self, consolidated) -> None: 716s expected = create_test_data() 716s > with self.roundtrip( 716s expected, 716s save_kwargs={"consolidated": consolidated}, 716s open_kwargs={"backend_kwargs": {"consolidated": consolidated}}, 716s ) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2321: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ___________ TestZarrDictStore.test_read_non_consolidated_warning[3] ____________ 716s 716s self = 716s 716s def test_read_non_consolidated_warning(self) -> None: 716s expected = create_test_data() 716s with self.create_zarr_target() as store: 716s self.save( 716s expected, store_target=store, consolidated=False, **self.version_kwargs 716s ) 716s with pytest.warns( 716s RuntimeWarning, 716s match="Failed to open Zarr store with consolidated", 716s ): 716s > with xr.open_zarr(store, **self.version_kwargs) as ds: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2339: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 716s ds = open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'var3' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _________________ TestZarrDictStore.test_non_existent_store[3] _________________ 716s 716s self = 716s 716s def test_non_existent_store(self) -> None: 716s with pytest.raises( 716s FileNotFoundError, match="(No such file or directory|Unable to find group)" 716s ): 716s > xr.open_zarr(f"{uuid.uuid4()}") 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2346: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 716s ds = open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1608: in open_dataset 716s store = ZarrStore.open_group( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:732: in open_group 716s ) = _get_open_params( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1811: in _get_open_params 716s zarr_root_group = zarr.open_consolidated(store, **open_kwargs) 716s /usr/lib/python3/dist-packages/zarr/api/synchronous.py:231: in open_consolidated 716s sync(async_api.open_consolidated(*args, use_consolidated=use_consolidated, **kwargs)) 716s /usr/lib/python3/dist-packages/zarr/core/sync.py:163: in sync 716s raise return_result 716s /usr/lib/python3/dist-packages/zarr/core/sync.py:119: in _runner 716s return await coro 716s /usr/lib/python3/dist-packages/zarr/api/asynchronous.py:408: in open_consolidated 716s return await open_group(*args, use_consolidated=use_consolidated, **kwargs) 716s /usr/lib/python3/dist-packages/zarr/api/asynchronous.py:851: in open_group 716s store_path = await make_store_path(store, mode=mode, storage_options=storage_options, path=path) 716s /usr/lib/python3/dist-packages/zarr/storage/_common.py:418: in make_store_path 716s store = await make_store(store_like, mode=mode, storage_options=storage_options) 716s /usr/lib/python3/dist-packages/zarr/storage/_common.py:349: in make_store 716s return await make_store(Path(store_like), mode=mode, storage_options=storage_options) 716s /usr/lib/python3/dist-packages/zarr/storage/_common.py:339: in make_store 716s return await LocalStore.open(root=store_like, mode=mode, read_only=_read_only) 716s /usr/lib/python3/dist-packages/zarr/storage/_local.py:160: in open 716s await store._open() 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = LocalStore('file:///tmp/autopkgtest.cdpOi4/autopkgtest_tmp/build/059bfc9a-d46e-4d97-8b0a-2c110c1d5b03') 716s 716s async def _open(self, *, mode: AccessModeLiteral | None = None) -> None: 716s if not self.read_only: 716s self.root.mkdir(parents=True, exist_ok=True) 716s 716s if not self.root.exists(): 716s > raise FileNotFoundError(f"{self.root} does not exist") 716s E FileNotFoundError: /tmp/autopkgtest.cdpOi4/autopkgtest_tmp/build/059bfc9a-d46e-4d97-8b0a-2c110c1d5b03 does not exist 716s 716s /usr/lib/python3/dist-packages/zarr/storage/_local.py:172: FileNotFoundError 716s 716s During handling of the above exception, another exception occurred: 716s 716s self = 716s 716s def test_non_existent_store(self) -> None: 716s > with pytest.raises( 716s FileNotFoundError, match="(No such file or directory|Unable to find group)" 716s ): 716s E AssertionError: Regex pattern did not match. 716s E Regex: '(No such file or directory|Unable to find group)' 716s E Input: '/tmp/autopkgtest.cdpOi4/autopkgtest_tmp/build/059bfc9a-d46e-4d97-8b0a-2c110c1d5b03 does not exist' 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2343: AssertionError 716s _____________________ TestZarrDictStore.test_auto_chunk[3] _____________________ 716s 716s self = 716s 716s @requires_dask 716s def test_auto_chunk(self) -> None: 716s original = create_test_data().chunk() 716s 716s > with self.roundtrip(original, open_kwargs={"chunks": None}) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2367: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ____________________ TestZarrDictStore.test_manual_chunk[3] ____________________ 716s 716s self = 716s 716s @requires_dask 716s @pytest.mark.filterwarnings("ignore:The specified chunks separate:UserWarning") 716s def test_manual_chunk(self) -> None: 716s original = create_test_data().chunk({"dim1": 3, "dim2": 4, "dim3": 3}) 716s 716s # Using chunks = None should return non-chunked arrays 716s open_kwargs: dict[str, Any] = {"chunks": None} 716s > with self.roundtrip(original, open_kwargs=open_kwargs) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2388: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _______________ TestZarrDictStore.test_warning_on_bad_chunks[3] ________________ 716s 716s self = 716s 716s @requires_dask 716s def test_warning_on_bad_chunks(self) -> None: 716s original = create_test_data().chunk({"dim1": 4, "dim2": 3, "dim3": 3}) 716s 716s bad_chunks = (2, {"dim2": (3, 3, 2, 1)}) 716s for chunks in bad_chunks: 716s kwargs = {"chunks": chunks} 716s with pytest.warns(UserWarning): 716s > with self.roundtrip(original, open_kwargs=kwargs) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2433: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ______________ TestZarrDictStore.test_write_uneven_dask_chunks[3] ______________ 716s 716s self = 716s 716s @requires_dask 716s def test_write_uneven_dask_chunks(self) -> None: 716s # regression for GH#2225 716s original = create_test_data().chunk({"dim1": 3, "dim2": 4, "dim3": 3}) 716s > with self.roundtrip(original, open_kwargs={"chunks": {}}) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2476: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ___________________ TestZarrDictStore.test_chunk_encoding[3] ___________________ 716s 716s self = 716s 716s def test_chunk_encoding(self) -> None: 716s # These datasets have no dask chunks. All chunking specified in 716s # encoding 716s data = create_test_data() 716s chunks = (5, 5) 716s data["var2"].encoding.update({"chunks": chunks}) 716s 716s > with self.roundtrip(data) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2487: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ___________________ TestZarrDictStore.test_shard_encoding[3] ___________________ 716s 716s self = 716s 716s def test_shard_encoding(self) -> None: 716s # These datasets have no dask chunks. All chunking/sharding specified in 716s # encoding 716s if has_zarr_v3 and zarr.config.config["default_zarr_format"] == 3: 716s data = create_test_data() 716s chunks = (1, 1) 716s shards = (5, 5) 716s data["var2"].encoding.update({"chunks": chunks}) 716s data["var2"].encoding.update({"shards": shards}) 716s > with self.roundtrip(data) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2505: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ____________ TestZarrDictStore.test_write_persistence_modes[3-None] ____________ 716s 716s self = 716s group = None 716s 716s @pytest.mark.parametrize("group", [None, "group1"]) 716s def test_write_persistence_modes(self, group) -> None: 716s original = create_test_data() 716s 716s # overwrite mode 716s > with self.roundtrip( 716s original, 716s save_kwargs={"mode": "w", "group": group}, 716s open_kwargs={"group": group}, 716s ) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2650: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ___________ TestZarrDictStore.test_write_persistence_modes[3-group1] ___________ 716s 716s self = 716s group = 'group1' 716s 716s @pytest.mark.parametrize("group", [None, "group1"]) 716s def test_write_persistence_modes(self, group) -> None: 716s original = create_test_data() 716s 716s # overwrite mode 716s > with self.roundtrip( 716s original, 716s save_kwargs={"mode": "w", "group": group}, 716s open_kwargs={"group": group}, 716s ) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2650: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ________________ TestZarrDictStore.test_compressor_encoding[3] _________________ 716s 716s self = 716s 716s def test_compressor_encoding(self) -> None: 716s # specify a custom compressor 716s original = create_test_data() 716s if has_zarr_v3 and zarr.config.config["default_zarr_format"] == 3: 716s encoding_key = "compressors" 716s # all parameters need to be explicitly specified in order for the comparison to pass below 716s encoding = { 716s "serializer": zarr.codecs.BytesCodec(endian="little"), 716s encoding_key: ( 716s zarr.codecs.BloscCodec( 716s cname="zstd", 716s clevel=3, 716s shuffle="shuffle", 716s typesize=8, 716s blocksize=0, 716s ), 716s ), 716s } 716s else: 716s from numcodecs.blosc import Blosc 716s 716s encoding_key = "compressors" if has_zarr_v3 else "compressor" 716s comp = Blosc(cname="zstd", clevel=3, shuffle=2) 716s encoding = {encoding_key: (comp,) if has_zarr_v3 else comp} 716s 716s save_kwargs = dict(encoding={"var1": encoding}) 716s 716s > with self.roundtrip(original, save_kwargs=save_kwargs) as ds: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2723: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _______________________ TestZarrDictStore.test_group[3] ________________________ 716s 716s self = 716s 716s def test_group(self) -> None: 716s original = create_test_data() 716s group = "some/random/path" 716s > with self.roundtrip( 716s original, save_kwargs={"group": group}, open_kwargs={"group": group} 716s ) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2730: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ____________________ TestZarrDictStore.test_append_write[3] ____________________ 716s 716s self = 716s 716s def test_append_write(self) -> None: 716s > super().test_append_write() 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2762: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1377: in test_append_write 716s with self.roundtrip_append(data) as actual: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:388: in roundtrip_append 716s self.save(data[[key]], path, mode=mode, **save_kwargs) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2296: in save 716s return dataset.to_zarr(store=store_target, **kwargs, **self.version_kwargs) 716s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 716s return to_zarr( # type: ignore[call-overload,misc] 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 716s dump_to_store(dataset, zstore, writer, encoding=encoding) 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 716s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 716s k: self.open_store_variable(name=k) for k in existing_variable_names 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _______ TestZarrDictStore.test_append_with_append_dim_not_set_raises[3] ________ 716s 716s self = 716s 716s def test_append_with_append_dim_not_set_raises(self) -> None: 716s ds, ds_to_append, _ = create_append_test_data() 716s with self.create_zarr_target() as store_target: 716s ds.to_zarr(store_target, mode="w", **self.version_kwargs) 716s with pytest.raises(ValueError, match="different dimension sizes"): 716s > ds_to_append.to_zarr(store_target, mode="a", **self.version_kwargs) 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2809: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 716s return to_zarr( # type: ignore[call-overload,misc] 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 716s dump_to_store(dataset, zstore, writer, encoding=encoding) 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 716s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 716s k: self.open_store_variable(name=k) for k in existing_variable_names 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'da' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _______ TestZarrDictStore.test_append_string_length_mismatch_works[3-U] ________ 716s 716s self = 716s dtype = 'U' 716s 716s @pytest.mark.parametrize("dtype", ["U", "S"]) 716s def test_append_string_length_mismatch_works(self, dtype) -> None: 716s skip_if_zarr_format_2("This doesn't work with Zarr format 2") 716s # ...but it probably would if we used object dtype 716s ds, ds_to_append = create_append_string_length_mismatch_test_data(dtype) 716s expected = xr.concat([ds, ds_to_append], dim="time") 716s with self.create_zarr_target() as store_target: 716s ds.to_zarr(store_target, mode="w", **self.version_kwargs) 716s > ds_to_append.to_zarr(store_target, append_dim="time", **self.version_kwargs) 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2851: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 716s return to_zarr( # type: ignore[call-overload,misc] 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 716s dump_to_store(dataset, zstore, writer, encoding=encoding) 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 716s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1018: in store 716s _validate_datatypes_for_zarr_append( 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s vname = 'temperature' 716s existing_var = Size: 24B 716s [3 values with dtype= Size: 60B 716s array(['abc', 'def', 'ghijk'], dtype=' raise ValueError( 716s f"Mismatched dtypes for variable {vname} between Zarr store on disk " 716s f"and dataset to append. Store has dtype {existing_var.dtype} but " 716s f"dataset to append has dtype {new_var.dtype}." 716s ) 716s E ValueError: Mismatched dtypes for variable temperature between Zarr store on disk and dataset to append. Store has dtype 716s dtype = 'S' 716s 716s @pytest.mark.parametrize("dtype", ["U", "S"]) 716s def test_append_string_length_mismatch_works(self, dtype) -> None: 716s skip_if_zarr_format_2("This doesn't work with Zarr format 2") 716s # ...but it probably would if we used object dtype 716s ds, ds_to_append = create_append_string_length_mismatch_test_data(dtype) 716s expected = xr.concat([ds, ds_to_append], dim="time") 716s with self.create_zarr_target() as store_target: 716s ds.to_zarr(store_target, mode="w", **self.version_kwargs) 716s > ds_to_append.to_zarr(store_target, append_dim="time", **self.version_kwargs) 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2851: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 716s return to_zarr( # type: ignore[call-overload,misc] 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 716s dump_to_store(dataset, zstore, writer, encoding=encoding) 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 716s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1018: in store 716s _validate_datatypes_for_zarr_append( 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s vname = 'temperature' 716s existing_var = Size: 6B 716s [3 values with dtype=|S2] 716s new_var = Size: 9B 716s array([b'aaa', b'bbb', b'ccc'], dtype='|S3') 716s 716s def _validate_datatypes_for_zarr_append(vname, existing_var, new_var): 716s """If variable exists in the store, confirm dtype of the data to append is compatible with 716s existing dtype. 716s """ 716s if ( 716s np.issubdtype(new_var.dtype, np.number) 716s or np.issubdtype(new_var.dtype, np.datetime64) 716s or np.issubdtype(new_var.dtype, np.bool_) 716s or new_var.dtype == object 716s or (new_var.dtype.kind in ("S", "U") and existing_var.dtype == object) 716s ): 716s # We can skip dtype equality checks under two conditions: (1) if the var to append is 716s # new to the dataset, because in this case there is no existing var to compare it to; 716s # or (2) if var to append's dtype is known to be easy-to-append, because in this case 716s # we can be confident appending won't cause problems. Examples of dtypes which are not 716s # easy-to-append include length-specified strings of type `|S*` or ` raise ValueError( 716s f"Mismatched dtypes for variable {vname} between Zarr store on disk " 716s f"and dataset to append. Store has dtype {existing_var.dtype} but " 716s f"dataset to append has dtype {new_var.dtype}." 716s ) 716s E ValueError: Mismatched dtypes for variable temperature between Zarr store on disk and dataset to append. Store has dtype |S2 but dataset to append has dtype |S3. 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:566: ValueError 716s _____ TestZarrDictStore.test_check_encoding_is_consistent_after_append[3] ______ 716s 716s self = 716s 716s def test_check_encoding_is_consistent_after_append(self) -> None: 716s ds, ds_to_append, _ = create_append_test_data() 716s 716s # check encoding consistency 716s with self.create_zarr_target() as store_target: 716s import numcodecs 716s 716s encoding_value: Any 716s if has_zarr_v3 and zarr.config.config["default_zarr_format"] == 3: 716s compressor = zarr.codecs.BloscCodec() 716s else: 716s compressor = numcodecs.Blosc() 716s encoding_key = "compressors" if has_zarr_v3 else "compressor" 716s encoding_value = (compressor,) if has_zarr_v3 else compressor 716s 716s encoding = {"da": {encoding_key: encoding_value}} 716s ds.to_zarr(store_target, mode="w", encoding=encoding, **self.version_kwargs) 716s > original_ds = xr.open_dataset( 716s store_target, engine="zarr", **self.version_kwargs 716s ) 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2872: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'da' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ______________ TestZarrDictStore.test_append_with_new_variable[3] ______________ 716s 716s self = 716s 716s def test_append_with_new_variable(self) -> None: 716s ds, ds_to_append, ds_with_new_var = create_append_test_data() 716s 716s # check append mode for new variable 716s with self.create_zarr_target() as store_target: 716s combined = xr.concat([ds, ds_to_append], dim="time") 716s combined.to_zarr(store_target, mode="w", **self.version_kwargs) 716s assert_identical( 716s combined, 716s > xr.open_dataset(store_target, engine="zarr", **self.version_kwargs), 716s ) 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2899: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'da' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ________ TestZarrDictStore.test_append_with_append_dim_no_overwrite[3] _________ 716s 716s self = 716s 716s def test_append_with_append_dim_no_overwrite(self) -> None: 716s ds, ds_to_append, _ = create_append_test_data() 716s with self.create_zarr_target() as store_target: 716s ds.to_zarr(store_target, mode="w", **self.version_kwargs) 716s original = xr.concat([ds, ds_to_append], dim="time") 716s original2 = xr.concat([original, ds_to_append], dim="time") 716s 716s # overwrite a coordinate; 716s # for mode='a-', this will not get written to the store 716s # because it does not have the append_dim as a dim 716s lon = ds_to_append.lon.to_numpy().copy() 716s lon[:] = -999 716s ds_to_append["lon"] = lon 716s > ds_to_append.to_zarr( 716s store_target, mode="a-", append_dim="time", **self.version_kwargs 716s ) 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2922: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 716s return to_zarr( # type: ignore[call-overload,misc] 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 716s dump_to_store(dataset, zstore, writer, encoding=encoding) 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 716s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 716s k: self.open_store_variable(name=k) for k in existing_variable_names 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'da' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s __________ TestZarrDictStore.test_to_zarr_compute_false_roundtrip[3] ___________ 716s 716s self = 716s 716s @requires_dask 716s def test_to_zarr_compute_false_roundtrip(self) -> None: 716s from dask.delayed import Delayed 716s 716s original = create_test_data().chunk() 716s 716s with self.create_zarr_target() as store: 716s delayed_obj = self.save(original, store, compute=False) 716s assert isinstance(delayed_obj, Delayed) 716s 716s # make sure target store has not been written to yet 716s with pytest.raises(AssertionError): 716s > with self.open(store) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2948: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _______ TestZarrDictStore.test_to_zarr_append_compute_false_roundtrip[3] _______ 716s 716s self = 716s 716s @requires_dask 716s def test_to_zarr_append_compute_false_roundtrip(self) -> None: 716s from dask.delayed import Delayed 716s 716s ds, ds_to_append, _ = create_append_test_data() 716s ds, ds_to_append = ds.chunk(), ds_to_append.chunk() 716s 716s with pytest.warns(SerializationWarning): 716s with self.create_zarr_target() as store: 716s delayed_obj = self.save(ds, store, compute=False, mode="w") 716s assert isinstance(delayed_obj, Delayed) 716s 716s with pytest.raises(AssertionError): 716s > with self.open(store) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2969: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'da' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ________________ TestZarrDictStore.test_save_emptydim[3-False] _________________ 716s 716s self = 716s chunk = False 716s 716s @pytest.mark.parametrize("chunk", [False, True]) 716s def test_save_emptydim(self, chunk) -> None: 716s if chunk and not has_dask: 716s pytest.skip("requires dask") 716s ds = Dataset({"x": (("a", "b"), np.empty((5, 0))), "y": ("a", [1, 2, 5, 8, 9])}) 716s if chunk: 716s ds = ds.chunk({}) # chunk dataset to save dask array 716s > with self.roundtrip(ds) as ds_reload: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3000: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'x' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _________________ TestZarrDictStore.test_save_emptydim[3-True] _________________ 716s 716s self = 716s chunk = True 716s 716s @pytest.mark.parametrize("chunk", [False, True]) 716s def test_save_emptydim(self, chunk) -> None: 716s if chunk and not has_dask: 716s pytest.skip("requires dask") 716s ds = Dataset({"x": (("a", "b"), np.empty((5, 0))), "y": ("a", [1, 2, 5, 8, 9])}) 716s if chunk: 716s ds = ds.chunk({}) # chunk dataset to save dask array 716s > with self.roundtrip(ds) as ds_reload: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3000: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'x' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _____ TestZarrDictStore.test_no_warning_from_open_emptydim_with_chunks[3] ______ 716s 716s self = 716s 716s @requires_dask 716s def test_no_warning_from_open_emptydim_with_chunks(self) -> None: 716s ds = Dataset({"x": (("a", "b"), np.empty((5, 0)))}).chunk({"a": 1}) 716s with assert_no_warnings(): 716s with warnings.catch_warnings(): 716s warnings.filterwarnings( 716s "ignore", 716s message=".*Zarr format 3 specification.*", 716s category=UserWarning, 716s ) 716s > with self.roundtrip(ds, open_kwargs=dict(chunks={"a": 1})) as ds_reload: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3013: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'x' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ________ TestZarrDictStore.test_write_region[3-False-False-False-False] ________ 716s 716s self = 716s consolidated = False, compute = False, use_dask = False, write_empty = False 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s @pytest.mark.parametrize("compute", [False, True]) 716s @pytest.mark.parametrize("use_dask", [False, True]) 716s @pytest.mark.parametrize("write_empty", [False, True, None]) 716s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 716s if (use_dask or not compute) and not has_dask: 716s pytest.skip("requires dask") 716s 716s zeros = Dataset({"u": (("x",), np.zeros(10))}) 716s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 716s 716s if use_dask: 716s zeros = zeros.chunk(2) 716s nonzeros = nonzeros.chunk(2) 716s 716s with self.create_zarr_target() as store: 716s zeros.to_zarr( 716s store, 716s consolidated=consolidated, 716s compute=compute, 716s encoding={"u": dict(chunks=2)}, 716s **self.version_kwargs, 716s ) 716s if compute: 716s with xr.open_zarr( 716s store, consolidated=consolidated, **self.version_kwargs 716s ) as actual: 716s assert_identical(actual, zeros) 716s for i in range(0, 10, 2): 716s region = {"x": slice(i, i + 2)} 716s > nonzeros.isel(region).to_zarr( 716s store, 716s region=region, 716s consolidated=consolidated, 716s write_empty_chunks=write_empty, 716s **self.version_kwargs, 716s ) 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 716s return to_zarr( # type: ignore[call-overload,misc] 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 716s dump_to_store(dataset, zstore, writer, encoding=encoding) 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 716s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 716s k: self.open_store_variable(name=k) for k in existing_variable_names 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ________ TestZarrDictStore.test_write_region[3-False-False-False-True] _________ 716s 716s self = 716s consolidated = True, compute = False, use_dask = False, write_empty = False 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s @pytest.mark.parametrize("compute", [False, True]) 716s @pytest.mark.parametrize("use_dask", [False, True]) 716s @pytest.mark.parametrize("write_empty", [False, True, None]) 716s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 716s if (use_dask or not compute) and not has_dask: 716s pytest.skip("requires dask") 716s 716s zeros = Dataset({"u": (("x",), np.zeros(10))}) 716s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 716s 716s if use_dask: 716s zeros = zeros.chunk(2) 716s nonzeros = nonzeros.chunk(2) 716s 716s with self.create_zarr_target() as store: 716s zeros.to_zarr( 716s store, 716s consolidated=consolidated, 716s compute=compute, 716s encoding={"u": dict(chunks=2)}, 716s **self.version_kwargs, 716s ) 716s if compute: 716s with xr.open_zarr( 716s store, consolidated=consolidated, **self.version_kwargs 716s ) as actual: 716s assert_identical(actual, zeros) 716s for i in range(0, 10, 2): 716s region = {"x": slice(i, i + 2)} 716s > nonzeros.isel(region).to_zarr( 716s store, 716s region=region, 716s consolidated=consolidated, 716s write_empty_chunks=write_empty, 716s **self.version_kwargs, 716s ) 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 716s return to_zarr( # type: ignore[call-overload,misc] 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 716s dump_to_store(dataset, zstore, writer, encoding=encoding) 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 716s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 716s k: self.open_store_variable(name=k) for k in existing_variable_names 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ________ TestZarrDictStore.test_write_region[3-False-False-False-None] _________ 716s 716s self = 716s consolidated = None, compute = False, use_dask = False, write_empty = False 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s @pytest.mark.parametrize("compute", [False, True]) 716s @pytest.mark.parametrize("use_dask", [False, True]) 716s @pytest.mark.parametrize("write_empty", [False, True, None]) 716s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 716s if (use_dask or not compute) and not has_dask: 716s pytest.skip("requires dask") 716s 716s zeros = Dataset({"u": (("x",), np.zeros(10))}) 716s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 716s 716s if use_dask: 716s zeros = zeros.chunk(2) 716s nonzeros = nonzeros.chunk(2) 716s 716s with self.create_zarr_target() as store: 716s zeros.to_zarr( 716s store, 716s consolidated=consolidated, 716s compute=compute, 716s encoding={"u": dict(chunks=2)}, 716s **self.version_kwargs, 716s ) 716s if compute: 716s with xr.open_zarr( 716s store, consolidated=consolidated, **self.version_kwargs 716s ) as actual: 716s assert_identical(actual, zeros) 716s for i in range(0, 10, 2): 716s region = {"x": slice(i, i + 2)} 716s > nonzeros.isel(region).to_zarr( 716s store, 716s region=region, 716s consolidated=consolidated, 716s write_empty_chunks=write_empty, 716s **self.version_kwargs, 716s ) 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 716s return to_zarr( # type: ignore[call-overload,misc] 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 716s dump_to_store(dataset, zstore, writer, encoding=encoding) 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 716s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 716s k: self.open_store_variable(name=k) for k in existing_variable_names 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ________ TestZarrDictStore.test_write_region[3-False-False-True-False] _________ 716s 716s self = 716s consolidated = False, compute = True, use_dask = False, write_empty = False 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s @pytest.mark.parametrize("compute", [False, True]) 716s @pytest.mark.parametrize("use_dask", [False, True]) 716s @pytest.mark.parametrize("write_empty", [False, True, None]) 716s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 716s if (use_dask or not compute) and not has_dask: 716s pytest.skip("requires dask") 716s 716s zeros = Dataset({"u": (("x",), np.zeros(10))}) 716s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 716s 716s if use_dask: 716s zeros = zeros.chunk(2) 716s nonzeros = nonzeros.chunk(2) 716s 716s with self.create_zarr_target() as store: 716s zeros.to_zarr( 716s store, 716s consolidated=consolidated, 716s compute=compute, 716s encoding={"u": dict(chunks=2)}, 716s **self.version_kwargs, 716s ) 716s if compute: 716s > with xr.open_zarr( 716s store, consolidated=consolidated, **self.version_kwargs 716s ) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 716s ds = open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _________ TestZarrDictStore.test_write_region[3-False-False-True-True] _________ 716s 716s self = 716s consolidated = True, compute = True, use_dask = False, write_empty = False 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s @pytest.mark.parametrize("compute", [False, True]) 716s @pytest.mark.parametrize("use_dask", [False, True]) 716s @pytest.mark.parametrize("write_empty", [False, True, None]) 716s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 716s if (use_dask or not compute) and not has_dask: 716s pytest.skip("requires dask") 716s 716s zeros = Dataset({"u": (("x",), np.zeros(10))}) 716s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 716s 716s if use_dask: 716s zeros = zeros.chunk(2) 716s nonzeros = nonzeros.chunk(2) 716s 716s with self.create_zarr_target() as store: 716s zeros.to_zarr( 716s store, 716s consolidated=consolidated, 716s compute=compute, 716s encoding={"u": dict(chunks=2)}, 716s **self.version_kwargs, 716s ) 716s if compute: 716s > with xr.open_zarr( 716s store, consolidated=consolidated, **self.version_kwargs 716s ) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 716s ds = open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _________ TestZarrDictStore.test_write_region[3-False-False-True-None] _________ 716s 716s self = 716s consolidated = None, compute = True, use_dask = False, write_empty = False 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s @pytest.mark.parametrize("compute", [False, True]) 716s @pytest.mark.parametrize("use_dask", [False, True]) 716s @pytest.mark.parametrize("write_empty", [False, True, None]) 716s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 716s if (use_dask or not compute) and not has_dask: 716s pytest.skip("requires dask") 716s 716s zeros = Dataset({"u": (("x",), np.zeros(10))}) 716s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 716s 716s if use_dask: 716s zeros = zeros.chunk(2) 716s nonzeros = nonzeros.chunk(2) 716s 716s with self.create_zarr_target() as store: 716s zeros.to_zarr( 716s store, 716s consolidated=consolidated, 716s compute=compute, 716s encoding={"u": dict(chunks=2)}, 716s **self.version_kwargs, 716s ) 716s if compute: 716s > with xr.open_zarr( 716s store, consolidated=consolidated, **self.version_kwargs 716s ) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 716s ds = open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ________ TestZarrDictStore.test_write_region[3-False-True-False-False] _________ 716s 716s self = 716s consolidated = False, compute = False, use_dask = True, write_empty = False 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s @pytest.mark.parametrize("compute", [False, True]) 716s @pytest.mark.parametrize("use_dask", [False, True]) 716s @pytest.mark.parametrize("write_empty", [False, True, None]) 716s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 716s if (use_dask or not compute) and not has_dask: 716s pytest.skip("requires dask") 716s 716s zeros = Dataset({"u": (("x",), np.zeros(10))}) 716s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 716s 716s if use_dask: 716s zeros = zeros.chunk(2) 716s nonzeros = nonzeros.chunk(2) 716s 716s with self.create_zarr_target() as store: 716s zeros.to_zarr( 716s store, 716s consolidated=consolidated, 716s compute=compute, 716s encoding={"u": dict(chunks=2)}, 716s **self.version_kwargs, 716s ) 716s if compute: 716s with xr.open_zarr( 716s store, consolidated=consolidated, **self.version_kwargs 716s ) as actual: 716s assert_identical(actual, zeros) 716s for i in range(0, 10, 2): 716s region = {"x": slice(i, i + 2)} 716s > nonzeros.isel(region).to_zarr( 716s store, 716s region=region, 716s consolidated=consolidated, 716s write_empty_chunks=write_empty, 716s **self.version_kwargs, 716s ) 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 716s return to_zarr( # type: ignore[call-overload,misc] 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 716s dump_to_store(dataset, zstore, writer, encoding=encoding) 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 716s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 716s k: self.open_store_variable(name=k) for k in existing_variable_names 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _________ TestZarrDictStore.test_write_region[3-False-True-False-True] _________ 716s 716s self = 716s consolidated = True, compute = False, use_dask = True, write_empty = False 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s @pytest.mark.parametrize("compute", [False, True]) 716s @pytest.mark.parametrize("use_dask", [False, True]) 716s @pytest.mark.parametrize("write_empty", [False, True, None]) 716s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 716s if (use_dask or not compute) and not has_dask: 716s pytest.skip("requires dask") 716s 716s zeros = Dataset({"u": (("x",), np.zeros(10))}) 716s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 716s 716s if use_dask: 716s zeros = zeros.chunk(2) 716s nonzeros = nonzeros.chunk(2) 716s 716s with self.create_zarr_target() as store: 716s zeros.to_zarr( 716s store, 716s consolidated=consolidated, 716s compute=compute, 716s encoding={"u": dict(chunks=2)}, 716s **self.version_kwargs, 716s ) 716s if compute: 716s with xr.open_zarr( 716s store, consolidated=consolidated, **self.version_kwargs 716s ) as actual: 716s assert_identical(actual, zeros) 716s for i in range(0, 10, 2): 716s region = {"x": slice(i, i + 2)} 716s > nonzeros.isel(region).to_zarr( 716s store, 716s region=region, 716s consolidated=consolidated, 716s write_empty_chunks=write_empty, 716s **self.version_kwargs, 716s ) 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 716s return to_zarr( # type: ignore[call-overload,misc] 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 716s dump_to_store(dataset, zstore, writer, encoding=encoding) 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 716s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 716s k: self.open_store_variable(name=k) for k in existing_variable_names 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _________ TestZarrDictStore.test_write_region[3-False-True-False-None] _________ 716s 716s self = 716s consolidated = None, compute = False, use_dask = True, write_empty = False 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s @pytest.mark.parametrize("compute", [False, True]) 716s @pytest.mark.parametrize("use_dask", [False, True]) 716s @pytest.mark.parametrize("write_empty", [False, True, None]) 716s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 716s if (use_dask or not compute) and not has_dask: 716s pytest.skip("requires dask") 716s 716s zeros = Dataset({"u": (("x",), np.zeros(10))}) 716s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 716s 716s if use_dask: 716s zeros = zeros.chunk(2) 716s nonzeros = nonzeros.chunk(2) 716s 716s with self.create_zarr_target() as store: 716s zeros.to_zarr( 716s store, 716s consolidated=consolidated, 716s compute=compute, 716s encoding={"u": dict(chunks=2)}, 716s **self.version_kwargs, 716s ) 716s if compute: 716s with xr.open_zarr( 716s store, consolidated=consolidated, **self.version_kwargs 716s ) as actual: 716s assert_identical(actual, zeros) 716s for i in range(0, 10, 2): 716s region = {"x": slice(i, i + 2)} 716s > nonzeros.isel(region).to_zarr( 716s store, 716s region=region, 716s consolidated=consolidated, 716s write_empty_chunks=write_empty, 716s **self.version_kwargs, 716s ) 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 716s return to_zarr( # type: ignore[call-overload,misc] 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 716s dump_to_store(dataset, zstore, writer, encoding=encoding) 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 716s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 716s k: self.open_store_variable(name=k) for k in existing_variable_names 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _________ TestZarrDictStore.test_write_region[3-False-True-True-False] _________ 716s 716s self = 716s consolidated = False, compute = True, use_dask = True, write_empty = False 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s @pytest.mark.parametrize("compute", [False, True]) 716s @pytest.mark.parametrize("use_dask", [False, True]) 716s @pytest.mark.parametrize("write_empty", [False, True, None]) 716s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 716s if (use_dask or not compute) and not has_dask: 716s pytest.skip("requires dask") 716s 716s zeros = Dataset({"u": (("x",), np.zeros(10))}) 716s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 716s 716s if use_dask: 716s zeros = zeros.chunk(2) 716s nonzeros = nonzeros.chunk(2) 716s 716s with self.create_zarr_target() as store: 716s zeros.to_zarr( 716s store, 716s consolidated=consolidated, 716s compute=compute, 716s encoding={"u": dict(chunks=2)}, 716s **self.version_kwargs, 716s ) 716s if compute: 716s > with xr.open_zarr( 716s store, consolidated=consolidated, **self.version_kwargs 716s ) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 716s ds = open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _________ TestZarrDictStore.test_write_region[3-False-True-True-True] __________ 716s 716s self = 716s consolidated = True, compute = True, use_dask = True, write_empty = False 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s @pytest.mark.parametrize("compute", [False, True]) 716s @pytest.mark.parametrize("use_dask", [False, True]) 716s @pytest.mark.parametrize("write_empty", [False, True, None]) 716s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 716s if (use_dask or not compute) and not has_dask: 716s pytest.skip("requires dask") 716s 716s zeros = Dataset({"u": (("x",), np.zeros(10))}) 716s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 716s 716s if use_dask: 716s zeros = zeros.chunk(2) 716s nonzeros = nonzeros.chunk(2) 716s 716s with self.create_zarr_target() as store: 716s zeros.to_zarr( 716s store, 716s consolidated=consolidated, 716s compute=compute, 716s encoding={"u": dict(chunks=2)}, 716s **self.version_kwargs, 716s ) 716s if compute: 716s > with xr.open_zarr( 716s store, consolidated=consolidated, **self.version_kwargs 716s ) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 716s ds = open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _________ TestZarrDictStore.test_write_region[3-False-True-True-None] __________ 716s 716s self = 716s consolidated = None, compute = True, use_dask = True, write_empty = False 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s @pytest.mark.parametrize("compute", [False, True]) 716s @pytest.mark.parametrize("use_dask", [False, True]) 716s @pytest.mark.parametrize("write_empty", [False, True, None]) 716s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 716s if (use_dask or not compute) and not has_dask: 716s pytest.skip("requires dask") 716s 716s zeros = Dataset({"u": (("x",), np.zeros(10))}) 716s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 716s 716s if use_dask: 716s zeros = zeros.chunk(2) 716s nonzeros = nonzeros.chunk(2) 716s 716s with self.create_zarr_target() as store: 716s zeros.to_zarr( 716s store, 716s consolidated=consolidated, 716s compute=compute, 716s encoding={"u": dict(chunks=2)}, 716s **self.version_kwargs, 716s ) 716s if compute: 716s > with xr.open_zarr( 716s store, consolidated=consolidated, **self.version_kwargs 716s ) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 716s ds = open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ________ TestZarrDictStore.test_write_region[3-True-False-False-False] _________ 716s 716s self = 716s consolidated = False, compute = False, use_dask = False, write_empty = True 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s @pytest.mark.parametrize("compute", [False, True]) 716s @pytest.mark.parametrize("use_dask", [False, True]) 716s @pytest.mark.parametrize("write_empty", [False, True, None]) 716s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 716s if (use_dask or not compute) and not has_dask: 716s pytest.skip("requires dask") 716s 716s zeros = Dataset({"u": (("x",), np.zeros(10))}) 716s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 716s 716s if use_dask: 716s zeros = zeros.chunk(2) 716s nonzeros = nonzeros.chunk(2) 716s 716s with self.create_zarr_target() as store: 716s zeros.to_zarr( 716s store, 716s consolidated=consolidated, 716s compute=compute, 716s encoding={"u": dict(chunks=2)}, 716s **self.version_kwargs, 716s ) 716s if compute: 716s with xr.open_zarr( 716s store, consolidated=consolidated, **self.version_kwargs 716s ) as actual: 716s assert_identical(actual, zeros) 716s for i in range(0, 10, 2): 716s region = {"x": slice(i, i + 2)} 716s > nonzeros.isel(region).to_zarr( 716s store, 716s region=region, 716s consolidated=consolidated, 716s write_empty_chunks=write_empty, 716s **self.version_kwargs, 716s ) 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 716s return to_zarr( # type: ignore[call-overload,misc] 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 716s dump_to_store(dataset, zstore, writer, encoding=encoding) 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 716s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 716s k: self.open_store_variable(name=k) for k in existing_variable_names 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _________ TestZarrDictStore.test_write_region[3-True-False-False-True] _________ 716s 716s self = 716s consolidated = True, compute = False, use_dask = False, write_empty = True 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s @pytest.mark.parametrize("compute", [False, True]) 716s @pytest.mark.parametrize("use_dask", [False, True]) 716s @pytest.mark.parametrize("write_empty", [False, True, None]) 716s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 716s if (use_dask or not compute) and not has_dask: 716s pytest.skip("requires dask") 716s 716s zeros = Dataset({"u": (("x",), np.zeros(10))}) 716s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 716s 716s if use_dask: 716s zeros = zeros.chunk(2) 716s nonzeros = nonzeros.chunk(2) 716s 716s with self.create_zarr_target() as store: 716s zeros.to_zarr( 716s store, 716s consolidated=consolidated, 716s compute=compute, 716s encoding={"u": dict(chunks=2)}, 716s **self.version_kwargs, 716s ) 716s if compute: 716s with xr.open_zarr( 716s store, consolidated=consolidated, **self.version_kwargs 716s ) as actual: 716s assert_identical(actual, zeros) 716s for i in range(0, 10, 2): 716s region = {"x": slice(i, i + 2)} 716s > nonzeros.isel(region).to_zarr( 716s store, 716s region=region, 716s consolidated=consolidated, 716s write_empty_chunks=write_empty, 716s **self.version_kwargs, 716s ) 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 716s return to_zarr( # type: ignore[call-overload,misc] 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 716s dump_to_store(dataset, zstore, writer, encoding=encoding) 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 716s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 716s k: self.open_store_variable(name=k) for k in existing_variable_names 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _________ TestZarrDictStore.test_write_region[3-True-False-False-None] _________ 716s 716s self = 716s consolidated = None, compute = False, use_dask = False, write_empty = True 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s @pytest.mark.parametrize("compute", [False, True]) 716s @pytest.mark.parametrize("use_dask", [False, True]) 716s @pytest.mark.parametrize("write_empty", [False, True, None]) 716s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 716s if (use_dask or not compute) and not has_dask: 716s pytest.skip("requires dask") 716s 716s zeros = Dataset({"u": (("x",), np.zeros(10))}) 716s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 716s 716s if use_dask: 716s zeros = zeros.chunk(2) 716s nonzeros = nonzeros.chunk(2) 716s 716s with self.create_zarr_target() as store: 716s zeros.to_zarr( 716s store, 716s consolidated=consolidated, 716s compute=compute, 716s encoding={"u": dict(chunks=2)}, 716s **self.version_kwargs, 716s ) 716s if compute: 716s with xr.open_zarr( 716s store, consolidated=consolidated, **self.version_kwargs 716s ) as actual: 716s assert_identical(actual, zeros) 716s for i in range(0, 10, 2): 716s region = {"x": slice(i, i + 2)} 716s > nonzeros.isel(region).to_zarr( 716s store, 716s region=region, 716s consolidated=consolidated, 716s write_empty_chunks=write_empty, 716s **self.version_kwargs, 716s ) 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 716s return to_zarr( # type: ignore[call-overload,misc] 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 716s dump_to_store(dataset, zstore, writer, encoding=encoding) 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 716s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 716s k: self.open_store_variable(name=k) for k in existing_variable_names 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _________ TestZarrDictStore.test_write_region[3-True-False-True-False] _________ 716s 716s self = 716s consolidated = False, compute = True, use_dask = False, write_empty = True 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s @pytest.mark.parametrize("compute", [False, True]) 716s @pytest.mark.parametrize("use_dask", [False, True]) 716s @pytest.mark.parametrize("write_empty", [False, True, None]) 716s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 716s if (use_dask or not compute) and not has_dask: 716s pytest.skip("requires dask") 716s 716s zeros = Dataset({"u": (("x",), np.zeros(10))}) 716s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 716s 716s if use_dask: 716s zeros = zeros.chunk(2) 716s nonzeros = nonzeros.chunk(2) 716s 716s with self.create_zarr_target() as store: 716s zeros.to_zarr( 716s store, 716s consolidated=consolidated, 716s compute=compute, 716s encoding={"u": dict(chunks=2)}, 716s **self.version_kwargs, 716s ) 716s if compute: 716s > with xr.open_zarr( 716s store, consolidated=consolidated, **self.version_kwargs 716s ) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 716s ds = open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _________ TestZarrDictStore.test_write_region[3-True-False-True-True] __________ 716s 716s self = 716s consolidated = True, compute = True, use_dask = False, write_empty = True 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s @pytest.mark.parametrize("compute", [False, True]) 716s @pytest.mark.parametrize("use_dask", [False, True]) 716s @pytest.mark.parametrize("write_empty", [False, True, None]) 716s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 716s if (use_dask or not compute) and not has_dask: 716s pytest.skip("requires dask") 716s 716s zeros = Dataset({"u": (("x",), np.zeros(10))}) 716s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 716s 716s if use_dask: 716s zeros = zeros.chunk(2) 716s nonzeros = nonzeros.chunk(2) 716s 716s with self.create_zarr_target() as store: 716s zeros.to_zarr( 716s store, 716s consolidated=consolidated, 716s compute=compute, 716s encoding={"u": dict(chunks=2)}, 716s **self.version_kwargs, 716s ) 716s if compute: 716s > with xr.open_zarr( 716s store, consolidated=consolidated, **self.version_kwargs 716s ) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 716s ds = open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _________ TestZarrDictStore.test_write_region[3-True-False-True-None] __________ 716s 716s self = 716s consolidated = None, compute = True, use_dask = False, write_empty = True 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s @pytest.mark.parametrize("compute", [False, True]) 716s @pytest.mark.parametrize("use_dask", [False, True]) 716s @pytest.mark.parametrize("write_empty", [False, True, None]) 716s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 716s if (use_dask or not compute) and not has_dask: 716s pytest.skip("requires dask") 716s 716s zeros = Dataset({"u": (("x",), np.zeros(10))}) 716s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 716s 716s if use_dask: 716s zeros = zeros.chunk(2) 716s nonzeros = nonzeros.chunk(2) 716s 716s with self.create_zarr_target() as store: 716s zeros.to_zarr( 716s store, 716s consolidated=consolidated, 716s compute=compute, 716s encoding={"u": dict(chunks=2)}, 716s **self.version_kwargs, 716s ) 716s if compute: 716s > with xr.open_zarr( 716s store, consolidated=consolidated, **self.version_kwargs 716s ) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 716s ds = open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _________ TestZarrDictStore.test_write_region[3-True-True-False-False] _________ 716s 716s self = 716s consolidated = False, compute = False, use_dask = True, write_empty = True 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s @pytest.mark.parametrize("compute", [False, True]) 716s @pytest.mark.parametrize("use_dask", [False, True]) 716s @pytest.mark.parametrize("write_empty", [False, True, None]) 716s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 716s if (use_dask or not compute) and not has_dask: 716s pytest.skip("requires dask") 716s 716s zeros = Dataset({"u": (("x",), np.zeros(10))}) 716s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 716s 716s if use_dask: 716s zeros = zeros.chunk(2) 716s nonzeros = nonzeros.chunk(2) 716s 716s with self.create_zarr_target() as store: 716s zeros.to_zarr( 716s store, 716s consolidated=consolidated, 716s compute=compute, 716s encoding={"u": dict(chunks=2)}, 716s **self.version_kwargs, 716s ) 716s if compute: 716s with xr.open_zarr( 716s store, consolidated=consolidated, **self.version_kwargs 716s ) as actual: 716s assert_identical(actual, zeros) 716s for i in range(0, 10, 2): 716s region = {"x": slice(i, i + 2)} 716s > nonzeros.isel(region).to_zarr( 716s store, 716s region=region, 716s consolidated=consolidated, 716s write_empty_chunks=write_empty, 716s **self.version_kwargs, 716s ) 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 716s return to_zarr( # type: ignore[call-overload,misc] 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 716s dump_to_store(dataset, zstore, writer, encoding=encoding) 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 716s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 716s k: self.open_store_variable(name=k) for k in existing_variable_names 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _________ TestZarrDictStore.test_write_region[3-True-True-False-True] __________ 716s 716s self = 716s consolidated = True, compute = False, use_dask = True, write_empty = True 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s @pytest.mark.parametrize("compute", [False, True]) 716s @pytest.mark.parametrize("use_dask", [False, True]) 716s @pytest.mark.parametrize("write_empty", [False, True, None]) 716s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 716s if (use_dask or not compute) and not has_dask: 716s pytest.skip("requires dask") 716s 716s zeros = Dataset({"u": (("x",), np.zeros(10))}) 716s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 716s 716s if use_dask: 716s zeros = zeros.chunk(2) 716s nonzeros = nonzeros.chunk(2) 716s 716s with self.create_zarr_target() as store: 716s zeros.to_zarr( 716s store, 716s consolidated=consolidated, 716s compute=compute, 716s encoding={"u": dict(chunks=2)}, 716s **self.version_kwargs, 716s ) 716s if compute: 716s with xr.open_zarr( 716s store, consolidated=consolidated, **self.version_kwargs 716s ) as actual: 716s assert_identical(actual, zeros) 716s for i in range(0, 10, 2): 716s region = {"x": slice(i, i + 2)} 716s > nonzeros.isel(region).to_zarr( 716s store, 716s region=region, 716s consolidated=consolidated, 716s write_empty_chunks=write_empty, 716s **self.version_kwargs, 716s ) 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 716s return to_zarr( # type: ignore[call-overload,misc] 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 716s dump_to_store(dataset, zstore, writer, encoding=encoding) 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 716s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 716s k: self.open_store_variable(name=k) for k in existing_variable_names 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _________ TestZarrDictStore.test_write_region[3-True-True-False-None] __________ 716s 716s self = 716s consolidated = None, compute = False, use_dask = True, write_empty = True 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s @pytest.mark.parametrize("compute", [False, True]) 716s @pytest.mark.parametrize("use_dask", [False, True]) 716s @pytest.mark.parametrize("write_empty", [False, True, None]) 716s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 716s if (use_dask or not compute) and not has_dask: 716s pytest.skip("requires dask") 716s 716s zeros = Dataset({"u": (("x",), np.zeros(10))}) 716s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 716s 716s if use_dask: 716s zeros = zeros.chunk(2) 716s nonzeros = nonzeros.chunk(2) 716s 716s with self.create_zarr_target() as store: 716s zeros.to_zarr( 716s store, 716s consolidated=consolidated, 716s compute=compute, 716s encoding={"u": dict(chunks=2)}, 716s **self.version_kwargs, 716s ) 716s if compute: 716s with xr.open_zarr( 716s store, consolidated=consolidated, **self.version_kwargs 716s ) as actual: 716s assert_identical(actual, zeros) 716s for i in range(0, 10, 2): 716s region = {"x": slice(i, i + 2)} 716s > nonzeros.isel(region).to_zarr( 716s store, 716s region=region, 716s consolidated=consolidated, 716s write_empty_chunks=write_empty, 716s **self.version_kwargs, 716s ) 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 716s return to_zarr( # type: ignore[call-overload,misc] 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 716s dump_to_store(dataset, zstore, writer, encoding=encoding) 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 716s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 716s k: self.open_store_variable(name=k) for k in existing_variable_names 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _________ TestZarrDictStore.test_write_region[3-True-True-True-False] __________ 716s 716s self = 716s consolidated = False, compute = True, use_dask = True, write_empty = True 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s @pytest.mark.parametrize("compute", [False, True]) 716s @pytest.mark.parametrize("use_dask", [False, True]) 716s @pytest.mark.parametrize("write_empty", [False, True, None]) 716s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 716s if (use_dask or not compute) and not has_dask: 716s pytest.skip("requires dask") 716s 716s zeros = Dataset({"u": (("x",), np.zeros(10))}) 716s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 716s 716s if use_dask: 716s zeros = zeros.chunk(2) 716s nonzeros = nonzeros.chunk(2) 716s 716s with self.create_zarr_target() as store: 716s zeros.to_zarr( 716s store, 716s consolidated=consolidated, 716s compute=compute, 716s encoding={"u": dict(chunks=2)}, 716s **self.version_kwargs, 716s ) 716s if compute: 716s > with xr.open_zarr( 716s store, consolidated=consolidated, **self.version_kwargs 716s ) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 716s ds = open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s __________ TestZarrDictStore.test_write_region[3-True-True-True-True] __________ 716s 716s self = 716s consolidated = True, compute = True, use_dask = True, write_empty = True 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s @pytest.mark.parametrize("compute", [False, True]) 716s @pytest.mark.parametrize("use_dask", [False, True]) 716s @pytest.mark.parametrize("write_empty", [False, True, None]) 716s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 716s if (use_dask or not compute) and not has_dask: 716s pytest.skip("requires dask") 716s 716s zeros = Dataset({"u": (("x",), np.zeros(10))}) 716s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 716s 716s if use_dask: 716s zeros = zeros.chunk(2) 716s nonzeros = nonzeros.chunk(2) 716s 716s with self.create_zarr_target() as store: 716s zeros.to_zarr( 716s store, 716s consolidated=consolidated, 716s compute=compute, 716s encoding={"u": dict(chunks=2)}, 716s **self.version_kwargs, 716s ) 716s if compute: 716s > with xr.open_zarr( 716s store, consolidated=consolidated, **self.version_kwargs 716s ) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 716s ds = open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s __________ TestZarrDictStore.test_write_region[3-True-True-True-None] __________ 716s 716s self = 716s consolidated = None, compute = True, use_dask = True, write_empty = True 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s @pytest.mark.parametrize("compute", [False, True]) 716s @pytest.mark.parametrize("use_dask", [False, True]) 716s @pytest.mark.parametrize("write_empty", [False, True, None]) 716s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 716s if (use_dask or not compute) and not has_dask: 716s pytest.skip("requires dask") 716s 716s zeros = Dataset({"u": (("x",), np.zeros(10))}) 716s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 716s 716s if use_dask: 716s zeros = zeros.chunk(2) 716s nonzeros = nonzeros.chunk(2) 716s 716s with self.create_zarr_target() as store: 716s zeros.to_zarr( 716s store, 716s consolidated=consolidated, 716s compute=compute, 716s encoding={"u": dict(chunks=2)}, 716s **self.version_kwargs, 716s ) 716s if compute: 716s > with xr.open_zarr( 716s store, consolidated=consolidated, **self.version_kwargs 716s ) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 716s ds = open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ________ TestZarrDictStore.test_write_region[3-None-False-False-False] _________ 716s 716s self = 716s consolidated = False, compute = False, use_dask = False, write_empty = None 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s @pytest.mark.parametrize("compute", [False, True]) 716s @pytest.mark.parametrize("use_dask", [False, True]) 716s @pytest.mark.parametrize("write_empty", [False, True, None]) 716s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 716s if (use_dask or not compute) and not has_dask: 716s pytest.skip("requires dask") 716s 716s zeros = Dataset({"u": (("x",), np.zeros(10))}) 716s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 716s 716s if use_dask: 716s zeros = zeros.chunk(2) 716s nonzeros = nonzeros.chunk(2) 716s 716s with self.create_zarr_target() as store: 716s zeros.to_zarr( 716s store, 716s consolidated=consolidated, 716s compute=compute, 716s encoding={"u": dict(chunks=2)}, 716s **self.version_kwargs, 716s ) 716s if compute: 716s with xr.open_zarr( 716s store, consolidated=consolidated, **self.version_kwargs 716s ) as actual: 716s assert_identical(actual, zeros) 716s for i in range(0, 10, 2): 716s region = {"x": slice(i, i + 2)} 716s > nonzeros.isel(region).to_zarr( 716s store, 716s region=region, 716s consolidated=consolidated, 716s write_empty_chunks=write_empty, 716s **self.version_kwargs, 716s ) 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 716s return to_zarr( # type: ignore[call-overload,misc] 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 716s dump_to_store(dataset, zstore, writer, encoding=encoding) 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 716s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 716s k: self.open_store_variable(name=k) for k in existing_variable_names 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _________ TestZarrDictStore.test_write_region[3-None-False-False-True] _________ 716s 716s self = 716s consolidated = True, compute = False, use_dask = False, write_empty = None 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s @pytest.mark.parametrize("compute", [False, True]) 716s @pytest.mark.parametrize("use_dask", [False, True]) 716s @pytest.mark.parametrize("write_empty", [False, True, None]) 716s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 716s if (use_dask or not compute) and not has_dask: 716s pytest.skip("requires dask") 716s 716s zeros = Dataset({"u": (("x",), np.zeros(10))}) 716s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 716s 716s if use_dask: 716s zeros = zeros.chunk(2) 716s nonzeros = nonzeros.chunk(2) 716s 716s with self.create_zarr_target() as store: 716s zeros.to_zarr( 716s store, 716s consolidated=consolidated, 716s compute=compute, 716s encoding={"u": dict(chunks=2)}, 716s **self.version_kwargs, 716s ) 716s if compute: 716s with xr.open_zarr( 716s store, consolidated=consolidated, **self.version_kwargs 716s ) as actual: 716s assert_identical(actual, zeros) 716s for i in range(0, 10, 2): 716s region = {"x": slice(i, i + 2)} 716s > nonzeros.isel(region).to_zarr( 716s store, 716s region=region, 716s consolidated=consolidated, 716s write_empty_chunks=write_empty, 716s **self.version_kwargs, 716s ) 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 716s return to_zarr( # type: ignore[call-overload,misc] 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 716s dump_to_store(dataset, zstore, writer, encoding=encoding) 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 716s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 716s k: self.open_store_variable(name=k) for k in existing_variable_names 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _________ TestZarrDictStore.test_write_region[3-None-False-False-None] _________ 716s 716s self = 716s consolidated = None, compute = False, use_dask = False, write_empty = None 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s @pytest.mark.parametrize("compute", [False, True]) 716s @pytest.mark.parametrize("use_dask", [False, True]) 716s @pytest.mark.parametrize("write_empty", [False, True, None]) 716s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 716s if (use_dask or not compute) and not has_dask: 716s pytest.skip("requires dask") 716s 716s zeros = Dataset({"u": (("x",), np.zeros(10))}) 716s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 716s 716s if use_dask: 716s zeros = zeros.chunk(2) 716s nonzeros = nonzeros.chunk(2) 716s 716s with self.create_zarr_target() as store: 716s zeros.to_zarr( 716s store, 716s consolidated=consolidated, 716s compute=compute, 716s encoding={"u": dict(chunks=2)}, 716s **self.version_kwargs, 716s ) 716s if compute: 716s with xr.open_zarr( 716s store, consolidated=consolidated, **self.version_kwargs 716s ) as actual: 716s assert_identical(actual, zeros) 716s for i in range(0, 10, 2): 716s region = {"x": slice(i, i + 2)} 716s > nonzeros.isel(region).to_zarr( 716s store, 716s region=region, 716s consolidated=consolidated, 716s write_empty_chunks=write_empty, 716s **self.version_kwargs, 716s ) 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 716s return to_zarr( # type: ignore[call-overload,misc] 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 716s dump_to_store(dataset, zstore, writer, encoding=encoding) 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 716s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 716s k: self.open_store_variable(name=k) for k in existing_variable_names 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _________ TestZarrDictStore.test_write_region[3-None-False-True-False] _________ 716s 716s self = 716s consolidated = False, compute = True, use_dask = False, write_empty = None 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s @pytest.mark.parametrize("compute", [False, True]) 716s @pytest.mark.parametrize("use_dask", [False, True]) 716s @pytest.mark.parametrize("write_empty", [False, True, None]) 716s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 716s if (use_dask or not compute) and not has_dask: 716s pytest.skip("requires dask") 716s 716s zeros = Dataset({"u": (("x",), np.zeros(10))}) 716s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 716s 716s if use_dask: 716s zeros = zeros.chunk(2) 716s nonzeros = nonzeros.chunk(2) 716s 716s with self.create_zarr_target() as store: 716s zeros.to_zarr( 716s store, 716s consolidated=consolidated, 716s compute=compute, 716s encoding={"u": dict(chunks=2)}, 716s **self.version_kwargs, 716s ) 716s if compute: 716s > with xr.open_zarr( 716s store, consolidated=consolidated, **self.version_kwargs 716s ) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 716s ds = open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _________ TestZarrDictStore.test_write_region[3-None-False-True-True] __________ 716s 716s self = 716s consolidated = True, compute = True, use_dask = False, write_empty = None 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s @pytest.mark.parametrize("compute", [False, True]) 716s @pytest.mark.parametrize("use_dask", [False, True]) 716s @pytest.mark.parametrize("write_empty", [False, True, None]) 716s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 716s if (use_dask or not compute) and not has_dask: 716s pytest.skip("requires dask") 716s 716s zeros = Dataset({"u": (("x",), np.zeros(10))}) 716s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 716s 716s if use_dask: 716s zeros = zeros.chunk(2) 716s nonzeros = nonzeros.chunk(2) 716s 716s with self.create_zarr_target() as store: 716s zeros.to_zarr( 716s store, 716s consolidated=consolidated, 716s compute=compute, 716s encoding={"u": dict(chunks=2)}, 716s **self.version_kwargs, 716s ) 716s if compute: 716s > with xr.open_zarr( 716s store, consolidated=consolidated, **self.version_kwargs 716s ) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 716s ds = open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _________ TestZarrDictStore.test_write_region[3-None-False-True-None] __________ 716s 716s self = 716s consolidated = None, compute = True, use_dask = False, write_empty = None 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s @pytest.mark.parametrize("compute", [False, True]) 716s @pytest.mark.parametrize("use_dask", [False, True]) 716s @pytest.mark.parametrize("write_empty", [False, True, None]) 716s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 716s if (use_dask or not compute) and not has_dask: 716s pytest.skip("requires dask") 716s 716s zeros = Dataset({"u": (("x",), np.zeros(10))}) 716s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 716s 716s if use_dask: 716s zeros = zeros.chunk(2) 716s nonzeros = nonzeros.chunk(2) 716s 716s with self.create_zarr_target() as store: 716s zeros.to_zarr( 716s store, 716s consolidated=consolidated, 716s compute=compute, 716s encoding={"u": dict(chunks=2)}, 716s **self.version_kwargs, 716s ) 716s if compute: 716s > with xr.open_zarr( 716s store, consolidated=consolidated, **self.version_kwargs 716s ) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 716s ds = open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _________ TestZarrDictStore.test_write_region[3-None-True-False-False] _________ 716s 716s self = 716s consolidated = False, compute = False, use_dask = True, write_empty = None 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s @pytest.mark.parametrize("compute", [False, True]) 716s @pytest.mark.parametrize("use_dask", [False, True]) 716s @pytest.mark.parametrize("write_empty", [False, True, None]) 716s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 716s if (use_dask or not compute) and not has_dask: 716s pytest.skip("requires dask") 716s 716s zeros = Dataset({"u": (("x",), np.zeros(10))}) 716s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 716s 716s if use_dask: 716s zeros = zeros.chunk(2) 716s nonzeros = nonzeros.chunk(2) 716s 716s with self.create_zarr_target() as store: 716s zeros.to_zarr( 716s store, 716s consolidated=consolidated, 716s compute=compute, 716s encoding={"u": dict(chunks=2)}, 716s **self.version_kwargs, 716s ) 716s if compute: 716s with xr.open_zarr( 716s store, consolidated=consolidated, **self.version_kwargs 716s ) as actual: 716s assert_identical(actual, zeros) 716s for i in range(0, 10, 2): 716s region = {"x": slice(i, i + 2)} 716s > nonzeros.isel(region).to_zarr( 716s store, 716s region=region, 716s consolidated=consolidated, 716s write_empty_chunks=write_empty, 716s **self.version_kwargs, 716s ) 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 716s return to_zarr( # type: ignore[call-overload,misc] 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 716s dump_to_store(dataset, zstore, writer, encoding=encoding) 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 716s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 716s k: self.open_store_variable(name=k) for k in existing_variable_names 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _________ TestZarrDictStore.test_write_region[3-None-True-False-True] __________ 716s 716s self = 716s consolidated = True, compute = False, use_dask = True, write_empty = None 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s @pytest.mark.parametrize("compute", [False, True]) 716s @pytest.mark.parametrize("use_dask", [False, True]) 716s @pytest.mark.parametrize("write_empty", [False, True, None]) 716s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 716s if (use_dask or not compute) and not has_dask: 716s pytest.skip("requires dask") 716s 716s zeros = Dataset({"u": (("x",), np.zeros(10))}) 716s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 716s 716s if use_dask: 716s zeros = zeros.chunk(2) 716s nonzeros = nonzeros.chunk(2) 716s 716s with self.create_zarr_target() as store: 716s zeros.to_zarr( 716s store, 716s consolidated=consolidated, 716s compute=compute, 716s encoding={"u": dict(chunks=2)}, 716s **self.version_kwargs, 716s ) 716s if compute: 716s with xr.open_zarr( 716s store, consolidated=consolidated, **self.version_kwargs 716s ) as actual: 716s assert_identical(actual, zeros) 716s for i in range(0, 10, 2): 716s region = {"x": slice(i, i + 2)} 716s > nonzeros.isel(region).to_zarr( 716s store, 716s region=region, 716s consolidated=consolidated, 716s write_empty_chunks=write_empty, 716s **self.version_kwargs, 716s ) 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 716s return to_zarr( # type: ignore[call-overload,misc] 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 716s dump_to_store(dataset, zstore, writer, encoding=encoding) 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 716s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 716s k: self.open_store_variable(name=k) for k in existing_variable_names 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _________ TestZarrDictStore.test_write_region[3-None-True-False-None] __________ 716s 716s self = 716s consolidated = None, compute = False, use_dask = True, write_empty = None 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s @pytest.mark.parametrize("compute", [False, True]) 716s @pytest.mark.parametrize("use_dask", [False, True]) 716s @pytest.mark.parametrize("write_empty", [False, True, None]) 716s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 716s if (use_dask or not compute) and not has_dask: 716s pytest.skip("requires dask") 716s 716s zeros = Dataset({"u": (("x",), np.zeros(10))}) 716s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 716s 716s if use_dask: 716s zeros = zeros.chunk(2) 716s nonzeros = nonzeros.chunk(2) 716s 716s with self.create_zarr_target() as store: 716s zeros.to_zarr( 716s store, 716s consolidated=consolidated, 716s compute=compute, 716s encoding={"u": dict(chunks=2)}, 716s **self.version_kwargs, 716s ) 716s if compute: 716s with xr.open_zarr( 716s store, consolidated=consolidated, **self.version_kwargs 716s ) as actual: 716s assert_identical(actual, zeros) 716s for i in range(0, 10, 2): 716s region = {"x": slice(i, i + 2)} 716s > nonzeros.isel(region).to_zarr( 716s store, 716s region=region, 716s consolidated=consolidated, 716s write_empty_chunks=write_empty, 716s **self.version_kwargs, 716s ) 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 716s return to_zarr( # type: ignore[call-overload,misc] 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 716s dump_to_store(dataset, zstore, writer, encoding=encoding) 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 716s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 716s k: self.open_store_variable(name=k) for k in existing_variable_names 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _________ TestZarrDictStore.test_write_region[3-None-True-True-False] __________ 716s 716s self = 716s consolidated = False, compute = True, use_dask = True, write_empty = None 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s @pytest.mark.parametrize("compute", [False, True]) 716s @pytest.mark.parametrize("use_dask", [False, True]) 716s @pytest.mark.parametrize("write_empty", [False, True, None]) 716s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 716s if (use_dask or not compute) and not has_dask: 716s pytest.skip("requires dask") 716s 716s zeros = Dataset({"u": (("x",), np.zeros(10))}) 716s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 716s 716s if use_dask: 716s zeros = zeros.chunk(2) 716s nonzeros = nonzeros.chunk(2) 716s 716s with self.create_zarr_target() as store: 716s zeros.to_zarr( 716s store, 716s consolidated=consolidated, 716s compute=compute, 716s encoding={"u": dict(chunks=2)}, 716s **self.version_kwargs, 716s ) 716s if compute: 716s > with xr.open_zarr( 716s store, consolidated=consolidated, **self.version_kwargs 716s ) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 716s ds = open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s __________ TestZarrDictStore.test_write_region[3-None-True-True-True] __________ 716s 716s self = 716s consolidated = True, compute = True, use_dask = True, write_empty = None 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s @pytest.mark.parametrize("compute", [False, True]) 716s @pytest.mark.parametrize("use_dask", [False, True]) 716s @pytest.mark.parametrize("write_empty", [False, True, None]) 716s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 716s if (use_dask or not compute) and not has_dask: 716s pytest.skip("requires dask") 716s 716s zeros = Dataset({"u": (("x",), np.zeros(10))}) 716s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 716s 716s if use_dask: 716s zeros = zeros.chunk(2) 716s nonzeros = nonzeros.chunk(2) 716s 716s with self.create_zarr_target() as store: 716s zeros.to_zarr( 716s store, 716s consolidated=consolidated, 716s compute=compute, 716s encoding={"u": dict(chunks=2)}, 716s **self.version_kwargs, 716s ) 716s if compute: 716s > with xr.open_zarr( 716s store, consolidated=consolidated, **self.version_kwargs 716s ) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 716s ds = open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s __________ TestZarrDictStore.test_write_region[3-None-True-True-None] __________ 716s 716s self = 716s consolidated = None, compute = True, use_dask = True, write_empty = None 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s @pytest.mark.parametrize("compute", [False, True]) 716s @pytest.mark.parametrize("use_dask", [False, True]) 716s @pytest.mark.parametrize("write_empty", [False, True, None]) 716s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 716s if (use_dask or not compute) and not has_dask: 716s pytest.skip("requires dask") 716s 716s zeros = Dataset({"u": (("x",), np.zeros(10))}) 716s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 716s 716s if use_dask: 716s zeros = zeros.chunk(2) 716s nonzeros = nonzeros.chunk(2) 716s 716s with self.create_zarr_target() as store: 716s zeros.to_zarr( 716s store, 716s consolidated=consolidated, 716s compute=compute, 716s encoding={"u": dict(chunks=2)}, 716s **self.version_kwargs, 716s ) 716s if compute: 716s > with xr.open_zarr( 716s store, consolidated=consolidated, **self.version_kwargs 716s ) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 716s ds = open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _______________ TestZarrDictStore.test_write_region_mode[3-None] _______________ 716s 716s self = 716s mode = None 716s 716s @pytest.mark.parametrize("mode", [None, "r+", "a"]) 716s def test_write_region_mode(self, mode) -> None: 716s zeros = Dataset({"u": (("x",), np.zeros(10))}) 716s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 716s with self.create_zarr_target() as store: 716s zeros.to_zarr(store, **self.version_kwargs) 716s for region in [{"x": slice(5)}, {"x": slice(5, 10)}]: 716s > nonzeros.isel(region).to_zarr( 716s store, region=region, mode=mode, **self.version_kwargs 716s ) 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3065: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 716s return to_zarr( # type: ignore[call-overload,misc] 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 716s dump_to_store(dataset, zstore, writer, encoding=encoding) 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 716s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 716s k: self.open_store_variable(name=k) for k in existing_variable_names 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ________________ TestZarrDictStore.test_write_region_mode[3-r+] ________________ 716s 716s self = 716s mode = 'r+' 716s 716s @pytest.mark.parametrize("mode", [None, "r+", "a"]) 716s def test_write_region_mode(self, mode) -> None: 716s zeros = Dataset({"u": (("x",), np.zeros(10))}) 716s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 716s with self.create_zarr_target() as store: 716s zeros.to_zarr(store, **self.version_kwargs) 716s for region in [{"x": slice(5)}, {"x": slice(5, 10)}]: 716s > nonzeros.isel(region).to_zarr( 716s store, region=region, mode=mode, **self.version_kwargs 716s ) 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3065: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 716s return to_zarr( # type: ignore[call-overload,misc] 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 716s dump_to_store(dataset, zstore, writer, encoding=encoding) 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 716s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 716s k: self.open_store_variable(name=k) for k in existing_variable_names 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ________________ TestZarrDictStore.test_write_region_mode[3-a] _________________ 716s 716s self = 716s mode = 'a' 716s 716s @pytest.mark.parametrize("mode", [None, "r+", "a"]) 716s def test_write_region_mode(self, mode) -> None: 716s zeros = Dataset({"u": (("x",), np.zeros(10))}) 716s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 716s with self.create_zarr_target() as store: 716s zeros.to_zarr(store, **self.version_kwargs) 716s for region in [{"x": slice(5)}, {"x": slice(5, 10)}]: 716s > nonzeros.isel(region).to_zarr( 716s store, region=region, mode=mode, **self.version_kwargs 716s ) 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3065: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 716s return to_zarr( # type: ignore[call-overload,misc] 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 716s dump_to_store(dataset, zstore, writer, encoding=encoding) 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 716s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 716s k: self.open_store_variable(name=k) for k in existing_variable_names 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ________ TestZarrDictStore.test_write_preexisting_override_metadata[3] _________ 716s 716s self = 716s 716s @requires_dask 716s def test_write_preexisting_override_metadata(self) -> None: 716s """Metadata should be overridden if mode="a" but not in mode="r+".""" 716s original = Dataset( 716s {"u": (("x",), np.zeros(10), {"variable": "original"})}, 716s attrs={"global": "original"}, 716s ) 716s both_modified = Dataset( 716s {"u": (("x",), np.ones(10), {"variable": "modified"})}, 716s attrs={"global": "modified"}, 716s ) 716s global_modified = Dataset( 716s {"u": (("x",), np.ones(10), {"variable": "original"})}, 716s attrs={"global": "modified"}, 716s ) 716s only_new_data = Dataset( 716s {"u": (("x",), np.ones(10), {"variable": "original"})}, 716s attrs={"global": "original"}, 716s ) 716s 716s with self.create_zarr_target() as store: 716s original.to_zarr(store, compute=False, **self.version_kwargs) 716s > both_modified.to_zarr(store, mode="a", **self.version_kwargs) 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3093: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 716s return to_zarr( # type: ignore[call-overload,misc] 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 716s dump_to_store(dataset, zstore, writer, encoding=encoding) 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 716s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 716s k: self.open_store_variable(name=k) for k in existing_variable_names 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ________________ TestZarrDictStore.test_encoding_chunksizes[3] _________________ 716s 716s self = 716s 716s @requires_dask 716s def test_encoding_chunksizes(self) -> None: 716s # regression test for GH2278 716s # see also test_encoding_chunksizes_unlimited 716s nx, ny, nt = 4, 4, 5 716s original = xr.Dataset( 716s {}, 716s coords={ 716s "x": np.arange(nx), 716s "y": np.arange(ny), 716s "t": np.arange(nt), 716s }, 716s ) 716s original["v"] = xr.Variable(("x", "y", "t"), np.zeros((nx, ny, nt))) 716s original = original.chunk({"t": 1, "x": 2, "y": 2}) 716s 716s > with self.roundtrip(original) as ds1: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3207: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'v' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ______ TestZarrDictStore.test_chunk_encoding_with_partial_dask_chunks[3] _______ 716s 716s self = 716s 716s @requires_dask 716s def test_chunk_encoding_with_partial_dask_chunks(self) -> None: 716s original = xr.Dataset( 716s {"x": xr.DataArray(np.random.random(size=(6, 8)), dims=("a", "b"))} 716s ).chunk({"a": 3}) 716s 716s > with self.roundtrip( 716s original, save_kwargs={"encoding": {"x": {"chunks": [3, 2]}}} 716s ) as ds1: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3218: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'x' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ________________ TestZarrDictStore.test_open_zarr_use_cftime[3] ________________ 716s 716s self = 716s 716s @requires_cftime 716s def test_open_zarr_use_cftime(self) -> None: 716s ds = create_test_data() 716s with self.create_zarr_target() as store_target: 716s ds.to_zarr(store_target, **self.version_kwargs) 716s > ds_a = xr.open_zarr(store_target, **self.version_kwargs) 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3237: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 716s ds = open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ______________ TestZarrDictStore.test_write_read_select_write[3] _______________ 716s 716s self = 716s 716s def test_write_read_select_write(self) -> None: 716s # Test for https://github.com/pydata/xarray/issues/4084 716s ds = create_test_data() 716s 716s # NOTE: using self.roundtrip, which uses open_dataset, will not trigger the bug. 716s with self.create_zarr_target() as initial_store: 716s ds.to_zarr(initial_store, mode="w", **self.version_kwargs) 716s > ds1 = xr.open_zarr(initial_store, **self.version_kwargs) 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3252: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 716s ds = open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s __________________ TestZarrDictStore.test_attributes[3-obj1] ___________________ 716s 716s self = 716s obj = Size: 8B 716s array(nan) 716s Attributes: 716s good: {'key': 'value'} 716s 716s @pytest.mark.parametrize("obj", [Dataset(), DataArray(name="foo")]) 716s def test_attributes(self, obj) -> None: 716s obj = obj.copy() 716s 716s obj.attrs["good"] = {"key": "value"} 716s ds = obj if isinstance(obj, Dataset) else obj.to_dataset() 716s with self.create_zarr_target() as store_target: 716s ds.to_zarr(store_target, **self.version_kwargs) 716s > assert_identical(ds, xr.open_zarr(store_target, **self.version_kwargs)) 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3267: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 716s ds = open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'foo' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s __ TestZarrDictStore.test_chunked_datetime64_or_timedelta64[3-datetime64[ns]] __ 716s 716s self = 716s dtype = 'datetime64[ns]' 716s 716s @requires_dask 716s @pytest.mark.parametrize("dtype", ["datetime64[ns]", "timedelta64[ns]"]) 716s def test_chunked_datetime64_or_timedelta64(self, dtype) -> None: 716s # Generalized from @malmans2's test in PR #8253 716s original = create_test_data().astype(dtype).chunk(1) 716s > with self.roundtrip( 716s original, 716s open_kwargs={ 716s "chunks": {}, 716s "decode_timedelta": CFTimedeltaCoder(time_unit="ns"), 716s }, 716s ) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3280: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _ TestZarrDictStore.test_chunked_datetime64_or_timedelta64[3-timedelta64[ns]] __ 716s 716s self = 716s dtype = 'timedelta64[ns]' 716s 716s @requires_dask 716s @pytest.mark.parametrize("dtype", ["datetime64[ns]", "timedelta64[ns]"]) 716s def test_chunked_datetime64_or_timedelta64(self, dtype) -> None: 716s # Generalized from @malmans2's test in PR #8253 716s original = create_test_data().astype(dtype).chunk(1) 716s > with self.roundtrip( 716s original, 716s open_kwargs={ 716s "chunks": {}, 716s "decode_timedelta": CFTimedeltaCoder(time_unit="ns"), 716s }, 716s ) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3280: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ___________ TestZarrDictStore.test_zarr_fill_value_setting[3-float] ____________ 716s 716s self = 716s dtype = 716s 716s @requires_dask 716s @pytest.mark.parametrize("dtype", [int, float]) 716s def test_zarr_fill_value_setting(self, dtype): 716s # When zarr_format=2, _FillValue sets fill_value 716s # When zarr_format=3, fill_value is set independently 716s # We test this by writing a dask array with compute=False, 716s # on read we should receive chunks filled with `fill_value` 716s fv = -1 716s ds = xr.Dataset( 716s {"foo": ("x", dask.array.from_array(np.array([0, 0, 0], dtype=dtype)))} 716s ) 716s expected = xr.Dataset({"foo": ("x", [fv] * 3)}) 716s 716s zarr_format_2 = ( 716s has_zarr_v3 and zarr.config.get("default_zarr_format") == 2 716s ) or not has_zarr_v3 716s if zarr_format_2: 716s attr = "_FillValue" 716s expected.foo.attrs[attr] = fv 716s else: 716s attr = "fill_value" 716s if dtype is float: 716s # for floats, Xarray inserts a default `np.nan` 716s expected.foo.attrs["_FillValue"] = np.nan 716s 716s # turn off all decoding so we see what Zarr returns to us. 716s # Since chunks, are not written, we should receive on `fill_value` 716s open_kwargs = { 716s "mask_and_scale": False, 716s "consolidated": False, 716s "use_zarr_fill_value_as_mask": False, 716s } 716s save_kwargs = dict(compute=False, consolidated=False) 716s > with self.roundtrip( 716s ds, 716s save_kwargs=ChainMap(save_kwargs, dict(encoding={"foo": {attr: fv}})), 716s open_kwargs=open_kwargs, 716s ) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3374: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'foo' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ___________ TestZarrDirectoryStore.test_zero_dimensional_variable[3] ___________ 716s 716s self = 716s 716s def test_zero_dimensional_variable(self) -> None: 716s expected = create_test_data() 716s expected["float_var"] = ([], 1.0e9, {"units": "units of awesome"}) 716s expected["bytes_var"] = ([], b"foobar") 716s expected["string_var"] = ([], "foobar") 716s > with self.roundtrip(expected) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:408: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s __________________ TestZarrDirectoryStore.test_write_store[3] __________________ 716s 716s self = 716s 716s def test_write_store(self) -> None: 716s expected = create_test_data() 716s with self.create_store() as store: 716s expected.dump_to_store(store) 716s # we need to cf decode the store because it has time and 716s # non-dimension coordinates 716s > with xr.decode_cf(store) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:417: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/conventions.py:570: in decode_cf 716s vars, attrs = obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ______________ TestZarrDirectoryStore.test_roundtrip_test_data[3] ______________ 716s 716s self = 716s 716s def test_roundtrip_test_data(self) -> None: 716s expected = create_test_data() 716s > with self.roundtrip(expected) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:441: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _____________________ TestZarrDirectoryStore.test_load[3] ______________________ 716s 716s self = 716s 716s def test_load(self) -> None: 716s expected = create_test_data() 716s 716s @contextlib.contextmanager 716s def assert_loads(vars=None): 716s if vars is None: 716s vars = expected 716s with self.roundtrip(expected) as actual: 716s for k, v in actual.variables.items(): 716s # IndexVariables are eagerly loaded into memory 716s assert v._in_memory == (k in actual.dims) 716s yield actual 716s for k, v in actual.variables.items(): 716s if k in vars: 716s assert v._in_memory 716s assert_identical(expected, actual) 716s 716s with pytest.raises(AssertionError): 716s # make sure the contextmanager works! 716s > with assert_loads() as ds: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:464: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:452: in assert_loads 716s with self.roundtrip(expected) as actual: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ________________ TestZarrDirectoryStore.test_dataset_compute[3] ________________ 716s 716s self = 716s 716s def test_dataset_compute(self) -> None: 716s expected = create_test_data() 716s 716s > with self.roundtrip(expected) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:481: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ____________ TestZarrDirectoryStore.test_roundtrip_object_dtype[3] _____________ 716s 716s self = 716s 716s def test_roundtrip_object_dtype(self) -> None: 716s floats = np.array([0.0, 0.0, 1.0, 2.0, 3.0], dtype=object) 716s floats_nans = np.array([np.nan, np.nan, 1.0, 2.0, 3.0], dtype=object) 716s bytes_ = np.array([b"ab", b"cdef", b"g"], dtype=object) 716s bytes_nans = np.array([b"ab", b"cdef", np.nan], dtype=object) 716s strings = np.array(["ab", "cdef", "g"], dtype=object) 716s strings_nans = np.array(["ab", "cdef", np.nan], dtype=object) 716s all_nans = np.array([np.nan, np.nan], dtype=object) 716s original = Dataset( 716s { 716s "floats": ("a", floats), 716s "floats_nans": ("a", floats_nans), 716s "bytes": ("b", bytes_), 716s "bytes_nans": ("b", bytes_nans), 716s "strings": ("b", strings), 716s "strings_nans": ("b", strings_nans), 716s "all_nans": ("c", all_nans), 716s "nan": ([], np.nan), 716s } 716s ) 716s expected = original.copy(deep=True) 716s > with self.roundtrip(original) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:558: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'nan' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ____________ TestZarrDirectoryStore.test_roundtrip_float64_data[3] _____________ 716s 716s self = 716s 716s def test_roundtrip_float64_data(self) -> None: 716s expected = Dataset({"x": ("y", np.array([1.0, 2.0, np.pi], dtype="float64"))}) 716s > with self.roundtrip(expected) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:646: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'x' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ______________ TestZarrDirectoryStore.test_orthogonal_indexing[3] ______________ 716s 716s self = 716s 716s def test_orthogonal_indexing(self) -> None: 716s in_memory = create_test_data() 716s > with self.roundtrip(in_memory) as on_disk: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:713: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ______________ TestZarrDirectoryStore.test_vectorized_indexing[3] ______________ 716s 716s self = 716s 716s def test_vectorized_indexing(self) -> None: 716s in_memory = create_test_data() 716s > with self.roundtrip(in_memory) as on_disk: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:727: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _______ TestZarrDirectoryStore.test_vectorized_indexing_negative_step[3] _______ 716s 716s self = 716s 716s def test_vectorized_indexing_negative_step(self) -> None: 716s # use dask explicitly when present 716s open_kwargs: dict[str, Any] | None 716s if has_dask: 716s open_kwargs = {"chunks": {}} 716s else: 716s open_kwargs = None 716s in_memory = create_test_data() 716s 716s def multiple_indexing(indexers): 716s # make sure a sequence of lazy indexings certainly works. 716s with self.roundtrip(in_memory, open_kwargs=open_kwargs) as on_disk: 716s actual = on_disk["var3"] 716s expected = in_memory["var3"] 716s for ind in indexers: 716s actual = actual.isel(ind) 716s expected = expected.isel(ind) 716s # make sure the array is not yet loaded into memory 716s assert not actual.variable._in_memory 716s assert_identical(expected, actual.load()) 716s 716s # with negative step slice. 716s indexers = [ 716s { 716s "dim1": DataArray([[0, 7], [2, 6], [3, 5]], dims=["a", "b"]), 716s "dim3": slice(-1, 1, -1), 716s } 716s ] 716s > multiple_indexing(indexers) 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:817: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:800: in multiple_indexing 716s with self.roundtrip(in_memory, open_kwargs=open_kwargs) as on_disk: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ____________ TestZarrDirectoryStore.test_outer_indexing_reversed[3] ____________ 716s 716s self = 716s 716s def test_outer_indexing_reversed(self) -> None: 716s # regression test for GH6560 716s ds = xr.Dataset( 716s {"z": (("t", "p", "y", "x"), np.ones((1, 1, 31, 40)))}, 716s ) 716s 716s > with self.roundtrip(ds) as on_disk: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:834: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'z' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ________________ TestZarrDirectoryStore.test_isel_dataarray[3] _________________ 716s 716s self = 716s 716s def test_isel_dataarray(self) -> None: 716s # Make sure isel works lazily. GH:issue:1688 716s in_memory = create_test_data() 716s > with self.roundtrip(in_memory) as on_disk: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:841: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ___________ TestZarrDirectoryStore.test_array_type_after_indexing[3] ___________ 716s 716s self = 716s 716s def test_array_type_after_indexing(self) -> None: 716s in_memory = create_test_data() 716s > with self.roundtrip(in_memory) as on_disk: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:868: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ____________________ TestZarrDirectoryStore.test_dropna[3] _____________________ 716s 716s self = 716s 716s def test_dropna(self) -> None: 716s # regression test for GH:issue:1694 716s a = np.random.randn(4, 3) 716s a[1, 1] = np.nan 716s in_memory = xr.Dataset( 716s {"a": (("y", "x"), a)}, coords={"y": np.arange(4), "x": np.arange(3)} 716s ) 716s 716s assert_identical( 716s in_memory.dropna(dim="x"), in_memory.isel(x=slice(None, None, 2)) 716s ) 716s 716s > with self.roundtrip(in_memory) as on_disk: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:893: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'a' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ______________ TestZarrDirectoryStore.test_ondisk_after_print[3] _______________ 716s 716s self = 716s 716s def test_ondisk_after_print(self) -> None: 716s """Make sure print does not load file into memory""" 716s in_memory = create_test_data() 716s > with self.roundtrip(in_memory) as on_disk: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:902: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ________ TestZarrDirectoryStore.test_roundtrip_bytes_with_fill_value[3] ________ 716s 716s self = 716s 716s def test_roundtrip_bytes_with_fill_value(self) -> None: 716s values = np.array([b"ab", b"cdef", np.nan], dtype=object) 716s encoding = {"_FillValue": b"X", "dtype": "S1"} 716s original = Dataset({"x": ("t", values, {}, encoding)}) 716s expected = original.copy(deep=True) 716s > with self.roundtrip(original) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:913: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'x' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'NullTerminatedBytes' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _____ TestZarrDirectoryStore.test_roundtrip_unsigned[3-fill_value0-False] ______ 716s 716s self = 716s fill_value = np.int8(-1), exp_fill_warning = False 716s 716s @pytest.mark.parametrize( 716s ("fill_value", "exp_fill_warning"), 716s [ 716s (np.int8(-1), False), 716s (np.uint8(255), True), 716s (-1, False), 716s (255, True), 716s ], 716s ) 716s def test_roundtrip_unsigned(self, fill_value, exp_fill_warning): 716s @contextlib.contextmanager 716s def _roundtrip_with_warnings(*args, **kwargs): 716s is_np2 = module_available("numpy", minversion="2.0.0.dev0") 716s if exp_fill_warning and is_np2: 716s warn_checker: contextlib.AbstractContextManager = pytest.warns( 716s SerializationWarning, 716s match="_FillValue attribute can't be represented", 716s ) 716s else: 716s warn_checker = contextlib.nullcontext() 716s with warn_checker: 716s with self.roundtrip(*args, **kwargs) as actual: 716s yield actual 716s 716s # regression/numpy2 test for 716s encoding = { 716s "_FillValue": fill_value, 716s "_Unsigned": "true", 716s "dtype": "i1", 716s } 716s x = np.array([0, 1, 127, 128, 254, np.nan], dtype=np.float32) 716s decoded = Dataset({"x": ("t", x, {}, encoding)}) 716s 716s attributes = { 716s "_FillValue": fill_value, 716s "_Unsigned": "true", 716s } 716s # Create unsigned data corresponding to [0, 1, 127, 128, 255] unsigned 716s sb = np.asarray([0, 1, 127, -128, -2, -1], dtype="i1") 716s encoded = Dataset({"x": ("t", sb, attributes)}) 716s unsigned_dtype = np.dtype(f"u{sb.dtype.itemsize}") 716s 716s > with _roundtrip_with_warnings(decoded) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1066: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1045: in _roundtrip_with_warnings 716s with self.roundtrip(*args, **kwargs) as actual: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'x' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Int8' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ______ TestZarrDirectoryStore.test_roundtrip_unsigned[3-fill_value1-True] ______ 716s 716s self = 716s fill_value = np.uint8(255), exp_fill_warning = True 716s 716s @pytest.mark.parametrize( 716s ("fill_value", "exp_fill_warning"), 716s [ 716s (np.int8(-1), False), 716s (np.uint8(255), True), 716s (-1, False), 716s (255, True), 716s ], 716s ) 716s def test_roundtrip_unsigned(self, fill_value, exp_fill_warning): 716s @contextlib.contextmanager 716s def _roundtrip_with_warnings(*args, **kwargs): 716s is_np2 = module_available("numpy", minversion="2.0.0.dev0") 716s if exp_fill_warning and is_np2: 716s warn_checker: contextlib.AbstractContextManager = pytest.warns( 716s SerializationWarning, 716s match="_FillValue attribute can't be represented", 716s ) 716s else: 716s warn_checker = contextlib.nullcontext() 716s with warn_checker: 716s with self.roundtrip(*args, **kwargs) as actual: 716s yield actual 716s 716s # regression/numpy2 test for 716s encoding = { 716s "_FillValue": fill_value, 716s "_Unsigned": "true", 716s "dtype": "i1", 716s } 716s x = np.array([0, 1, 127, 128, 254, np.nan], dtype=np.float32) 716s decoded = Dataset({"x": ("t", x, {}, encoding)}) 716s 716s attributes = { 716s "_FillValue": fill_value, 716s "_Unsigned": "true", 716s } 716s # Create unsigned data corresponding to [0, 1, 127, 128, 255] unsigned 716s sb = np.asarray([0, 1, 127, -128, -2, -1], dtype="i1") 716s encoded = Dataset({"x": ("t", sb, attributes)}) 716s unsigned_dtype = np.dtype(f"u{sb.dtype.itemsize}") 716s 716s > with _roundtrip_with_warnings(decoded) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1066: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1045: in _roundtrip_with_warnings 716s with self.roundtrip(*args, **kwargs) as actual: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'x' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Int8' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s __________ TestZarrDirectoryStore.test_roundtrip_unsigned[3--1-False] __________ 716s 716s self = 716s fill_value = -1, exp_fill_warning = False 716s 716s @pytest.mark.parametrize( 716s ("fill_value", "exp_fill_warning"), 716s [ 716s (np.int8(-1), False), 716s (np.uint8(255), True), 716s (-1, False), 716s (255, True), 716s ], 716s ) 716s def test_roundtrip_unsigned(self, fill_value, exp_fill_warning): 716s @contextlib.contextmanager 716s def _roundtrip_with_warnings(*args, **kwargs): 716s is_np2 = module_available("numpy", minversion="2.0.0.dev0") 716s if exp_fill_warning and is_np2: 716s warn_checker: contextlib.AbstractContextManager = pytest.warns( 716s SerializationWarning, 716s match="_FillValue attribute can't be represented", 716s ) 716s else: 716s warn_checker = contextlib.nullcontext() 716s with warn_checker: 716s with self.roundtrip(*args, **kwargs) as actual: 716s yield actual 716s 716s # regression/numpy2 test for 716s encoding = { 716s "_FillValue": fill_value, 716s "_Unsigned": "true", 716s "dtype": "i1", 716s } 716s x = np.array([0, 1, 127, 128, 254, np.nan], dtype=np.float32) 716s decoded = Dataset({"x": ("t", x, {}, encoding)}) 716s 716s attributes = { 716s "_FillValue": fill_value, 716s "_Unsigned": "true", 716s } 716s # Create unsigned data corresponding to [0, 1, 127, 128, 255] unsigned 716s sb = np.asarray([0, 1, 127, -128, -2, -1], dtype="i1") 716s encoded = Dataset({"x": ("t", sb, attributes)}) 716s unsigned_dtype = np.dtype(f"u{sb.dtype.itemsize}") 716s 716s > with _roundtrip_with_warnings(decoded) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1066: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1045: in _roundtrip_with_warnings 716s with self.roundtrip(*args, **kwargs) as actual: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'x' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Int8' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s __________ TestZarrDirectoryStore.test_roundtrip_unsigned[3-255-True] __________ 716s 716s self = 716s fill_value = 255, exp_fill_warning = True 716s 716s @pytest.mark.parametrize( 716s ("fill_value", "exp_fill_warning"), 716s [ 716s (np.int8(-1), False), 716s (np.uint8(255), True), 716s (-1, False), 716s (255, True), 716s ], 716s ) 716s def test_roundtrip_unsigned(self, fill_value, exp_fill_warning): 716s @contextlib.contextmanager 716s def _roundtrip_with_warnings(*args, **kwargs): 716s is_np2 = module_available("numpy", minversion="2.0.0.dev0") 716s if exp_fill_warning and is_np2: 716s warn_checker: contextlib.AbstractContextManager = pytest.warns( 716s SerializationWarning, 716s match="_FillValue attribute can't be represented", 716s ) 716s else: 716s warn_checker = contextlib.nullcontext() 716s with warn_checker: 716s with self.roundtrip(*args, **kwargs) as actual: 716s yield actual 716s 716s # regression/numpy2 test for 716s encoding = { 716s "_FillValue": fill_value, 716s "_Unsigned": "true", 716s "dtype": "i1", 716s } 716s x = np.array([0, 1, 127, 128, 254, np.nan], dtype=np.float32) 716s decoded = Dataset({"x": ("t", x, {}, encoding)}) 716s 716s attributes = { 716s "_FillValue": fill_value, 716s "_Unsigned": "true", 716s } 716s # Create unsigned data corresponding to [0, 1, 127, 128, 255] unsigned 716s sb = np.asarray([0, 1, 127, -128, -2, -1], dtype="i1") 716s encoded = Dataset({"x": ("t", sb, attributes)}) 716s unsigned_dtype = np.dtype(f"u{sb.dtype.itemsize}") 716s 716s > with _roundtrip_with_warnings(decoded) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1066: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1045: in _roundtrip_with_warnings 716s with self.roundtrip(*args, **kwargs) as actual: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'x' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Int8' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _ TestZarrDirectoryStore.test_grid_mapping_and_bounds_are_not_coordinates_in_file[3] _ 716s 716s self = 716s 716s def test_grid_mapping_and_bounds_are_not_coordinates_in_file(self) -> None: 716s original = self._create_cf_dataset() 716s > with self.roundtrip(original, open_kwargs={"decode_coords": False}) as ds: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1142: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = 716s name = 'det_lim' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _ TestZarrDirectoryStore.test_coordinate_variables_after_dataset_roundtrip[3] __ 716s 716s self = 716s 716s def test_coordinate_variables_after_dataset_roundtrip(self) -> None: 716s original = self._create_cf_dataset() 716s > with self.roundtrip(original, open_kwargs={"decode_coords": "all"}) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1150: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = 716s name = 'det_lim' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _ TestZarrDirectoryStore.test_grid_mapping_and_bounds_are_coordinates_after_dataarray_roundtrip[3] _ 716s 716s self = 716s 716s def test_grid_mapping_and_bounds_are_coordinates_after_dataarray_roundtrip( 716s self, 716s ) -> None: 716s original = self._create_cf_dataset() 716s # The DataArray roundtrip should have the same warnings as the 716s # Dataset, but we already tested for those, so just go for the 716s # new warnings. It would appear that there is no way to tell 716s # pytest "This warning and also this warning should both be 716s # present". 716s # xarray/tests/test_conventions.py::TestCFEncodedDataStore 716s # needs the to_dataset. The other backends should be fine 716s # without it. 716s with pytest.warns( 716s UserWarning, 716s match=( 716s r"Variable\(s\) referenced in bounds not in variables: " 716s r"\['l(at|ong)itude_bnds'\]" 716s ), 716s ): 716s > with self.roundtrip( 716s original["variable"].to_dataset(), open_kwargs={"decode_coords": "all"} 716s ) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1182: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'ln_p' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s 716s During handling of the above exception, another exception occurred: 716s 716s self = 716s 716s def test_grid_mapping_and_bounds_are_coordinates_after_dataarray_roundtrip( 716s self, 716s ) -> None: 716s original = self._create_cf_dataset() 716s # The DataArray roundtrip should have the same warnings as the 716s # Dataset, but we already tested for those, so just go for the 716s # new warnings. It would appear that there is no way to tell 716s # pytest "This warning and also this warning should both be 716s # present". 716s # xarray/tests/test_conventions.py::TestCFEncodedDataStore 716s # needs the to_dataset. The other backends should be fine 716s # without it. 716s > with pytest.warns( 716s UserWarning, 716s match=( 716s r"Variable\(s\) referenced in bounds not in variables: " 716s r"\['l(at|ong)itude_bnds'\]" 716s ), 716s ): 716s E Failed: DID NOT WARN. No warnings of type (,) matching the regex were emitted. 716s E Regex: Variable\(s\) referenced in bounds not in variables: \['l(at|ong)itude_bnds'\] 716s E Emitted warnings: [ ZarrUserWarning('Consolidated metadata is currently not part in the Zarr format 3 specification. It may not be supported by other zarr implementations and may change in the future.')]. 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1175: Failed 716s ________________ TestZarrDirectoryStore.test_encoding_kwarg[3] _________________ 716s 716s self = 716s 716s def test_encoding_kwarg(self) -> None: 716s ds = Dataset({"x": ("y", np.arange(10.0))}) 716s 716s kwargs: dict[str, Any] = dict(encoding={"x": {"dtype": "f4"}}) 716s > with self.roundtrip(ds, save_kwargs=kwargs) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1277: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'x' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float32' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ______________ TestZarrDirectoryStore.test_default_fill_value[3] _______________ 716s 716s self = 716s 716s def test_default_fill_value(self) -> None: 716s # Test default encoding for float: 716s ds = Dataset({"x": ("y", np.arange(10.0))}) 716s kwargs = dict(encoding={"x": {"dtype": "f4"}}) 716s > with self.roundtrip(ds, save_kwargs=kwargs) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1319: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'x' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float32' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ______ TestZarrDirectoryStore.test_explicitly_omit_fill_value_in_coord[3] ______ 716s 716s self = 716s 716s def test_explicitly_omit_fill_value_in_coord(self) -> None: 716s ds = Dataset({"x": ("y", [np.pi, -np.pi])}, coords={"y": [0.0, 1.0]}) 716s ds.y.encoding["_FillValue"] = None 716s > with self.roundtrip(ds) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1355: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'x' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _ TestZarrDirectoryStore.test_explicitly_omit_fill_value_in_coord_via_encoding_kwarg[3] _ 716s 716s self = 716s 716s def test_explicitly_omit_fill_value_in_coord_via_encoding_kwarg(self) -> None: 716s ds = Dataset({"x": ("y", [np.pi, -np.pi])}, coords={"y": [0.0, 1.0]}) 716s kwargs = dict(encoding={"y": {"_FillValue": None}}) 716s > with self.roundtrip(ds, save_kwargs=kwargs) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1361: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'x' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ______________ TestZarrDirectoryStore.test_encoding_same_dtype[3] ______________ 716s 716s self = 716s 716s def test_encoding_same_dtype(self) -> None: 716s ds = Dataset({"x": ("y", np.arange(10.0, dtype="f4"))}) 716s kwargs = dict(encoding={"x": {"dtype": "f4"}}) 716s > with self.roundtrip(ds, save_kwargs=kwargs) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1368: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'x' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float32' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ____________ TestZarrDirectoryStore.test_append_overwrite_values[3] ____________ 716s 716s self = 716s 716s def test_append_overwrite_values(self) -> None: 716s # regression for GH1215 716s data = create_test_data() 716s with create_tmp_file(allow_cleanup_failure=False) as tmp_file: 716s self.save(data, tmp_file, mode="w") 716s data["var2"][:] = -999 716s data["var9"] = data["var2"] * 3 716s > self.save(data[["var2", "var9"]], tmp_file, mode="a") 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1387: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2296: in save 716s return dataset.to_zarr(store=store_target, **kwargs, **self.version_kwargs) 716s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 716s return to_zarr( # type: ignore[call-overload,misc] 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 716s dump_to_store(dataset, zstore, writer, encoding=encoding) 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 716s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 716s k: self.open_store_variable(name=k) for k in existing_variable_names 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _________ TestZarrDirectoryStore.test_roundtrip_consolidated[3-False] __________ 716s 716s self = 716s consolidated = False 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s def test_roundtrip_consolidated(self, consolidated) -> None: 716s expected = create_test_data() 716s > with self.roundtrip( 716s expected, 716s save_kwargs={"consolidated": consolidated}, 716s open_kwargs={"backend_kwargs": {"consolidated": consolidated}}, 716s ) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2321: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s __________ TestZarrDirectoryStore.test_roundtrip_consolidated[3-True] __________ 716s 716s self = 716s consolidated = True 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s def test_roundtrip_consolidated(self, consolidated) -> None: 716s expected = create_test_data() 716s > with self.roundtrip( 716s expected, 716s save_kwargs={"consolidated": consolidated}, 716s open_kwargs={"backend_kwargs": {"consolidated": consolidated}}, 716s ) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2321: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s __________ TestZarrDirectoryStore.test_roundtrip_consolidated[3-None] __________ 716s 716s self = 716s consolidated = None 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s def test_roundtrip_consolidated(self, consolidated) -> None: 716s expected = create_test_data() 716s > with self.roundtrip( 716s expected, 716s save_kwargs={"consolidated": consolidated}, 716s open_kwargs={"backend_kwargs": {"consolidated": consolidated}}, 716s ) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2321: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _________ TestZarrDirectoryStore.test_read_non_consolidated_warning[3] _________ 716s 716s self = 716s 716s def test_read_non_consolidated_warning(self) -> None: 716s expected = create_test_data() 716s with self.create_zarr_target() as store: 716s self.save( 716s expected, store_target=store, consolidated=False, **self.version_kwargs 716s ) 716s with pytest.warns( 716s RuntimeWarning, 716s match="Failed to open Zarr store with consolidated", 716s ): 716s > with xr.open_zarr(store, **self.version_kwargs) as ds: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2339: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 716s ds = open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ______________ TestZarrDirectoryStore.test_non_existent_store[3] _______________ 716s 716s self = 716s 716s def test_non_existent_store(self) -> None: 716s with pytest.raises( 716s FileNotFoundError, match="(No such file or directory|Unable to find group)" 716s ): 716s > xr.open_zarr(f"{uuid.uuid4()}") 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2346: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 716s ds = open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1608: in open_dataset 716s store = ZarrStore.open_group( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:732: in open_group 716s ) = _get_open_params( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1811: in _get_open_params 716s zarr_root_group = zarr.open_consolidated(store, **open_kwargs) 716s /usr/lib/python3/dist-packages/zarr/api/synchronous.py:231: in open_consolidated 716s sync(async_api.open_consolidated(*args, use_consolidated=use_consolidated, **kwargs)) 716s /usr/lib/python3/dist-packages/zarr/core/sync.py:163: in sync 716s raise return_result 716s /usr/lib/python3/dist-packages/zarr/core/sync.py:119: in _runner 716s return await coro 716s /usr/lib/python3/dist-packages/zarr/api/asynchronous.py:408: in open_consolidated 716s return await open_group(*args, use_consolidated=use_consolidated, **kwargs) 716s /usr/lib/python3/dist-packages/zarr/api/asynchronous.py:851: in open_group 716s store_path = await make_store_path(store, mode=mode, storage_options=storage_options, path=path) 716s /usr/lib/python3/dist-packages/zarr/storage/_common.py:418: in make_store_path 716s store = await make_store(store_like, mode=mode, storage_options=storage_options) 716s /usr/lib/python3/dist-packages/zarr/storage/_common.py:349: in make_store 716s return await make_store(Path(store_like), mode=mode, storage_options=storage_options) 716s /usr/lib/python3/dist-packages/zarr/storage/_common.py:339: in make_store 716s return await LocalStore.open(root=store_like, mode=mode, read_only=_read_only) 716s /usr/lib/python3/dist-packages/zarr/storage/_local.py:160: in open 716s await store._open() 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = LocalStore('file:///tmp/autopkgtest.cdpOi4/autopkgtest_tmp/build/0f70e57d-e576-4f66-9b2f-b14909da9b52') 716s 716s async def _open(self, *, mode: AccessModeLiteral | None = None) -> None: 716s if not self.read_only: 716s self.root.mkdir(parents=True, exist_ok=True) 716s 716s if not self.root.exists(): 716s > raise FileNotFoundError(f"{self.root} does not exist") 716s E FileNotFoundError: /tmp/autopkgtest.cdpOi4/autopkgtest_tmp/build/0f70e57d-e576-4f66-9b2f-b14909da9b52 does not exist 716s 716s /usr/lib/python3/dist-packages/zarr/storage/_local.py:172: FileNotFoundError 716s 716s During handling of the above exception, another exception occurred: 716s 716s self = 716s 716s def test_non_existent_store(self) -> None: 716s > with pytest.raises( 716s FileNotFoundError, match="(No such file or directory|Unable to find group)" 716s ): 716s E AssertionError: Regex pattern did not match. 716s E Regex: '(No such file or directory|Unable to find group)' 716s E Input: '/tmp/autopkgtest.cdpOi4/autopkgtest_tmp/build/0f70e57d-e576-4f66-9b2f-b14909da9b52 does not exist' 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2343: AssertionError 716s __________________ TestZarrDirectoryStore.test_auto_chunk[3] ___________________ 716s 716s self = 716s 716s @requires_dask 716s def test_auto_chunk(self) -> None: 716s original = create_test_data().chunk() 716s 716s > with self.roundtrip(original, open_kwargs={"chunks": None}) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2367: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _________________ TestZarrDirectoryStore.test_manual_chunk[3] __________________ 716s 716s self = 716s 716s @requires_dask 716s @pytest.mark.filterwarnings("ignore:The specified chunks separate:UserWarning") 716s def test_manual_chunk(self) -> None: 716s original = create_test_data().chunk({"dim1": 3, "dim2": 4, "dim3": 3}) 716s 716s # Using chunks = None should return non-chunked arrays 716s open_kwargs: dict[str, Any] = {"chunks": None} 716s > with self.roundtrip(original, open_kwargs=open_kwargs) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2388: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _____________ TestZarrDirectoryStore.test_warning_on_bad_chunks[3] _____________ 716s 716s self = 716s 716s @requires_dask 716s def test_warning_on_bad_chunks(self) -> None: 716s original = create_test_data().chunk({"dim1": 4, "dim2": 3, "dim3": 3}) 716s 716s bad_chunks = (2, {"dim2": (3, 3, 2, 1)}) 716s for chunks in bad_chunks: 716s kwargs = {"chunks": chunks} 716s with pytest.warns(UserWarning): 716s > with self.roundtrip(original, open_kwargs=kwargs) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2433: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ___________ TestZarrDirectoryStore.test_write_uneven_dask_chunks[3] ____________ 716s 716s self = 716s 716s @requires_dask 716s def test_write_uneven_dask_chunks(self) -> None: 716s # regression for GH#2225 716s original = create_test_data().chunk({"dim1": 3, "dim2": 4, "dim3": 3}) 716s > with self.roundtrip(original, open_kwargs={"chunks": {}}) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2476: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ________________ TestZarrDirectoryStore.test_chunk_encoding[3] _________________ 716s 716s self = 716s 716s def test_chunk_encoding(self) -> None: 716s # These datasets have no dask chunks. All chunking specified in 716s # encoding 716s data = create_test_data() 716s chunks = (5, 5) 716s data["var2"].encoding.update({"chunks": chunks}) 716s 716s > with self.roundtrip(data) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2487: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ________________ TestZarrDirectoryStore.test_shard_encoding[3] _________________ 716s 716s self = 716s 716s def test_shard_encoding(self) -> None: 716s # These datasets have no dask chunks. All chunking/sharding specified in 716s # encoding 716s if has_zarr_v3 and zarr.config.config["default_zarr_format"] == 3: 716s data = create_test_data() 716s chunks = (1, 1) 716s shards = (5, 5) 716s data["var2"].encoding.update({"chunks": chunks}) 716s data["var2"].encoding.update({"shards": shards}) 716s > with self.roundtrip(data) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2505: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _________ TestZarrDirectoryStore.test_write_persistence_modes[3-None] __________ 716s 716s self = 716s group = None 716s 716s @pytest.mark.parametrize("group", [None, "group1"]) 716s def test_write_persistence_modes(self, group) -> None: 716s original = create_test_data() 716s 716s # overwrite mode 716s > with self.roundtrip( 716s original, 716s save_kwargs={"mode": "w", "group": group}, 716s open_kwargs={"group": group}, 716s ) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2650: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ________ TestZarrDirectoryStore.test_write_persistence_modes[3-group1] _________ 716s 716s self = 716s group = 'group1' 716s 716s @pytest.mark.parametrize("group", [None, "group1"]) 716s def test_write_persistence_modes(self, group) -> None: 716s original = create_test_data() 716s 716s # overwrite mode 716s > with self.roundtrip( 716s original, 716s save_kwargs={"mode": "w", "group": group}, 716s open_kwargs={"group": group}, 716s ) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2650: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ______________ TestZarrDirectoryStore.test_compressor_encoding[3] ______________ 716s 716s self = 716s 716s def test_compressor_encoding(self) -> None: 716s # specify a custom compressor 716s original = create_test_data() 716s if has_zarr_v3 and zarr.config.config["default_zarr_format"] == 3: 716s encoding_key = "compressors" 716s # all parameters need to be explicitly specified in order for the comparison to pass below 716s encoding = { 716s "serializer": zarr.codecs.BytesCodec(endian="little"), 716s encoding_key: ( 716s zarr.codecs.BloscCodec( 716s cname="zstd", 716s clevel=3, 716s shuffle="shuffle", 716s typesize=8, 716s blocksize=0, 716s ), 716s ), 716s } 716s else: 716s from numcodecs.blosc import Blosc 716s 716s encoding_key = "compressors" if has_zarr_v3 else "compressor" 716s comp = Blosc(cname="zstd", clevel=3, shuffle=2) 716s encoding = {encoding_key: (comp,) if has_zarr_v3 else comp} 716s 716s save_kwargs = dict(encoding={"var1": encoding}) 716s 716s > with self.roundtrip(original, save_kwargs=save_kwargs) as ds: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2723: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _____________________ TestZarrDirectoryStore.test_group[3] _____________________ 716s 716s self = 716s 716s def test_group(self) -> None: 716s original = create_test_data() 716s group = "some/random/path" 716s > with self.roundtrip( 716s original, save_kwargs={"group": group}, open_kwargs={"group": group} 716s ) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2730: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _________________ TestZarrDirectoryStore.test_append_write[3] __________________ 716s 716s self = 716s 716s def test_append_write(self) -> None: 716s > super().test_append_write() 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2762: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1377: in test_append_write 716s with self.roundtrip_append(data) as actual: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:388: in roundtrip_append 716s self.save(data[[key]], path, mode=mode, **save_kwargs) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2296: in save 716s return dataset.to_zarr(store=store_target, **kwargs, **self.version_kwargs) 716s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 716s return to_zarr( # type: ignore[call-overload,misc] 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 716s dump_to_store(dataset, zstore, writer, encoding=encoding) 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 716s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 716s k: self.open_store_variable(name=k) for k in existing_variable_names 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _____ TestZarrDirectoryStore.test_append_with_append_dim_not_set_raises[3] _____ 716s 716s self = 716s 716s def test_append_with_append_dim_not_set_raises(self) -> None: 716s ds, ds_to_append, _ = create_append_test_data() 716s with self.create_zarr_target() as store_target: 716s ds.to_zarr(store_target, mode="w", **self.version_kwargs) 716s with pytest.raises(ValueError, match="different dimension sizes"): 716s > ds_to_append.to_zarr(store_target, mode="a", **self.version_kwargs) 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2809: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 716s return to_zarr( # type: ignore[call-overload,misc] 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 716s dump_to_store(dataset, zstore, writer, encoding=encoding) 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 716s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 716s k: self.open_store_variable(name=k) for k in existing_variable_names 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'da' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _____ TestZarrDirectoryStore.test_append_string_length_mismatch_works[3-U] _____ 716s 716s self = 716s dtype = 'U' 716s 716s @pytest.mark.parametrize("dtype", ["U", "S"]) 716s def test_append_string_length_mismatch_works(self, dtype) -> None: 716s skip_if_zarr_format_2("This doesn't work with Zarr format 2") 716s # ...but it probably would if we used object dtype 716s ds, ds_to_append = create_append_string_length_mismatch_test_data(dtype) 716s expected = xr.concat([ds, ds_to_append], dim="time") 716s with self.create_zarr_target() as store_target: 716s ds.to_zarr(store_target, mode="w", **self.version_kwargs) 716s > ds_to_append.to_zarr(store_target, append_dim="time", **self.version_kwargs) 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2851: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 716s return to_zarr( # type: ignore[call-overload,misc] 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 716s dump_to_store(dataset, zstore, writer, encoding=encoding) 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 716s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1018: in store 716s _validate_datatypes_for_zarr_append( 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s vname = 'temperature' 716s existing_var = Size: 24B 716s [3 values with dtype= Size: 60B 716s array(['abc', 'def', 'ghijk'], dtype=' raise ValueError( 716s f"Mismatched dtypes for variable {vname} between Zarr store on disk " 716s f"and dataset to append. Store has dtype {existing_var.dtype} but " 716s f"dataset to append has dtype {new_var.dtype}." 716s ) 716s E ValueError: Mismatched dtypes for variable temperature between Zarr store on disk and dataset to append. Store has dtype 716s dtype = 'S' 716s 716s @pytest.mark.parametrize("dtype", ["U", "S"]) 716s def test_append_string_length_mismatch_works(self, dtype) -> None: 716s skip_if_zarr_format_2("This doesn't work with Zarr format 2") 716s # ...but it probably would if we used object dtype 716s ds, ds_to_append = create_append_string_length_mismatch_test_data(dtype) 716s expected = xr.concat([ds, ds_to_append], dim="time") 716s with self.create_zarr_target() as store_target: 716s ds.to_zarr(store_target, mode="w", **self.version_kwargs) 716s > ds_to_append.to_zarr(store_target, append_dim="time", **self.version_kwargs) 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2851: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 716s return to_zarr( # type: ignore[call-overload,misc] 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 716s dump_to_store(dataset, zstore, writer, encoding=encoding) 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 716s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1018: in store 716s _validate_datatypes_for_zarr_append( 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s vname = 'temperature' 716s existing_var = Size: 6B 716s [3 values with dtype=|S2] 716s new_var = Size: 9B 716s array([b'aaa', b'bbb', b'ccc'], dtype='|S3') 716s 716s def _validate_datatypes_for_zarr_append(vname, existing_var, new_var): 716s """If variable exists in the store, confirm dtype of the data to append is compatible with 716s existing dtype. 716s """ 716s if ( 716s np.issubdtype(new_var.dtype, np.number) 716s or np.issubdtype(new_var.dtype, np.datetime64) 716s or np.issubdtype(new_var.dtype, np.bool_) 716s or new_var.dtype == object 716s or (new_var.dtype.kind in ("S", "U") and existing_var.dtype == object) 716s ): 716s # We can skip dtype equality checks under two conditions: (1) if the var to append is 716s # new to the dataset, because in this case there is no existing var to compare it to; 716s # or (2) if var to append's dtype is known to be easy-to-append, because in this case 716s # we can be confident appending won't cause problems. Examples of dtypes which are not 716s # easy-to-append include length-specified strings of type `|S*` or ` raise ValueError( 716s f"Mismatched dtypes for variable {vname} between Zarr store on disk " 716s f"and dataset to append. Store has dtype {existing_var.dtype} but " 716s f"dataset to append has dtype {new_var.dtype}." 716s ) 716s E ValueError: Mismatched dtypes for variable temperature between Zarr store on disk and dataset to append. Store has dtype |S2 but dataset to append has dtype |S3. 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:566: ValueError 716s ___ TestZarrDirectoryStore.test_check_encoding_is_consistent_after_append[3] ___ 716s 716s self = 716s 716s def test_check_encoding_is_consistent_after_append(self) -> None: 716s ds, ds_to_append, _ = create_append_test_data() 716s 716s # check encoding consistency 716s with self.create_zarr_target() as store_target: 716s import numcodecs 716s 716s encoding_value: Any 716s if has_zarr_v3 and zarr.config.config["default_zarr_format"] == 3: 716s compressor = zarr.codecs.BloscCodec() 716s else: 716s compressor = numcodecs.Blosc() 716s encoding_key = "compressors" if has_zarr_v3 else "compressor" 716s encoding_value = (compressor,) if has_zarr_v3 else compressor 716s 716s encoding = {"da": {encoding_key: encoding_value}} 716s ds.to_zarr(store_target, mode="w", encoding=encoding, **self.version_kwargs) 716s > original_ds = xr.open_dataset( 716s store_target, engine="zarr", **self.version_kwargs 716s ) 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2872: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'da' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ___________ TestZarrDirectoryStore.test_append_with_new_variable[3] ____________ 716s 716s self = 716s 716s def test_append_with_new_variable(self) -> None: 716s ds, ds_to_append, ds_with_new_var = create_append_test_data() 716s 716s # check append mode for new variable 716s with self.create_zarr_target() as store_target: 716s combined = xr.concat([ds, ds_to_append], dim="time") 716s combined.to_zarr(store_target, mode="w", **self.version_kwargs) 716s assert_identical( 716s combined, 716s > xr.open_dataset(store_target, engine="zarr", **self.version_kwargs), 716s ) 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2899: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'da' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ______ TestZarrDirectoryStore.test_append_with_append_dim_no_overwrite[3] ______ 716s 716s self = 716s 716s def test_append_with_append_dim_no_overwrite(self) -> None: 716s ds, ds_to_append, _ = create_append_test_data() 716s with self.create_zarr_target() as store_target: 716s ds.to_zarr(store_target, mode="w", **self.version_kwargs) 716s original = xr.concat([ds, ds_to_append], dim="time") 716s original2 = xr.concat([original, ds_to_append], dim="time") 716s 716s # overwrite a coordinate; 716s # for mode='a-', this will not get written to the store 716s # because it does not have the append_dim as a dim 716s lon = ds_to_append.lon.to_numpy().copy() 716s lon[:] = -999 716s ds_to_append["lon"] = lon 716s > ds_to_append.to_zarr( 716s store_target, mode="a-", append_dim="time", **self.version_kwargs 716s ) 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2922: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 716s return to_zarr( # type: ignore[call-overload,misc] 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 716s dump_to_store(dataset, zstore, writer, encoding=encoding) 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 716s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 716s k: self.open_store_variable(name=k) for k in existing_variable_names 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'da' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ________ TestZarrDirectoryStore.test_to_zarr_compute_false_roundtrip[3] ________ 716s 716s self = 716s 716s @requires_dask 716s def test_to_zarr_compute_false_roundtrip(self) -> None: 716s from dask.delayed import Delayed 716s 716s original = create_test_data().chunk() 716s 716s with self.create_zarr_target() as store: 716s delayed_obj = self.save(original, store, compute=False) 716s assert isinstance(delayed_obj, Delayed) 716s 716s # make sure target store has not been written to yet 716s with pytest.raises(AssertionError): 716s > with self.open(store) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2948: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'dim2' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ____ TestZarrDirectoryStore.test_to_zarr_append_compute_false_roundtrip[3] _____ 716s 716s self = 716s 716s @requires_dask 716s def test_to_zarr_append_compute_false_roundtrip(self) -> None: 716s from dask.delayed import Delayed 716s 716s ds, ds_to_append, _ = create_append_test_data() 716s ds, ds_to_append = ds.chunk(), ds_to_append.chunk() 716s 716s with pytest.warns(SerializationWarning): 716s with self.create_zarr_target() as store: 716s delayed_obj = self.save(ds, store, compute=False, mode="w") 716s assert isinstance(delayed_obj, Delayed) 716s 716s with pytest.raises(AssertionError): 716s > with self.open(store) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2969: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'da' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ______________ TestZarrDirectoryStore.test_save_emptydim[3-False] ______________ 716s 716s self = 716s chunk = False 716s 716s @pytest.mark.parametrize("chunk", [False, True]) 716s def test_save_emptydim(self, chunk) -> None: 716s if chunk and not has_dask: 716s pytest.skip("requires dask") 716s ds = Dataset({"x": (("a", "b"), np.empty((5, 0))), "y": ("a", [1, 2, 5, 8, 9])}) 716s if chunk: 716s ds = ds.chunk({}) # chunk dataset to save dask array 716s > with self.roundtrip(ds) as ds_reload: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3000: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'x' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ______________ TestZarrDirectoryStore.test_save_emptydim[3-True] _______________ 716s 716s self = 716s chunk = True 716s 716s @pytest.mark.parametrize("chunk", [False, True]) 716s def test_save_emptydim(self, chunk) -> None: 716s if chunk and not has_dask: 716s pytest.skip("requires dask") 716s ds = Dataset({"x": (("a", "b"), np.empty((5, 0))), "y": ("a", [1, 2, 5, 8, 9])}) 716s if chunk: 716s ds = ds.chunk({}) # chunk dataset to save dask array 716s > with self.roundtrip(ds) as ds_reload: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3000: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'x' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ___ TestZarrDirectoryStore.test_no_warning_from_open_emptydim_with_chunks[3] ___ 716s 716s self = 716s 716s @requires_dask 716s def test_no_warning_from_open_emptydim_with_chunks(self) -> None: 716s ds = Dataset({"x": (("a", "b"), np.empty((5, 0)))}).chunk({"a": 1}) 716s with assert_no_warnings(): 716s with warnings.catch_warnings(): 716s warnings.filterwarnings( 716s "ignore", 716s message=".*Zarr format 3 specification.*", 716s category=UserWarning, 716s ) 716s > with self.roundtrip(ds, open_kwargs=dict(chunks={"a": 1})) as ds_reload: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3013: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 716s with self.open(store_target, **open_kwargs) as ds: 716s /usr/lib/python3.14/contextlib.py:141: in __enter__ 716s return next(self.gen) 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 716s with xr.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'x' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _____ TestZarrDirectoryStore.test_write_region[3-False-False-False-False] ______ 716s 716s self = 716s consolidated = False, compute = False, use_dask = False, write_empty = False 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s @pytest.mark.parametrize("compute", [False, True]) 716s @pytest.mark.parametrize("use_dask", [False, True]) 716s @pytest.mark.parametrize("write_empty", [False, True, None]) 716s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 716s if (use_dask or not compute) and not has_dask: 716s pytest.skip("requires dask") 716s 716s zeros = Dataset({"u": (("x",), np.zeros(10))}) 716s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 716s 716s if use_dask: 716s zeros = zeros.chunk(2) 716s nonzeros = nonzeros.chunk(2) 716s 716s with self.create_zarr_target() as store: 716s zeros.to_zarr( 716s store, 716s consolidated=consolidated, 716s compute=compute, 716s encoding={"u": dict(chunks=2)}, 716s **self.version_kwargs, 716s ) 716s if compute: 716s with xr.open_zarr( 716s store, consolidated=consolidated, **self.version_kwargs 716s ) as actual: 716s assert_identical(actual, zeros) 716s for i in range(0, 10, 2): 716s region = {"x": slice(i, i + 2)} 716s > nonzeros.isel(region).to_zarr( 716s store, 716s region=region, 716s consolidated=consolidated, 716s write_empty_chunks=write_empty, 716s **self.version_kwargs, 716s ) 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 716s return to_zarr( # type: ignore[call-overload,misc] 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 716s dump_to_store(dataset, zstore, writer, encoding=encoding) 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 716s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 716s k: self.open_store_variable(name=k) for k in existing_variable_names 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ______ TestZarrDirectoryStore.test_write_region[3-False-False-False-True] ______ 716s 716s self = 716s consolidated = True, compute = False, use_dask = False, write_empty = False 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s @pytest.mark.parametrize("compute", [False, True]) 716s @pytest.mark.parametrize("use_dask", [False, True]) 716s @pytest.mark.parametrize("write_empty", [False, True, None]) 716s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 716s if (use_dask or not compute) and not has_dask: 716s pytest.skip("requires dask") 716s 716s zeros = Dataset({"u": (("x",), np.zeros(10))}) 716s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 716s 716s if use_dask: 716s zeros = zeros.chunk(2) 716s nonzeros = nonzeros.chunk(2) 716s 716s with self.create_zarr_target() as store: 716s zeros.to_zarr( 716s store, 716s consolidated=consolidated, 716s compute=compute, 716s encoding={"u": dict(chunks=2)}, 716s **self.version_kwargs, 716s ) 716s if compute: 716s with xr.open_zarr( 716s store, consolidated=consolidated, **self.version_kwargs 716s ) as actual: 716s assert_identical(actual, zeros) 716s for i in range(0, 10, 2): 716s region = {"x": slice(i, i + 2)} 716s > nonzeros.isel(region).to_zarr( 716s store, 716s region=region, 716s consolidated=consolidated, 716s write_empty_chunks=write_empty, 716s **self.version_kwargs, 716s ) 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 716s return to_zarr( # type: ignore[call-overload,misc] 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 716s dump_to_store(dataset, zstore, writer, encoding=encoding) 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 716s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 716s k: self.open_store_variable(name=k) for k in existing_variable_names 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ______ TestZarrDirectoryStore.test_write_region[3-False-False-False-None] ______ 716s 716s self = 716s consolidated = None, compute = False, use_dask = False, write_empty = False 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s @pytest.mark.parametrize("compute", [False, True]) 716s @pytest.mark.parametrize("use_dask", [False, True]) 716s @pytest.mark.parametrize("write_empty", [False, True, None]) 716s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 716s if (use_dask or not compute) and not has_dask: 716s pytest.skip("requires dask") 716s 716s zeros = Dataset({"u": (("x",), np.zeros(10))}) 716s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 716s 716s if use_dask: 716s zeros = zeros.chunk(2) 716s nonzeros = nonzeros.chunk(2) 716s 716s with self.create_zarr_target() as store: 716s zeros.to_zarr( 716s store, 716s consolidated=consolidated, 716s compute=compute, 716s encoding={"u": dict(chunks=2)}, 716s **self.version_kwargs, 716s ) 716s if compute: 716s with xr.open_zarr( 716s store, consolidated=consolidated, **self.version_kwargs 716s ) as actual: 716s assert_identical(actual, zeros) 716s for i in range(0, 10, 2): 716s region = {"x": slice(i, i + 2)} 716s > nonzeros.isel(region).to_zarr( 716s store, 716s region=region, 716s consolidated=consolidated, 716s write_empty_chunks=write_empty, 716s **self.version_kwargs, 716s ) 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 716s return to_zarr( # type: ignore[call-overload,misc] 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 716s dump_to_store(dataset, zstore, writer, encoding=encoding) 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 716s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 716s k: self.open_store_variable(name=k) for k in existing_variable_names 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ______ TestZarrDirectoryStore.test_write_region[3-False-False-True-False] ______ 716s 716s self = 716s consolidated = False, compute = True, use_dask = False, write_empty = False 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s @pytest.mark.parametrize("compute", [False, True]) 716s @pytest.mark.parametrize("use_dask", [False, True]) 716s @pytest.mark.parametrize("write_empty", [False, True, None]) 716s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 716s if (use_dask or not compute) and not has_dask: 716s pytest.skip("requires dask") 716s 716s zeros = Dataset({"u": (("x",), np.zeros(10))}) 716s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 716s 716s if use_dask: 716s zeros = zeros.chunk(2) 716s nonzeros = nonzeros.chunk(2) 716s 716s with self.create_zarr_target() as store: 716s zeros.to_zarr( 716s store, 716s consolidated=consolidated, 716s compute=compute, 716s encoding={"u": dict(chunks=2)}, 716s **self.version_kwargs, 716s ) 716s if compute: 716s > with xr.open_zarr( 716s store, consolidated=consolidated, **self.version_kwargs 716s ) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 716s ds = open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ______ TestZarrDirectoryStore.test_write_region[3-False-False-True-True] _______ 716s 716s self = 716s consolidated = True, compute = True, use_dask = False, write_empty = False 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s @pytest.mark.parametrize("compute", [False, True]) 716s @pytest.mark.parametrize("use_dask", [False, True]) 716s @pytest.mark.parametrize("write_empty", [False, True, None]) 716s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 716s if (use_dask or not compute) and not has_dask: 716s pytest.skip("requires dask") 716s 716s zeros = Dataset({"u": (("x",), np.zeros(10))}) 716s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 716s 716s if use_dask: 716s zeros = zeros.chunk(2) 716s nonzeros = nonzeros.chunk(2) 716s 716s with self.create_zarr_target() as store: 716s zeros.to_zarr( 716s store, 716s consolidated=consolidated, 716s compute=compute, 716s encoding={"u": dict(chunks=2)}, 716s **self.version_kwargs, 716s ) 716s if compute: 716s > with xr.open_zarr( 716s store, consolidated=consolidated, **self.version_kwargs 716s ) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 716s ds = open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ______ TestZarrDirectoryStore.test_write_region[3-False-False-True-None] _______ 716s 716s self = 716s consolidated = None, compute = True, use_dask = False, write_empty = False 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s @pytest.mark.parametrize("compute", [False, True]) 716s @pytest.mark.parametrize("use_dask", [False, True]) 716s @pytest.mark.parametrize("write_empty", [False, True, None]) 716s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 716s if (use_dask or not compute) and not has_dask: 716s pytest.skip("requires dask") 716s 716s zeros = Dataset({"u": (("x",), np.zeros(10))}) 716s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 716s 716s if use_dask: 716s zeros = zeros.chunk(2) 716s nonzeros = nonzeros.chunk(2) 716s 716s with self.create_zarr_target() as store: 716s zeros.to_zarr( 716s store, 716s consolidated=consolidated, 716s compute=compute, 716s encoding={"u": dict(chunks=2)}, 716s **self.version_kwargs, 716s ) 716s if compute: 716s > with xr.open_zarr( 716s store, consolidated=consolidated, **self.version_kwargs 716s ) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 716s ds = open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ______ TestZarrDirectoryStore.test_write_region[3-False-True-False-False] ______ 716s 716s self = 716s consolidated = False, compute = False, use_dask = True, write_empty = False 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s @pytest.mark.parametrize("compute", [False, True]) 716s @pytest.mark.parametrize("use_dask", [False, True]) 716s @pytest.mark.parametrize("write_empty", [False, True, None]) 716s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 716s if (use_dask or not compute) and not has_dask: 716s pytest.skip("requires dask") 716s 716s zeros = Dataset({"u": (("x",), np.zeros(10))}) 716s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 716s 716s if use_dask: 716s zeros = zeros.chunk(2) 716s nonzeros = nonzeros.chunk(2) 716s 716s with self.create_zarr_target() as store: 716s zeros.to_zarr( 716s store, 716s consolidated=consolidated, 716s compute=compute, 716s encoding={"u": dict(chunks=2)}, 716s **self.version_kwargs, 716s ) 716s if compute: 716s with xr.open_zarr( 716s store, consolidated=consolidated, **self.version_kwargs 716s ) as actual: 716s assert_identical(actual, zeros) 716s for i in range(0, 10, 2): 716s region = {"x": slice(i, i + 2)} 716s > nonzeros.isel(region).to_zarr( 716s store, 716s region=region, 716s consolidated=consolidated, 716s write_empty_chunks=write_empty, 716s **self.version_kwargs, 716s ) 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 716s return to_zarr( # type: ignore[call-overload,misc] 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 716s dump_to_store(dataset, zstore, writer, encoding=encoding) 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 716s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 716s k: self.open_store_variable(name=k) for k in existing_variable_names 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ______ TestZarrDirectoryStore.test_write_region[3-False-True-False-True] _______ 716s 716s self = 716s consolidated = True, compute = False, use_dask = True, write_empty = False 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s @pytest.mark.parametrize("compute", [False, True]) 716s @pytest.mark.parametrize("use_dask", [False, True]) 716s @pytest.mark.parametrize("write_empty", [False, True, None]) 716s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 716s if (use_dask or not compute) and not has_dask: 716s pytest.skip("requires dask") 716s 716s zeros = Dataset({"u": (("x",), np.zeros(10))}) 716s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 716s 716s if use_dask: 716s zeros = zeros.chunk(2) 716s nonzeros = nonzeros.chunk(2) 716s 716s with self.create_zarr_target() as store: 716s zeros.to_zarr( 716s store, 716s consolidated=consolidated, 716s compute=compute, 716s encoding={"u": dict(chunks=2)}, 716s **self.version_kwargs, 716s ) 716s if compute: 716s with xr.open_zarr( 716s store, consolidated=consolidated, **self.version_kwargs 716s ) as actual: 716s assert_identical(actual, zeros) 716s for i in range(0, 10, 2): 716s region = {"x": slice(i, i + 2)} 716s > nonzeros.isel(region).to_zarr( 716s store, 716s region=region, 716s consolidated=consolidated, 716s write_empty_chunks=write_empty, 716s **self.version_kwargs, 716s ) 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 716s return to_zarr( # type: ignore[call-overload,misc] 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 716s dump_to_store(dataset, zstore, writer, encoding=encoding) 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 716s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 716s k: self.open_store_variable(name=k) for k in existing_variable_names 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ______ TestZarrDirectoryStore.test_write_region[3-False-True-False-None] _______ 716s 716s self = 716s consolidated = None, compute = False, use_dask = True, write_empty = False 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s @pytest.mark.parametrize("compute", [False, True]) 716s @pytest.mark.parametrize("use_dask", [False, True]) 716s @pytest.mark.parametrize("write_empty", [False, True, None]) 716s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 716s if (use_dask or not compute) and not has_dask: 716s pytest.skip("requires dask") 716s 716s zeros = Dataset({"u": (("x",), np.zeros(10))}) 716s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 716s 716s if use_dask: 716s zeros = zeros.chunk(2) 716s nonzeros = nonzeros.chunk(2) 716s 716s with self.create_zarr_target() as store: 716s zeros.to_zarr( 716s store, 716s consolidated=consolidated, 716s compute=compute, 716s encoding={"u": dict(chunks=2)}, 716s **self.version_kwargs, 716s ) 716s if compute: 716s with xr.open_zarr( 716s store, consolidated=consolidated, **self.version_kwargs 716s ) as actual: 716s assert_identical(actual, zeros) 716s for i in range(0, 10, 2): 716s region = {"x": slice(i, i + 2)} 716s > nonzeros.isel(region).to_zarr( 716s store, 716s region=region, 716s consolidated=consolidated, 716s write_empty_chunks=write_empty, 716s **self.version_kwargs, 716s ) 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 716s return to_zarr( # type: ignore[call-overload,misc] 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 716s dump_to_store(dataset, zstore, writer, encoding=encoding) 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 716s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 716s k: self.open_store_variable(name=k) for k in existing_variable_names 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s ______ TestZarrDirectoryStore.test_write_region[3-False-True-True-False] _______ 716s 716s self = 716s consolidated = False, compute = True, use_dask = True, write_empty = False 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s @pytest.mark.parametrize("compute", [False, True]) 716s @pytest.mark.parametrize("use_dask", [False, True]) 716s @pytest.mark.parametrize("write_empty", [False, True, None]) 716s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 716s if (use_dask or not compute) and not has_dask: 716s pytest.skip("requires dask") 716s 716s zeros = Dataset({"u": (("x",), np.zeros(10))}) 716s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 716s 716s if use_dask: 716s zeros = zeros.chunk(2) 716s nonzeros = nonzeros.chunk(2) 716s 716s with self.create_zarr_target() as store: 716s zeros.to_zarr( 716s store, 716s consolidated=consolidated, 716s compute=compute, 716s encoding={"u": dict(chunks=2)}, 716s **self.version_kwargs, 716s ) 716s if compute: 716s > with xr.open_zarr( 716s store, consolidated=consolidated, **self.version_kwargs 716s ) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 716s ds = open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 716s ) 716s 716s if self._use_zarr_fill_value_as_mask: 716s # Setting this attribute triggers CF decoding for missing values 716s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 716s if zarr_array.fill_value is not None: 716s attributes["_FillValue"] = zarr_array.fill_value 716s elif "_FillValue" in attributes: 716s original_zarr_dtype = zarr_array.metadata.data_type 716s attributes["_FillValue"] = FillValueCoder.decode( 716s > attributes["_FillValue"], original_zarr_dtype.value 716s ) 716s E AttributeError: 'Float64' object has no attribute 'value' 716s 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 716s _______ TestZarrDirectoryStore.test_write_region[3-False-True-True-True] _______ 716s 716s self = 716s consolidated = True, compute = True, use_dask = True, write_empty = False 716s 716s @pytest.mark.parametrize("consolidated", [False, True, None]) 716s @pytest.mark.parametrize("compute", [False, True]) 716s @pytest.mark.parametrize("use_dask", [False, True]) 716s @pytest.mark.parametrize("write_empty", [False, True, None]) 716s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 716s if (use_dask or not compute) and not has_dask: 716s pytest.skip("requires dask") 716s 716s zeros = Dataset({"u": (("x",), np.zeros(10))}) 716s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 716s 716s if use_dask: 716s zeros = zeros.chunk(2) 716s nonzeros = nonzeros.chunk(2) 716s 716s with self.create_zarr_target() as store: 716s zeros.to_zarr( 716s store, 716s consolidated=consolidated, 716s compute=compute, 716s encoding={"u": dict(chunks=2)}, 716s **self.version_kwargs, 716s ) 716s if compute: 716s > with xr.open_zarr( 716s store, consolidated=consolidated, **self.version_kwargs 716s ) as actual: 716s 716s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 716s ds = open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 716s backend_ds = backend.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 716s ds = store_entrypoint.open_dataset( 716s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 716s vars, attrs = filename_or_obj.load() 716s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 716s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 716s return Frozen(dict(*args, **kwargs)) 716s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 716s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 716s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 716s 716s self = , name = 'u' 716s 716s def open_store_variable(self, name): 716s zarr_array = self.members[name] 716s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 716s try_nczarr = self._mode == "r" 716s dimensions, attributes = _get_zarr_dims_and_attrs( 716s zarr_array, DIMENSION_KEY, try_nczarr 716s ) 716s attributes = dict(attributes) 716s 716s encoding = { 716s "chunks": zarr_array.chunks, 716s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 716s } 716s 716s if _zarr_v3(): 716s encoding.update( 716s { 716s "compressors": zarr_array.compressors, 716s "filters": zarr_array.filters, 716s "shards": zarr_array.shards, 716s } 716s ) 716s if self.zarr_group.metadata.zarr_format == 3: 716s encoding.update({"serializer": zarr_array.serializer}) 716s else: 716s encoding.update( 716s { 716s "compressor": zarr_array.compressor, 716s "filters": zarr_array.filters, 716s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _______ TestZarrDirectoryStore.test_write_region[3-False-True-True-None] _______ 717s 717s self = 717s consolidated = None, compute = True, use_dask = True, write_empty = False 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s > with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 717s ds = open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ______ TestZarrDirectoryStore.test_write_region[3-True-False-False-False] ______ 717s 717s self = 717s consolidated = False, compute = False, use_dask = False, write_empty = True 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s assert_identical(actual, zeros) 717s for i in range(0, 10, 2): 717s region = {"x": slice(i, i + 2)} 717s > nonzeros.isel(region).to_zarr( 717s store, 717s region=region, 717s consolidated=consolidated, 717s write_empty_chunks=write_empty, 717s **self.version_kwargs, 717s ) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 717s return to_zarr( # type: ignore[call-overload,misc] 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 717s dump_to_store(dataset, zstore, writer, encoding=encoding) 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 717s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 717s k: self.open_store_variable(name=k) for k in existing_variable_names 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ______ TestZarrDirectoryStore.test_write_region[3-True-False-False-True] _______ 717s 717s self = 717s consolidated = True, compute = False, use_dask = False, write_empty = True 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s assert_identical(actual, zeros) 717s for i in range(0, 10, 2): 717s region = {"x": slice(i, i + 2)} 717s > nonzeros.isel(region).to_zarr( 717s store, 717s region=region, 717s consolidated=consolidated, 717s write_empty_chunks=write_empty, 717s **self.version_kwargs, 717s ) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 717s return to_zarr( # type: ignore[call-overload,misc] 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 717s dump_to_store(dataset, zstore, writer, encoding=encoding) 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 717s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 717s k: self.open_store_variable(name=k) for k in existing_variable_names 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ______ TestZarrDirectoryStore.test_write_region[3-True-False-False-None] _______ 717s 717s self = 717s consolidated = None, compute = False, use_dask = False, write_empty = True 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s assert_identical(actual, zeros) 717s for i in range(0, 10, 2): 717s region = {"x": slice(i, i + 2)} 717s > nonzeros.isel(region).to_zarr( 717s store, 717s region=region, 717s consolidated=consolidated, 717s write_empty_chunks=write_empty, 717s **self.version_kwargs, 717s ) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 717s return to_zarr( # type: ignore[call-overload,misc] 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 717s dump_to_store(dataset, zstore, writer, encoding=encoding) 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 717s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 717s k: self.open_store_variable(name=k) for k in existing_variable_names 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ______ TestZarrDirectoryStore.test_write_region[3-True-False-True-False] _______ 717s 717s self = 717s consolidated = False, compute = True, use_dask = False, write_empty = True 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s > with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 717s ds = open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _______ TestZarrDirectoryStore.test_write_region[3-True-False-True-True] _______ 717s 717s self = 717s consolidated = True, compute = True, use_dask = False, write_empty = True 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s > with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 717s ds = open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _______ TestZarrDirectoryStore.test_write_region[3-True-False-True-None] _______ 717s 717s self = 717s consolidated = None, compute = True, use_dask = False, write_empty = True 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s > with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 717s ds = open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ______ TestZarrDirectoryStore.test_write_region[3-True-True-False-False] _______ 717s 717s self = 717s consolidated = False, compute = False, use_dask = True, write_empty = True 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s assert_identical(actual, zeros) 717s for i in range(0, 10, 2): 717s region = {"x": slice(i, i + 2)} 717s > nonzeros.isel(region).to_zarr( 717s store, 717s region=region, 717s consolidated=consolidated, 717s write_empty_chunks=write_empty, 717s **self.version_kwargs, 717s ) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 717s return to_zarr( # type: ignore[call-overload,misc] 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 717s dump_to_store(dataset, zstore, writer, encoding=encoding) 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 717s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 717s k: self.open_store_variable(name=k) for k in existing_variable_names 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _______ TestZarrDirectoryStore.test_write_region[3-True-True-False-True] _______ 717s 717s self = 717s consolidated = True, compute = False, use_dask = True, write_empty = True 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s assert_identical(actual, zeros) 717s for i in range(0, 10, 2): 717s region = {"x": slice(i, i + 2)} 717s > nonzeros.isel(region).to_zarr( 717s store, 717s region=region, 717s consolidated=consolidated, 717s write_empty_chunks=write_empty, 717s **self.version_kwargs, 717s ) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 717s return to_zarr( # type: ignore[call-overload,misc] 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 717s dump_to_store(dataset, zstore, writer, encoding=encoding) 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 717s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 717s k: self.open_store_variable(name=k) for k in existing_variable_names 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _______ TestZarrDirectoryStore.test_write_region[3-True-True-False-None] _______ 717s 717s self = 717s consolidated = None, compute = False, use_dask = True, write_empty = True 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s assert_identical(actual, zeros) 717s for i in range(0, 10, 2): 717s region = {"x": slice(i, i + 2)} 717s > nonzeros.isel(region).to_zarr( 717s store, 717s region=region, 717s consolidated=consolidated, 717s write_empty_chunks=write_empty, 717s **self.version_kwargs, 717s ) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 717s return to_zarr( # type: ignore[call-overload,misc] 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 717s dump_to_store(dataset, zstore, writer, encoding=encoding) 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 717s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 717s k: self.open_store_variable(name=k) for k in existing_variable_names 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _______ TestZarrDirectoryStore.test_write_region[3-True-True-True-False] _______ 717s 717s self = 717s consolidated = False, compute = True, use_dask = True, write_empty = True 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s > with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 717s ds = open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _______ TestZarrDirectoryStore.test_write_region[3-True-True-True-True] ________ 717s 717s self = 717s consolidated = True, compute = True, use_dask = True, write_empty = True 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s > with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 717s ds = open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _______ TestZarrDirectoryStore.test_write_region[3-True-True-True-None] ________ 717s 717s self = 717s consolidated = None, compute = True, use_dask = True, write_empty = True 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s > with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 717s ds = open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ______ TestZarrDirectoryStore.test_write_region[3-None-False-False-False] ______ 717s 717s self = 717s consolidated = False, compute = False, use_dask = False, write_empty = None 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s assert_identical(actual, zeros) 717s for i in range(0, 10, 2): 717s region = {"x": slice(i, i + 2)} 717s > nonzeros.isel(region).to_zarr( 717s store, 717s region=region, 717s consolidated=consolidated, 717s write_empty_chunks=write_empty, 717s **self.version_kwargs, 717s ) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 717s return to_zarr( # type: ignore[call-overload,misc] 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 717s dump_to_store(dataset, zstore, writer, encoding=encoding) 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 717s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 717s k: self.open_store_variable(name=k) for k in existing_variable_names 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ______ TestZarrDirectoryStore.test_write_region[3-None-False-False-True] _______ 717s 717s self = 717s consolidated = True, compute = False, use_dask = False, write_empty = None 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s assert_identical(actual, zeros) 717s for i in range(0, 10, 2): 717s region = {"x": slice(i, i + 2)} 717s > nonzeros.isel(region).to_zarr( 717s store, 717s region=region, 717s consolidated=consolidated, 717s write_empty_chunks=write_empty, 717s **self.version_kwargs, 717s ) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 717s return to_zarr( # type: ignore[call-overload,misc] 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 717s dump_to_store(dataset, zstore, writer, encoding=encoding) 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 717s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 717s k: self.open_store_variable(name=k) for k in existing_variable_names 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ______ TestZarrDirectoryStore.test_write_region[3-None-False-False-None] _______ 717s 717s self = 717s consolidated = None, compute = False, use_dask = False, write_empty = None 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s assert_identical(actual, zeros) 717s for i in range(0, 10, 2): 717s region = {"x": slice(i, i + 2)} 717s > nonzeros.isel(region).to_zarr( 717s store, 717s region=region, 717s consolidated=consolidated, 717s write_empty_chunks=write_empty, 717s **self.version_kwargs, 717s ) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 717s return to_zarr( # type: ignore[call-overload,misc] 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 717s dump_to_store(dataset, zstore, writer, encoding=encoding) 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 717s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 717s k: self.open_store_variable(name=k) for k in existing_variable_names 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ______ TestZarrDirectoryStore.test_write_region[3-None-False-True-False] _______ 717s 717s self = 717s consolidated = False, compute = True, use_dask = False, write_empty = None 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s > with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 717s ds = open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _______ TestZarrDirectoryStore.test_write_region[3-None-False-True-True] _______ 717s 717s self = 717s consolidated = True, compute = True, use_dask = False, write_empty = None 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s > with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 717s ds = open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _______ TestZarrDirectoryStore.test_write_region[3-None-False-True-None] _______ 717s 717s self = 717s consolidated = None, compute = True, use_dask = False, write_empty = None 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s > with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 717s ds = open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ______ TestZarrDirectoryStore.test_write_region[3-None-True-False-False] _______ 717s 717s self = 717s consolidated = False, compute = False, use_dask = True, write_empty = None 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s assert_identical(actual, zeros) 717s for i in range(0, 10, 2): 717s region = {"x": slice(i, i + 2)} 717s > nonzeros.isel(region).to_zarr( 717s store, 717s region=region, 717s consolidated=consolidated, 717s write_empty_chunks=write_empty, 717s **self.version_kwargs, 717s ) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 717s return to_zarr( # type: ignore[call-overload,misc] 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 717s dump_to_store(dataset, zstore, writer, encoding=encoding) 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 717s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 717s k: self.open_store_variable(name=k) for k in existing_variable_names 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _______ TestZarrDirectoryStore.test_write_region[3-None-True-False-True] _______ 717s 717s self = 717s consolidated = True, compute = False, use_dask = True, write_empty = None 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s assert_identical(actual, zeros) 717s for i in range(0, 10, 2): 717s region = {"x": slice(i, i + 2)} 717s > nonzeros.isel(region).to_zarr( 717s store, 717s region=region, 717s consolidated=consolidated, 717s write_empty_chunks=write_empty, 717s **self.version_kwargs, 717s ) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 717s return to_zarr( # type: ignore[call-overload,misc] 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 717s dump_to_store(dataset, zstore, writer, encoding=encoding) 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 717s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 717s k: self.open_store_variable(name=k) for k in existing_variable_names 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _______ TestZarrDirectoryStore.test_write_region[3-None-True-False-None] _______ 717s 717s self = 717s consolidated = None, compute = False, use_dask = True, write_empty = None 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s assert_identical(actual, zeros) 717s for i in range(0, 10, 2): 717s region = {"x": slice(i, i + 2)} 717s > nonzeros.isel(region).to_zarr( 717s store, 717s region=region, 717s consolidated=consolidated, 717s write_empty_chunks=write_empty, 717s **self.version_kwargs, 717s ) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 717s return to_zarr( # type: ignore[call-overload,misc] 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 717s dump_to_store(dataset, zstore, writer, encoding=encoding) 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 717s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 717s k: self.open_store_variable(name=k) for k in existing_variable_names 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _______ TestZarrDirectoryStore.test_write_region[3-None-True-True-False] _______ 717s 717s self = 717s consolidated = False, compute = True, use_dask = True, write_empty = None 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s > with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 717s ds = open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _______ TestZarrDirectoryStore.test_write_region[3-None-True-True-True] ________ 717s 717s self = 717s consolidated = True, compute = True, use_dask = True, write_empty = None 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s > with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 717s ds = open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _______ TestZarrDirectoryStore.test_write_region[3-None-True-True-None] ________ 717s 717s self = 717s consolidated = None, compute = True, use_dask = True, write_empty = None 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s > with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 717s ds = open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ____________ TestZarrDirectoryStore.test_write_region_mode[3-None] _____________ 717s 717s self = 717s mode = None 717s 717s @pytest.mark.parametrize("mode", [None, "r+", "a"]) 717s def test_write_region_mode(self, mode) -> None: 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s with self.create_zarr_target() as store: 717s zeros.to_zarr(store, **self.version_kwargs) 717s for region in [{"x": slice(5)}, {"x": slice(5, 10)}]: 717s > nonzeros.isel(region).to_zarr( 717s store, region=region, mode=mode, **self.version_kwargs 717s ) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3065: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 717s return to_zarr( # type: ignore[call-overload,misc] 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 717s dump_to_store(dataset, zstore, writer, encoding=encoding) 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 717s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 717s k: self.open_store_variable(name=k) for k in existing_variable_names 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _____________ TestZarrDirectoryStore.test_write_region_mode[3-r+] ______________ 717s 717s self = 717s mode = 'r+' 717s 717s @pytest.mark.parametrize("mode", [None, "r+", "a"]) 717s def test_write_region_mode(self, mode) -> None: 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s with self.create_zarr_target() as store: 717s zeros.to_zarr(store, **self.version_kwargs) 717s for region in [{"x": slice(5)}, {"x": slice(5, 10)}]: 717s > nonzeros.isel(region).to_zarr( 717s store, region=region, mode=mode, **self.version_kwargs 717s ) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3065: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 717s return to_zarr( # type: ignore[call-overload,misc] 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 717s dump_to_store(dataset, zstore, writer, encoding=encoding) 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 717s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 717s k: self.open_store_variable(name=k) for k in existing_variable_names 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ______________ TestZarrDirectoryStore.test_write_region_mode[3-a] ______________ 717s 717s self = 717s mode = 'a' 717s 717s @pytest.mark.parametrize("mode", [None, "r+", "a"]) 717s def test_write_region_mode(self, mode) -> None: 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s with self.create_zarr_target() as store: 717s zeros.to_zarr(store, **self.version_kwargs) 717s for region in [{"x": slice(5)}, {"x": slice(5, 10)}]: 717s > nonzeros.isel(region).to_zarr( 717s store, region=region, mode=mode, **self.version_kwargs 717s ) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3065: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 717s return to_zarr( # type: ignore[call-overload,misc] 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 717s dump_to_store(dataset, zstore, writer, encoding=encoding) 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 717s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 717s k: self.open_store_variable(name=k) for k in existing_variable_names 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ______ TestZarrDirectoryStore.test_write_preexisting_override_metadata[3] ______ 717s 717s self = 717s 717s @requires_dask 717s def test_write_preexisting_override_metadata(self) -> None: 717s """Metadata should be overridden if mode="a" but not in mode="r+".""" 717s original = Dataset( 717s {"u": (("x",), np.zeros(10), {"variable": "original"})}, 717s attrs={"global": "original"}, 717s ) 717s both_modified = Dataset( 717s {"u": (("x",), np.ones(10), {"variable": "modified"})}, 717s attrs={"global": "modified"}, 717s ) 717s global_modified = Dataset( 717s {"u": (("x",), np.ones(10), {"variable": "original"})}, 717s attrs={"global": "modified"}, 717s ) 717s only_new_data = Dataset( 717s {"u": (("x",), np.ones(10), {"variable": "original"})}, 717s attrs={"global": "original"}, 717s ) 717s 717s with self.create_zarr_target() as store: 717s original.to_zarr(store, compute=False, **self.version_kwargs) 717s > both_modified.to_zarr(store, mode="a", **self.version_kwargs) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3093: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 717s return to_zarr( # type: ignore[call-overload,misc] 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 717s dump_to_store(dataset, zstore, writer, encoding=encoding) 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 717s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 717s k: self.open_store_variable(name=k) for k in existing_variable_names 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ______________ TestZarrDirectoryStore.test_encoding_chunksizes[3] ______________ 717s 717s self = 717s 717s @requires_dask 717s def test_encoding_chunksizes(self) -> None: 717s # regression test for GH2278 717s # see also test_encoding_chunksizes_unlimited 717s nx, ny, nt = 4, 4, 5 717s original = xr.Dataset( 717s {}, 717s coords={ 717s "x": np.arange(nx), 717s "y": np.arange(ny), 717s "t": np.arange(nt), 717s }, 717s ) 717s original["v"] = xr.Variable(("x", "y", "t"), np.zeros((nx, ny, nt))) 717s original = original.chunk({"t": 1, "x": 2, "y": 2}) 717s 717s > with self.roundtrip(original) as ds1: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3207: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'v' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ____ TestZarrDirectoryStore.test_chunk_encoding_with_partial_dask_chunks[3] ____ 717s 717s self = 717s 717s @requires_dask 717s def test_chunk_encoding_with_partial_dask_chunks(self) -> None: 717s original = xr.Dataset( 717s {"x": xr.DataArray(np.random.random(size=(6, 8)), dims=("a", "b"))} 717s ).chunk({"a": 3}) 717s 717s > with self.roundtrip( 717s original, save_kwargs={"encoding": {"x": {"chunks": [3, 2]}}} 717s ) as ds1: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3218: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'x' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _____________ TestZarrDirectoryStore.test_open_zarr_use_cftime[3] ______________ 717s 717s self = 717s 717s @requires_cftime 717s def test_open_zarr_use_cftime(self) -> None: 717s ds = create_test_data() 717s with self.create_zarr_target() as store_target: 717s ds.to_zarr(store_target, **self.version_kwargs) 717s > ds_a = xr.open_zarr(store_target, **self.version_kwargs) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3237: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 717s ds = open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'dim2' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ____________ TestZarrDirectoryStore.test_write_read_select_write[3] ____________ 717s 717s self = 717s 717s def test_write_read_select_write(self) -> None: 717s # Test for https://github.com/pydata/xarray/issues/4084 717s ds = create_test_data() 717s 717s # NOTE: using self.roundtrip, which uses open_dataset, will not trigger the bug. 717s with self.create_zarr_target() as initial_store: 717s ds.to_zarr(initial_store, mode="w", **self.version_kwargs) 717s > ds1 = xr.open_zarr(initial_store, **self.version_kwargs) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3252: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 717s ds = open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'dim2' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ________________ TestZarrDirectoryStore.test_attributes[3-obj1] ________________ 717s 717s self = 717s obj = Size: 8B 717s array(nan) 717s Attributes: 717s good: {'key': 'value'} 717s 717s @pytest.mark.parametrize("obj", [Dataset(), DataArray(name="foo")]) 717s def test_attributes(self, obj) -> None: 717s obj = obj.copy() 717s 717s obj.attrs["good"] = {"key": "value"} 717s ds = obj if isinstance(obj, Dataset) else obj.to_dataset() 717s with self.create_zarr_target() as store_target: 717s ds.to_zarr(store_target, **self.version_kwargs) 717s > assert_identical(ds, xr.open_zarr(store_target, **self.version_kwargs)) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3267: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 717s ds = open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'foo' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _ TestZarrDirectoryStore.test_chunked_datetime64_or_timedelta64[3-datetime64[ns]] _ 717s 717s self = 717s dtype = 'datetime64[ns]' 717s 717s @requires_dask 717s @pytest.mark.parametrize("dtype", ["datetime64[ns]", "timedelta64[ns]"]) 717s def test_chunked_datetime64_or_timedelta64(self, dtype) -> None: 717s # Generalized from @malmans2's test in PR #8253 717s original = create_test_data().astype(dtype).chunk(1) 717s > with self.roundtrip( 717s original, 717s open_kwargs={ 717s "chunks": {}, 717s "decode_timedelta": CFTimedeltaCoder(time_unit="ns"), 717s }, 717s ) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3280: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'dim2' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _ TestZarrDirectoryStore.test_chunked_datetime64_or_timedelta64[3-timedelta64[ns]] _ 717s 717s self = 717s dtype = 'timedelta64[ns]' 717s 717s @requires_dask 717s @pytest.mark.parametrize("dtype", ["datetime64[ns]", "timedelta64[ns]"]) 717s def test_chunked_datetime64_or_timedelta64(self, dtype) -> None: 717s # Generalized from @malmans2's test in PR #8253 717s original = create_test_data().astype(dtype).chunk(1) 717s > with self.roundtrip( 717s original, 717s open_kwargs={ 717s "chunks": {}, 717s "decode_timedelta": CFTimedeltaCoder(time_unit="ns"), 717s }, 717s ) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3280: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'dim2' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _________ TestZarrDirectoryStore.test_zarr_fill_value_setting[3-float] _________ 717s 717s self = 717s dtype = 717s 717s @requires_dask 717s @pytest.mark.parametrize("dtype", [int, float]) 717s def test_zarr_fill_value_setting(self, dtype): 717s # When zarr_format=2, _FillValue sets fill_value 717s # When zarr_format=3, fill_value is set independently 717s # We test this by writing a dask array with compute=False, 717s # on read we should receive chunks filled with `fill_value` 717s fv = -1 717s ds = xr.Dataset( 717s {"foo": ("x", dask.array.from_array(np.array([0, 0, 0], dtype=dtype)))} 717s ) 717s expected = xr.Dataset({"foo": ("x", [fv] * 3)}) 717s 717s zarr_format_2 = ( 717s has_zarr_v3 and zarr.config.get("default_zarr_format") == 2 717s ) or not has_zarr_v3 717s if zarr_format_2: 717s attr = "_FillValue" 717s expected.foo.attrs[attr] = fv 717s else: 717s attr = "fill_value" 717s if dtype is float: 717s # for floats, Xarray inserts a default `np.nan` 717s expected.foo.attrs["_FillValue"] = np.nan 717s 717s # turn off all decoding so we see what Zarr returns to us. 717s # Since chunks, are not written, we should receive on `fill_value` 717s open_kwargs = { 717s "mask_and_scale": False, 717s "consolidated": False, 717s "use_zarr_fill_value_as_mask": False, 717s } 717s save_kwargs = dict(compute=False, consolidated=False) 717s > with self.roundtrip( 717s ds, 717s save_kwargs=ChainMap(save_kwargs, dict(encoding={"foo": {attr: fv}})), 717s open_kwargs=open_kwargs, 717s ) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3374: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'foo' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _____________ TestZarrWriteEmpty.test_zero_dimensional_variable[3] _____________ 717s 717s self = 717s 717s def test_zero_dimensional_variable(self) -> None: 717s expected = create_test_data() 717s expected["float_var"] = ([], 1.0e9, {"units": "units of awesome"}) 717s expected["bytes_var"] = ([], b"foobar") 717s expected["string_var"] = ([], "foobar") 717s > with self.roundtrip(expected) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:408: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'dim2' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ____________________ TestZarrWriteEmpty.test_write_store[3] ____________________ 717s 717s self = 717s 717s def test_write_store(self) -> None: 717s expected = create_test_data() 717s with self.create_store() as store: 717s expected.dump_to_store(store) 717s # we need to cf decode the store because it has time and 717s # non-dimension coordinates 717s > with xr.decode_cf(store) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:417: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/conventions.py:570: in decode_cf 717s vars, attrs = obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'dim2' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ________________ TestZarrWriteEmpty.test_roundtrip_test_data[3] ________________ 717s 717s self = 717s 717s def test_roundtrip_test_data(self) -> None: 717s expected = create_test_data() 717s > with self.roundtrip(expected) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:441: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'dim2' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _______________________ TestZarrWriteEmpty.test_load[3] ________________________ 717s 717s self = 717s 717s def test_load(self) -> None: 717s expected = create_test_data() 717s 717s @contextlib.contextmanager 717s def assert_loads(vars=None): 717s if vars is None: 717s vars = expected 717s with self.roundtrip(expected) as actual: 717s for k, v in actual.variables.items(): 717s # IndexVariables are eagerly loaded into memory 717s assert v._in_memory == (k in actual.dims) 717s yield actual 717s for k, v in actual.variables.items(): 717s if k in vars: 717s assert v._in_memory 717s assert_identical(expected, actual) 717s 717s with pytest.raises(AssertionError): 717s # make sure the contextmanager works! 717s > with assert_loads() as ds: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:464: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:452: in assert_loads 717s with self.roundtrip(expected) as actual: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'dim2' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s __________________ TestZarrWriteEmpty.test_dataset_compute[3] __________________ 717s 717s self = 717s 717s def test_dataset_compute(self) -> None: 717s expected = create_test_data() 717s 717s > with self.roundtrip(expected) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:481: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'dim2' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ______________ TestZarrWriteEmpty.test_roundtrip_object_dtype[3] _______________ 717s 717s self = 717s 717s def test_roundtrip_object_dtype(self) -> None: 717s floats = np.array([0.0, 0.0, 1.0, 2.0, 3.0], dtype=object) 717s floats_nans = np.array([np.nan, np.nan, 1.0, 2.0, 3.0], dtype=object) 717s bytes_ = np.array([b"ab", b"cdef", b"g"], dtype=object) 717s bytes_nans = np.array([b"ab", b"cdef", np.nan], dtype=object) 717s strings = np.array(["ab", "cdef", "g"], dtype=object) 717s strings_nans = np.array(["ab", "cdef", np.nan], dtype=object) 717s all_nans = np.array([np.nan, np.nan], dtype=object) 717s original = Dataset( 717s { 717s "floats": ("a", floats), 717s "floats_nans": ("a", floats_nans), 717s "bytes": ("b", bytes_), 717s "bytes_nans": ("b", bytes_nans), 717s "strings": ("b", strings), 717s "strings_nans": ("b", strings_nans), 717s "all_nans": ("c", all_nans), 717s "nan": ([], np.nan), 717s } 717s ) 717s expected = original.copy(deep=True) 717s > with self.roundtrip(original) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:558: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'nan' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ______________ TestZarrWriteEmpty.test_roundtrip_float64_data[3] _______________ 717s 717s self = 717s 717s def test_roundtrip_float64_data(self) -> None: 717s expected = Dataset({"x": ("y", np.array([1.0, 2.0, np.pi], dtype="float64"))}) 717s > with self.roundtrip(expected) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:646: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'x' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ________________ TestZarrWriteEmpty.test_orthogonal_indexing[3] ________________ 717s 717s self = 717s 717s def test_orthogonal_indexing(self) -> None: 717s in_memory = create_test_data() 717s > with self.roundtrip(in_memory) as on_disk: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:713: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'dim2' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ________________ TestZarrWriteEmpty.test_vectorized_indexing[3] ________________ 717s 717s self = 717s 717s def test_vectorized_indexing(self) -> None: 717s in_memory = create_test_data() 717s > with self.roundtrip(in_memory) as on_disk: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:727: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'dim2' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _________ TestZarrWriteEmpty.test_vectorized_indexing_negative_step[3] _________ 717s 717s self = 717s 717s def test_vectorized_indexing_negative_step(self) -> None: 717s # use dask explicitly when present 717s open_kwargs: dict[str, Any] | None 717s if has_dask: 717s open_kwargs = {"chunks": {}} 717s else: 717s open_kwargs = None 717s in_memory = create_test_data() 717s 717s def multiple_indexing(indexers): 717s # make sure a sequence of lazy indexings certainly works. 717s with self.roundtrip(in_memory, open_kwargs=open_kwargs) as on_disk: 717s actual = on_disk["var3"] 717s expected = in_memory["var3"] 717s for ind in indexers: 717s actual = actual.isel(ind) 717s expected = expected.isel(ind) 717s # make sure the array is not yet loaded into memory 717s assert not actual.variable._in_memory 717s assert_identical(expected, actual.load()) 717s 717s # with negative step slice. 717s indexers = [ 717s { 717s "dim1": DataArray([[0, 7], [2, 6], [3, 5]], dims=["a", "b"]), 717s "dim3": slice(-1, 1, -1), 717s } 717s ] 717s > multiple_indexing(indexers) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:817: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:800: in multiple_indexing 717s with self.roundtrip(in_memory, open_kwargs=open_kwargs) as on_disk: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'dim2' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ______________ TestZarrWriteEmpty.test_outer_indexing_reversed[3] ______________ 717s 717s self = 717s 717s def test_outer_indexing_reversed(self) -> None: 717s # regression test for GH6560 717s ds = xr.Dataset( 717s {"z": (("t", "p", "y", "x"), np.ones((1, 1, 31, 40)))}, 717s ) 717s 717s > with self.roundtrip(ds) as on_disk: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:834: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'z' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s __________________ TestZarrWriteEmpty.test_isel_dataarray[3] ___________________ 717s 717s self = 717s 717s def test_isel_dataarray(self) -> None: 717s # Make sure isel works lazily. GH:issue:1688 717s in_memory = create_test_data() 717s > with self.roundtrip(in_memory) as on_disk: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:841: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'dim2' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _____________ TestZarrWriteEmpty.test_array_type_after_indexing[3] _____________ 717s 717s self = 717s 717s def test_array_type_after_indexing(self) -> None: 717s in_memory = create_test_data() 717s > with self.roundtrip(in_memory) as on_disk: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:868: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'dim2' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ______________________ TestZarrWriteEmpty.test_dropna[3] _______________________ 717s 717s self = 717s 717s def test_dropna(self) -> None: 717s # regression test for GH:issue:1694 717s a = np.random.randn(4, 3) 717s a[1, 1] = np.nan 717s in_memory = xr.Dataset( 717s {"a": (("y", "x"), a)}, coords={"y": np.arange(4), "x": np.arange(3)} 717s ) 717s 717s assert_identical( 717s in_memory.dropna(dim="x"), in_memory.isel(x=slice(None, None, 2)) 717s ) 717s 717s > with self.roundtrip(in_memory) as on_disk: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:893: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'a' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ________________ TestZarrWriteEmpty.test_ondisk_after_print[3] _________________ 717s 717s self = 717s 717s def test_ondisk_after_print(self) -> None: 717s """Make sure print does not load file into memory""" 717s in_memory = create_test_data() 717s > with self.roundtrip(in_memory) as on_disk: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:902: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'dim2' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s __________ TestZarrWriteEmpty.test_roundtrip_bytes_with_fill_value[3] __________ 717s 717s self = 717s 717s def test_roundtrip_bytes_with_fill_value(self) -> None: 717s values = np.array([b"ab", b"cdef", np.nan], dtype=object) 717s encoding = {"_FillValue": b"X", "dtype": "S1"} 717s original = Dataset({"x": ("t", values, {}, encoding)}) 717s expected = original.copy(deep=True) 717s > with self.roundtrip(original) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:913: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'x' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'NullTerminatedBytes' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _______ TestZarrWriteEmpty.test_roundtrip_unsigned[3-fill_value0-False] ________ 717s 717s self = 717s fill_value = np.int8(-1), exp_fill_warning = False 717s 717s @pytest.mark.parametrize( 717s ("fill_value", "exp_fill_warning"), 717s [ 717s (np.int8(-1), False), 717s (np.uint8(255), True), 717s (-1, False), 717s (255, True), 717s ], 717s ) 717s def test_roundtrip_unsigned(self, fill_value, exp_fill_warning): 717s @contextlib.contextmanager 717s def _roundtrip_with_warnings(*args, **kwargs): 717s is_np2 = module_available("numpy", minversion="2.0.0.dev0") 717s if exp_fill_warning and is_np2: 717s warn_checker: contextlib.AbstractContextManager = pytest.warns( 717s SerializationWarning, 717s match="_FillValue attribute can't be represented", 717s ) 717s else: 717s warn_checker = contextlib.nullcontext() 717s with warn_checker: 717s with self.roundtrip(*args, **kwargs) as actual: 717s yield actual 717s 717s # regression/numpy2 test for 717s encoding = { 717s "_FillValue": fill_value, 717s "_Unsigned": "true", 717s "dtype": "i1", 717s } 717s x = np.array([0, 1, 127, 128, 254, np.nan], dtype=np.float32) 717s decoded = Dataset({"x": ("t", x, {}, encoding)}) 717s 717s attributes = { 717s "_FillValue": fill_value, 717s "_Unsigned": "true", 717s } 717s # Create unsigned data corresponding to [0, 1, 127, 128, 255] unsigned 717s sb = np.asarray([0, 1, 127, -128, -2, -1], dtype="i1") 717s encoded = Dataset({"x": ("t", sb, attributes)}) 717s unsigned_dtype = np.dtype(f"u{sb.dtype.itemsize}") 717s 717s > with _roundtrip_with_warnings(decoded) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1066: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1045: in _roundtrip_with_warnings 717s with self.roundtrip(*args, **kwargs) as actual: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'x' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Int8' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ________ TestZarrWriteEmpty.test_roundtrip_unsigned[3-fill_value1-True] ________ 717s 717s self = 717s fill_value = np.uint8(255), exp_fill_warning = True 717s 717s @pytest.mark.parametrize( 717s ("fill_value", "exp_fill_warning"), 717s [ 717s (np.int8(-1), False), 717s (np.uint8(255), True), 717s (-1, False), 717s (255, True), 717s ], 717s ) 717s def test_roundtrip_unsigned(self, fill_value, exp_fill_warning): 717s @contextlib.contextmanager 717s def _roundtrip_with_warnings(*args, **kwargs): 717s is_np2 = module_available("numpy", minversion="2.0.0.dev0") 717s if exp_fill_warning and is_np2: 717s warn_checker: contextlib.AbstractContextManager = pytest.warns( 717s SerializationWarning, 717s match="_FillValue attribute can't be represented", 717s ) 717s else: 717s warn_checker = contextlib.nullcontext() 717s with warn_checker: 717s with self.roundtrip(*args, **kwargs) as actual: 717s yield actual 717s 717s # regression/numpy2 test for 717s encoding = { 717s "_FillValue": fill_value, 717s "_Unsigned": "true", 717s "dtype": "i1", 717s } 717s x = np.array([0, 1, 127, 128, 254, np.nan], dtype=np.float32) 717s decoded = Dataset({"x": ("t", x, {}, encoding)}) 717s 717s attributes = { 717s "_FillValue": fill_value, 717s "_Unsigned": "true", 717s } 717s # Create unsigned data corresponding to [0, 1, 127, 128, 255] unsigned 717s sb = np.asarray([0, 1, 127, -128, -2, -1], dtype="i1") 717s encoded = Dataset({"x": ("t", sb, attributes)}) 717s unsigned_dtype = np.dtype(f"u{sb.dtype.itemsize}") 717s 717s > with _roundtrip_with_warnings(decoded) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1066: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1045: in _roundtrip_with_warnings 717s with self.roundtrip(*args, **kwargs) as actual: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'x' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Int8' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ____________ TestZarrWriteEmpty.test_roundtrip_unsigned[3--1-False] ____________ 717s 717s self = 717s fill_value = -1, exp_fill_warning = False 717s 717s @pytest.mark.parametrize( 717s ("fill_value", "exp_fill_warning"), 717s [ 717s (np.int8(-1), False), 717s (np.uint8(255), True), 717s (-1, False), 717s (255, True), 717s ], 717s ) 717s def test_roundtrip_unsigned(self, fill_value, exp_fill_warning): 717s @contextlib.contextmanager 717s def _roundtrip_with_warnings(*args, **kwargs): 717s is_np2 = module_available("numpy", minversion="2.0.0.dev0") 717s if exp_fill_warning and is_np2: 717s warn_checker: contextlib.AbstractContextManager = pytest.warns( 717s SerializationWarning, 717s match="_FillValue attribute can't be represented", 717s ) 717s else: 717s warn_checker = contextlib.nullcontext() 717s with warn_checker: 717s with self.roundtrip(*args, **kwargs) as actual: 717s yield actual 717s 717s # regression/numpy2 test for 717s encoding = { 717s "_FillValue": fill_value, 717s "_Unsigned": "true", 717s "dtype": "i1", 717s } 717s x = np.array([0, 1, 127, 128, 254, np.nan], dtype=np.float32) 717s decoded = Dataset({"x": ("t", x, {}, encoding)}) 717s 717s attributes = { 717s "_FillValue": fill_value, 717s "_Unsigned": "true", 717s } 717s # Create unsigned data corresponding to [0, 1, 127, 128, 255] unsigned 717s sb = np.asarray([0, 1, 127, -128, -2, -1], dtype="i1") 717s encoded = Dataset({"x": ("t", sb, attributes)}) 717s unsigned_dtype = np.dtype(f"u{sb.dtype.itemsize}") 717s 717s > with _roundtrip_with_warnings(decoded) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1066: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1045: in _roundtrip_with_warnings 717s with self.roundtrip(*args, **kwargs) as actual: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'x' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Int8' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ____________ TestZarrWriteEmpty.test_roundtrip_unsigned[3-255-True] ____________ 717s 717s self = 717s fill_value = 255, exp_fill_warning = True 717s 717s @pytest.mark.parametrize( 717s ("fill_value", "exp_fill_warning"), 717s [ 717s (np.int8(-1), False), 717s (np.uint8(255), True), 717s (-1, False), 717s (255, True), 717s ], 717s ) 717s def test_roundtrip_unsigned(self, fill_value, exp_fill_warning): 717s @contextlib.contextmanager 717s def _roundtrip_with_warnings(*args, **kwargs): 717s is_np2 = module_available("numpy", minversion="2.0.0.dev0") 717s if exp_fill_warning and is_np2: 717s warn_checker: contextlib.AbstractContextManager = pytest.warns( 717s SerializationWarning, 717s match="_FillValue attribute can't be represented", 717s ) 717s else: 717s warn_checker = contextlib.nullcontext() 717s with warn_checker: 717s with self.roundtrip(*args, **kwargs) as actual: 717s yield actual 717s 717s # regression/numpy2 test for 717s encoding = { 717s "_FillValue": fill_value, 717s "_Unsigned": "true", 717s "dtype": "i1", 717s } 717s x = np.array([0, 1, 127, 128, 254, np.nan], dtype=np.float32) 717s decoded = Dataset({"x": ("t", x, {}, encoding)}) 717s 717s attributes = { 717s "_FillValue": fill_value, 717s "_Unsigned": "true", 717s } 717s # Create unsigned data corresponding to [0, 1, 127, 128, 255] unsigned 717s sb = np.asarray([0, 1, 127, -128, -2, -1], dtype="i1") 717s encoded = Dataset({"x": ("t", sb, attributes)}) 717s unsigned_dtype = np.dtype(f"u{sb.dtype.itemsize}") 717s 717s > with _roundtrip_with_warnings(decoded) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1066: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1045: in _roundtrip_with_warnings 717s with self.roundtrip(*args, **kwargs) as actual: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'x' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Int8' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _ TestZarrWriteEmpty.test_grid_mapping_and_bounds_are_not_coordinates_in_file[3] _ 717s 717s self = 717s 717s def test_grid_mapping_and_bounds_are_not_coordinates_in_file(self) -> None: 717s original = self._create_cf_dataset() 717s > with self.roundtrip(original, open_kwargs={"decode_coords": False}) as ds: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1142: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = 717s name = 'det_lim' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ___ TestZarrWriteEmpty.test_coordinate_variables_after_dataset_roundtrip[3] ____ 717s 717s self = 717s 717s def test_coordinate_variables_after_dataset_roundtrip(self) -> None: 717s original = self._create_cf_dataset() 717s > with self.roundtrip(original, open_kwargs={"decode_coords": "all"}) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1150: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = 717s name = 'det_lim' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _ TestZarrWriteEmpty.test_grid_mapping_and_bounds_are_coordinates_after_dataarray_roundtrip[3] _ 717s 717s self = 717s 717s def test_grid_mapping_and_bounds_are_coordinates_after_dataarray_roundtrip( 717s self, 717s ) -> None: 717s original = self._create_cf_dataset() 717s # The DataArray roundtrip should have the same warnings as the 717s # Dataset, but we already tested for those, so just go for the 717s # new warnings. It would appear that there is no way to tell 717s # pytest "This warning and also this warning should both be 717s # present". 717s # xarray/tests/test_conventions.py::TestCFEncodedDataStore 717s # needs the to_dataset. The other backends should be fine 717s # without it. 717s with pytest.warns( 717s UserWarning, 717s match=( 717s r"Variable\(s\) referenced in bounds not in variables: " 717s r"\['l(at|ong)itude_bnds'\]" 717s ), 717s ): 717s > with self.roundtrip( 717s original["variable"].to_dataset(), open_kwargs={"decode_coords": "all"} 717s ) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1182: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'ln_p' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s 717s During handling of the above exception, another exception occurred: 717s 717s self = 717s 717s def test_grid_mapping_and_bounds_are_coordinates_after_dataarray_roundtrip( 717s self, 717s ) -> None: 717s original = self._create_cf_dataset() 717s # The DataArray roundtrip should have the same warnings as the 717s # Dataset, but we already tested for those, so just go for the 717s # new warnings. It would appear that there is no way to tell 717s # pytest "This warning and also this warning should both be 717s # present". 717s # xarray/tests/test_conventions.py::TestCFEncodedDataStore 717s # needs the to_dataset. The other backends should be fine 717s # without it. 717s > with pytest.warns( 717s UserWarning, 717s match=( 717s r"Variable\(s\) referenced in bounds not in variables: " 717s r"\['l(at|ong)itude_bnds'\]" 717s ), 717s ): 717s E Failed: DID NOT WARN. No warnings of type (,) matching the regex were emitted. 717s E Regex: Variable\(s\) referenced in bounds not in variables: \['l(at|ong)itude_bnds'\] 717s E Emitted warnings: [ ZarrUserWarning('Consolidated metadata is currently not part in the Zarr format 3 specification. It may not be supported by other zarr implementations and may change in the future.')]. 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1175: Failed 717s __________________ TestZarrWriteEmpty.test_encoding_kwarg[3] ___________________ 717s 717s self = 717s 717s def test_encoding_kwarg(self) -> None: 717s ds = Dataset({"x": ("y", np.arange(10.0))}) 717s 717s kwargs: dict[str, Any] = dict(encoding={"x": {"dtype": "f4"}}) 717s > with self.roundtrip(ds, save_kwargs=kwargs) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1277: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'x' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float32' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ________________ TestZarrWriteEmpty.test_default_fill_value[3] _________________ 717s 717s self = 717s 717s def test_default_fill_value(self) -> None: 717s # Test default encoding for float: 717s ds = Dataset({"x": ("y", np.arange(10.0))}) 717s kwargs = dict(encoding={"x": {"dtype": "f4"}}) 717s > with self.roundtrip(ds, save_kwargs=kwargs) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1319: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'x' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float32' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ________ TestZarrWriteEmpty.test_explicitly_omit_fill_value_in_coord[3] ________ 717s 717s self = 717s 717s def test_explicitly_omit_fill_value_in_coord(self) -> None: 717s ds = Dataset({"x": ("y", [np.pi, -np.pi])}, coords={"y": [0.0, 1.0]}) 717s ds.y.encoding["_FillValue"] = None 717s > with self.roundtrip(ds) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1355: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'x' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _ TestZarrWriteEmpty.test_explicitly_omit_fill_value_in_coord_via_encoding_kwarg[3] _ 717s 717s self = 717s 717s def test_explicitly_omit_fill_value_in_coord_via_encoding_kwarg(self) -> None: 717s ds = Dataset({"x": ("y", [np.pi, -np.pi])}, coords={"y": [0.0, 1.0]}) 717s kwargs = dict(encoding={"y": {"_FillValue": None}}) 717s > with self.roundtrip(ds, save_kwargs=kwargs) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1361: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'x' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ________________ TestZarrWriteEmpty.test_encoding_same_dtype[3] ________________ 717s 717s self = 717s 717s def test_encoding_same_dtype(self) -> None: 717s ds = Dataset({"x": ("y", np.arange(10.0, dtype="f4"))}) 717s kwargs = dict(encoding={"x": {"dtype": "f4"}}) 717s > with self.roundtrip(ds, save_kwargs=kwargs) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1368: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'x' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float32' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ______________ TestZarrWriteEmpty.test_append_overwrite_values[3] ______________ 717s 717s self = 717s 717s def test_append_overwrite_values(self) -> None: 717s # regression for GH1215 717s data = create_test_data() 717s with create_tmp_file(allow_cleanup_failure=False) as tmp_file: 717s self.save(data, tmp_file, mode="w") 717s data["var2"][:] = -999 717s data["var9"] = data["var2"] * 3 717s > self.save(data[["var2", "var9"]], tmp_file, mode="a") 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1387: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2296: in save 717s return dataset.to_zarr(store=store_target, **kwargs, **self.version_kwargs) 717s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 717s return to_zarr( # type: ignore[call-overload,misc] 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 717s dump_to_store(dataset, zstore, writer, encoding=encoding) 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 717s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 717s k: self.open_store_variable(name=k) for k in existing_variable_names 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'dim2' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ___________ TestZarrWriteEmpty.test_roundtrip_consolidated[3-False] ____________ 717s 717s self = 717s consolidated = False 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s def test_roundtrip_consolidated(self, consolidated) -> None: 717s expected = create_test_data() 717s > with self.roundtrip( 717s expected, 717s save_kwargs={"consolidated": consolidated}, 717s open_kwargs={"backend_kwargs": {"consolidated": consolidated}}, 717s ) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2321: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'dim2' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ____________ TestZarrWriteEmpty.test_roundtrip_consolidated[3-True] ____________ 717s 717s self = 717s consolidated = True 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s def test_roundtrip_consolidated(self, consolidated) -> None: 717s expected = create_test_data() 717s > with self.roundtrip( 717s expected, 717s save_kwargs={"consolidated": consolidated}, 717s open_kwargs={"backend_kwargs": {"consolidated": consolidated}}, 717s ) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2321: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'dim2' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ____________ TestZarrWriteEmpty.test_roundtrip_consolidated[3-None] ____________ 717s 717s self = 717s consolidated = None 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s def test_roundtrip_consolidated(self, consolidated) -> None: 717s expected = create_test_data() 717s > with self.roundtrip( 717s expected, 717s save_kwargs={"consolidated": consolidated}, 717s open_kwargs={"backend_kwargs": {"consolidated": consolidated}}, 717s ) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2321: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'dim2' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ___________ TestZarrWriteEmpty.test_read_non_consolidated_warning[3] ___________ 717s 717s self = 717s 717s def test_read_non_consolidated_warning(self) -> None: 717s expected = create_test_data() 717s with self.create_zarr_target() as store: 717s self.save( 717s expected, store_target=store, consolidated=False, **self.version_kwargs 717s ) 717s with pytest.warns( 717s RuntimeWarning, 717s match="Failed to open Zarr store with consolidated", 717s ): 717s > with xr.open_zarr(store, **self.version_kwargs) as ds: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2339: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 717s ds = open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'dim2' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ________________ TestZarrWriteEmpty.test_non_existent_store[3] _________________ 717s 717s self = 717s 717s def test_non_existent_store(self) -> None: 717s with pytest.raises( 717s FileNotFoundError, match="(No such file or directory|Unable to find group)" 717s ): 717s > xr.open_zarr(f"{uuid.uuid4()}") 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2346: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 717s ds = open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1608: in open_dataset 717s store = ZarrStore.open_group( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:732: in open_group 717s ) = _get_open_params( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1811: in _get_open_params 717s zarr_root_group = zarr.open_consolidated(store, **open_kwargs) 717s /usr/lib/python3/dist-packages/zarr/api/synchronous.py:231: in open_consolidated 717s sync(async_api.open_consolidated(*args, use_consolidated=use_consolidated, **kwargs)) 717s /usr/lib/python3/dist-packages/zarr/core/sync.py:163: in sync 717s raise return_result 717s /usr/lib/python3/dist-packages/zarr/core/sync.py:119: in _runner 717s return await coro 717s /usr/lib/python3/dist-packages/zarr/api/asynchronous.py:408: in open_consolidated 717s return await open_group(*args, use_consolidated=use_consolidated, **kwargs) 717s /usr/lib/python3/dist-packages/zarr/api/asynchronous.py:851: in open_group 717s store_path = await make_store_path(store, mode=mode, storage_options=storage_options, path=path) 717s /usr/lib/python3/dist-packages/zarr/storage/_common.py:418: in make_store_path 717s store = await make_store(store_like, mode=mode, storage_options=storage_options) 717s /usr/lib/python3/dist-packages/zarr/storage/_common.py:349: in make_store 717s return await make_store(Path(store_like), mode=mode, storage_options=storage_options) 717s /usr/lib/python3/dist-packages/zarr/storage/_common.py:339: in make_store 717s return await LocalStore.open(root=store_like, mode=mode, read_only=_read_only) 717s /usr/lib/python3/dist-packages/zarr/storage/_local.py:160: in open 717s await store._open() 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = LocalStore('file:///tmp/autopkgtest.cdpOi4/autopkgtest_tmp/build/8ef92ad5-b250-4560-a69b-4693e105be48') 717s 717s async def _open(self, *, mode: AccessModeLiteral | None = None) -> None: 717s if not self.read_only: 717s self.root.mkdir(parents=True, exist_ok=True) 717s 717s if not self.root.exists(): 717s > raise FileNotFoundError(f"{self.root} does not exist") 717s E FileNotFoundError: /tmp/autopkgtest.cdpOi4/autopkgtest_tmp/build/8ef92ad5-b250-4560-a69b-4693e105be48 does not exist 717s 717s /usr/lib/python3/dist-packages/zarr/storage/_local.py:172: FileNotFoundError 717s 717s During handling of the above exception, another exception occurred: 717s 717s self = 717s 717s def test_non_existent_store(self) -> None: 717s > with pytest.raises( 717s FileNotFoundError, match="(No such file or directory|Unable to find group)" 717s ): 717s E AssertionError: Regex pattern did not match. 717s E Regex: '(No such file or directory|Unable to find group)' 717s E Input: '/tmp/autopkgtest.cdpOi4/autopkgtest_tmp/build/8ef92ad5-b250-4560-a69b-4693e105be48 does not exist' 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2343: AssertionError 717s ____________________ TestZarrWriteEmpty.test_auto_chunk[3] _____________________ 717s 717s self = 717s 717s @requires_dask 717s def test_auto_chunk(self) -> None: 717s original = create_test_data().chunk() 717s 717s > with self.roundtrip(original, open_kwargs={"chunks": None}) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2367: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'dim2' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ___________________ TestZarrWriteEmpty.test_manual_chunk[3] ____________________ 717s 717s self = 717s 717s @requires_dask 717s @pytest.mark.filterwarnings("ignore:The specified chunks separate:UserWarning") 717s def test_manual_chunk(self) -> None: 717s original = create_test_data().chunk({"dim1": 3, "dim2": 4, "dim3": 3}) 717s 717s # Using chunks = None should return non-chunked arrays 717s open_kwargs: dict[str, Any] = {"chunks": None} 717s > with self.roundtrip(original, open_kwargs=open_kwargs) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2388: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'dim2' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _______________ TestZarrWriteEmpty.test_warning_on_bad_chunks[3] _______________ 717s 717s self = 717s 717s @requires_dask 717s def test_warning_on_bad_chunks(self) -> None: 717s original = create_test_data().chunk({"dim1": 4, "dim2": 3, "dim3": 3}) 717s 717s bad_chunks = (2, {"dim2": (3, 3, 2, 1)}) 717s for chunks in bad_chunks: 717s kwargs = {"chunks": chunks} 717s with pytest.warns(UserWarning): 717s > with self.roundtrip(original, open_kwargs=kwargs) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2433: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'dim2' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _____________ TestZarrWriteEmpty.test_write_uneven_dask_chunks[3] ______________ 717s 717s self = 717s 717s @requires_dask 717s def test_write_uneven_dask_chunks(self) -> None: 717s # regression for GH#2225 717s original = create_test_data().chunk({"dim1": 3, "dim2": 4, "dim3": 3}) 717s > with self.roundtrip(original, open_kwargs={"chunks": {}}) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2476: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'dim2' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s __________________ TestZarrWriteEmpty.test_chunk_encoding[3] ___________________ 717s 717s self = 717s 717s def test_chunk_encoding(self) -> None: 717s # These datasets have no dask chunks. All chunking specified in 717s # encoding 717s data = create_test_data() 717s chunks = (5, 5) 717s data["var2"].encoding.update({"chunks": chunks}) 717s 717s > with self.roundtrip(data) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2487: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'dim2' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s __________________ TestZarrWriteEmpty.test_shard_encoding[3] ___________________ 717s 717s self = 717s 717s def test_shard_encoding(self) -> None: 717s # These datasets have no dask chunks. All chunking/sharding specified in 717s # encoding 717s if has_zarr_v3 and zarr.config.config["default_zarr_format"] == 3: 717s data = create_test_data() 717s chunks = (1, 1) 717s shards = (5, 5) 717s data["var2"].encoding.update({"chunks": chunks}) 717s data["var2"].encoding.update({"shards": shards}) 717s > with self.roundtrip(data) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2505: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'dim2' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ___________ TestZarrWriteEmpty.test_write_persistence_modes[3-None] ____________ 717s 717s self = 717s group = None 717s 717s @pytest.mark.parametrize("group", [None, "group1"]) 717s def test_write_persistence_modes(self, group) -> None: 717s original = create_test_data() 717s 717s # overwrite mode 717s > with self.roundtrip( 717s original, 717s save_kwargs={"mode": "w", "group": group}, 717s open_kwargs={"group": group}, 717s ) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2650: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'dim2' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s __________ TestZarrWriteEmpty.test_write_persistence_modes[3-group1] ___________ 717s 717s self = 717s group = 'group1' 717s 717s @pytest.mark.parametrize("group", [None, "group1"]) 717s def test_write_persistence_modes(self, group) -> None: 717s original = create_test_data() 717s 717s # overwrite mode 717s > with self.roundtrip( 717s original, 717s save_kwargs={"mode": "w", "group": group}, 717s open_kwargs={"group": group}, 717s ) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2650: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'dim2' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ________________ TestZarrWriteEmpty.test_compressor_encoding[3] ________________ 717s 717s self = 717s 717s def test_compressor_encoding(self) -> None: 717s # specify a custom compressor 717s original = create_test_data() 717s if has_zarr_v3 and zarr.config.config["default_zarr_format"] == 3: 717s encoding_key = "compressors" 717s # all parameters need to be explicitly specified in order for the comparison to pass below 717s encoding = { 717s "serializer": zarr.codecs.BytesCodec(endian="little"), 717s encoding_key: ( 717s zarr.codecs.BloscCodec( 717s cname="zstd", 717s clevel=3, 717s shuffle="shuffle", 717s typesize=8, 717s blocksize=0, 717s ), 717s ), 717s } 717s else: 717s from numcodecs.blosc import Blosc 717s 717s encoding_key = "compressors" if has_zarr_v3 else "compressor" 717s comp = Blosc(cname="zstd", clevel=3, shuffle=2) 717s encoding = {encoding_key: (comp,) if has_zarr_v3 else comp} 717s 717s save_kwargs = dict(encoding={"var1": encoding}) 717s 717s > with self.roundtrip(original, save_kwargs=save_kwargs) as ds: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2723: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'dim2' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _______________________ TestZarrWriteEmpty.test_group[3] _______________________ 717s 717s self = 717s 717s def test_group(self) -> None: 717s original = create_test_data() 717s group = "some/random/path" 717s > with self.roundtrip( 717s original, save_kwargs={"group": group}, open_kwargs={"group": group} 717s ) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2730: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'dim2' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ___________________ TestZarrWriteEmpty.test_append_write[3] ____________________ 717s 717s self = 717s 717s def test_append_write(self) -> None: 717s > super().test_append_write() 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2762: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1377: in test_append_write 717s with self.roundtrip_append(data) as actual: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:388: in roundtrip_append 717s self.save(data[[key]], path, mode=mode, **save_kwargs) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2296: in save 717s return dataset.to_zarr(store=store_target, **kwargs, **self.version_kwargs) 717s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 717s return to_zarr( # type: ignore[call-overload,misc] 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 717s dump_to_store(dataset, zstore, writer, encoding=encoding) 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 717s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 717s k: self.open_store_variable(name=k) for k in existing_variable_names 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'dim2' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _______ TestZarrWriteEmpty.test_append_with_append_dim_not_set_raises[3] _______ 717s 717s self = 717s 717s def test_append_with_append_dim_not_set_raises(self) -> None: 717s ds, ds_to_append, _ = create_append_test_data() 717s with self.create_zarr_target() as store_target: 717s ds.to_zarr(store_target, mode="w", **self.version_kwargs) 717s with pytest.raises(ValueError, match="different dimension sizes"): 717s > ds_to_append.to_zarr(store_target, mode="a", **self.version_kwargs) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2809: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 717s return to_zarr( # type: ignore[call-overload,misc] 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 717s dump_to_store(dataset, zstore, writer, encoding=encoding) 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 717s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 717s k: self.open_store_variable(name=k) for k in existing_variable_names 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'da' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _______ TestZarrWriteEmpty.test_append_string_length_mismatch_works[3-U] _______ 717s 717s self = 717s dtype = 'U' 717s 717s @pytest.mark.parametrize("dtype", ["U", "S"]) 717s def test_append_string_length_mismatch_works(self, dtype) -> None: 717s skip_if_zarr_format_2("This doesn't work with Zarr format 2") 717s # ...but it probably would if we used object dtype 717s ds, ds_to_append = create_append_string_length_mismatch_test_data(dtype) 717s expected = xr.concat([ds, ds_to_append], dim="time") 717s with self.create_zarr_target() as store_target: 717s ds.to_zarr(store_target, mode="w", **self.version_kwargs) 717s > ds_to_append.to_zarr(store_target, append_dim="time", **self.version_kwargs) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2851: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 717s return to_zarr( # type: ignore[call-overload,misc] 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 717s dump_to_store(dataset, zstore, writer, encoding=encoding) 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 717s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1018: in store 717s _validate_datatypes_for_zarr_append( 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s vname = 'temperature' 717s existing_var = Size: 24B 717s [3 values with dtype= Size: 60B 717s array(['abc', 'def', 'ghijk'], dtype=' raise ValueError( 717s f"Mismatched dtypes for variable {vname} between Zarr store on disk " 717s f"and dataset to append. Store has dtype {existing_var.dtype} but " 717s f"dataset to append has dtype {new_var.dtype}." 717s ) 717s E ValueError: Mismatched dtypes for variable temperature between Zarr store on disk and dataset to append. Store has dtype 717s dtype = 'S' 717s 717s @pytest.mark.parametrize("dtype", ["U", "S"]) 717s def test_append_string_length_mismatch_works(self, dtype) -> None: 717s skip_if_zarr_format_2("This doesn't work with Zarr format 2") 717s # ...but it probably would if we used object dtype 717s ds, ds_to_append = create_append_string_length_mismatch_test_data(dtype) 717s expected = xr.concat([ds, ds_to_append], dim="time") 717s with self.create_zarr_target() as store_target: 717s ds.to_zarr(store_target, mode="w", **self.version_kwargs) 717s > ds_to_append.to_zarr(store_target, append_dim="time", **self.version_kwargs) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2851: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 717s return to_zarr( # type: ignore[call-overload,misc] 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 717s dump_to_store(dataset, zstore, writer, encoding=encoding) 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 717s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1018: in store 717s _validate_datatypes_for_zarr_append( 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s vname = 'temperature' 717s existing_var = Size: 6B 717s [3 values with dtype=|S2] 717s new_var = Size: 9B 717s array([b'aaa', b'bbb', b'ccc'], dtype='|S3') 717s 717s def _validate_datatypes_for_zarr_append(vname, existing_var, new_var): 717s """If variable exists in the store, confirm dtype of the data to append is compatible with 717s existing dtype. 717s """ 717s if ( 717s np.issubdtype(new_var.dtype, np.number) 717s or np.issubdtype(new_var.dtype, np.datetime64) 717s or np.issubdtype(new_var.dtype, np.bool_) 717s or new_var.dtype == object 717s or (new_var.dtype.kind in ("S", "U") and existing_var.dtype == object) 717s ): 717s # We can skip dtype equality checks under two conditions: (1) if the var to append is 717s # new to the dataset, because in this case there is no existing var to compare it to; 717s # or (2) if var to append's dtype is known to be easy-to-append, because in this case 717s # we can be confident appending won't cause problems. Examples of dtypes which are not 717s # easy-to-append include length-specified strings of type `|S*` or ` raise ValueError( 717s f"Mismatched dtypes for variable {vname} between Zarr store on disk " 717s f"and dataset to append. Store has dtype {existing_var.dtype} but " 717s f"dataset to append has dtype {new_var.dtype}." 717s ) 717s E ValueError: Mismatched dtypes for variable temperature between Zarr store on disk and dataset to append. Store has dtype |S2 but dataset to append has dtype |S3. 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:566: ValueError 717s _____ TestZarrWriteEmpty.test_check_encoding_is_consistent_after_append[3] _____ 717s 717s self = 717s 717s def test_check_encoding_is_consistent_after_append(self) -> None: 717s ds, ds_to_append, _ = create_append_test_data() 717s 717s # check encoding consistency 717s with self.create_zarr_target() as store_target: 717s import numcodecs 717s 717s encoding_value: Any 717s if has_zarr_v3 and zarr.config.config["default_zarr_format"] == 3: 717s compressor = zarr.codecs.BloscCodec() 717s else: 717s compressor = numcodecs.Blosc() 717s encoding_key = "compressors" if has_zarr_v3 else "compressor" 717s encoding_value = (compressor,) if has_zarr_v3 else compressor 717s 717s encoding = {"da": {encoding_key: encoding_value}} 717s ds.to_zarr(store_target, mode="w", encoding=encoding, **self.version_kwargs) 717s > original_ds = xr.open_dataset( 717s store_target, engine="zarr", **self.version_kwargs 717s ) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2872: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'da' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _____________ TestZarrWriteEmpty.test_append_with_new_variable[3] ______________ 717s 717s self = 717s 717s def test_append_with_new_variable(self) -> None: 717s ds, ds_to_append, ds_with_new_var = create_append_test_data() 717s 717s # check append mode for new variable 717s with self.create_zarr_target() as store_target: 717s combined = xr.concat([ds, ds_to_append], dim="time") 717s combined.to_zarr(store_target, mode="w", **self.version_kwargs) 717s assert_identical( 717s combined, 717s > xr.open_dataset(store_target, engine="zarr", **self.version_kwargs), 717s ) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2899: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'da' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ________ TestZarrWriteEmpty.test_append_with_append_dim_no_overwrite[3] ________ 717s 717s self = 717s 717s def test_append_with_append_dim_no_overwrite(self) -> None: 717s ds, ds_to_append, _ = create_append_test_data() 717s with self.create_zarr_target() as store_target: 717s ds.to_zarr(store_target, mode="w", **self.version_kwargs) 717s original = xr.concat([ds, ds_to_append], dim="time") 717s original2 = xr.concat([original, ds_to_append], dim="time") 717s 717s # overwrite a coordinate; 717s # for mode='a-', this will not get written to the store 717s # because it does not have the append_dim as a dim 717s lon = ds_to_append.lon.to_numpy().copy() 717s lon[:] = -999 717s ds_to_append["lon"] = lon 717s > ds_to_append.to_zarr( 717s store_target, mode="a-", append_dim="time", **self.version_kwargs 717s ) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2922: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 717s return to_zarr( # type: ignore[call-overload,misc] 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 717s dump_to_store(dataset, zstore, writer, encoding=encoding) 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 717s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 717s k: self.open_store_variable(name=k) for k in existing_variable_names 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'da' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s __________ TestZarrWriteEmpty.test_to_zarr_compute_false_roundtrip[3] __________ 717s 717s self = 717s 717s @requires_dask 717s def test_to_zarr_compute_false_roundtrip(self) -> None: 717s from dask.delayed import Delayed 717s 717s original = create_test_data().chunk() 717s 717s with self.create_zarr_target() as store: 717s delayed_obj = self.save(original, store, compute=False) 717s assert isinstance(delayed_obj, Delayed) 717s 717s # make sure target store has not been written to yet 717s with pytest.raises(AssertionError): 717s > with self.open(store) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2948: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'dim2' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ______ TestZarrWriteEmpty.test_to_zarr_append_compute_false_roundtrip[3] _______ 717s 717s self = 717s 717s @requires_dask 717s def test_to_zarr_append_compute_false_roundtrip(self) -> None: 717s from dask.delayed import Delayed 717s 717s ds, ds_to_append, _ = create_append_test_data() 717s ds, ds_to_append = ds.chunk(), ds_to_append.chunk() 717s 717s with pytest.warns(SerializationWarning): 717s with self.create_zarr_target() as store: 717s delayed_obj = self.save(ds, store, compute=False, mode="w") 717s assert isinstance(delayed_obj, Delayed) 717s 717s with pytest.raises(AssertionError): 717s > with self.open(store) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2969: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'da' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ________________ TestZarrWriteEmpty.test_save_emptydim[3-False] ________________ 717s 717s self = 717s chunk = False 717s 717s @pytest.mark.parametrize("chunk", [False, True]) 717s def test_save_emptydim(self, chunk) -> None: 717s if chunk and not has_dask: 717s pytest.skip("requires dask") 717s ds = Dataset({"x": (("a", "b"), np.empty((5, 0))), "y": ("a", [1, 2, 5, 8, 9])}) 717s if chunk: 717s ds = ds.chunk({}) # chunk dataset to save dask array 717s > with self.roundtrip(ds) as ds_reload: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3000: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'x' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ________________ TestZarrWriteEmpty.test_save_emptydim[3-True] _________________ 717s 717s self = 717s chunk = True 717s 717s @pytest.mark.parametrize("chunk", [False, True]) 717s def test_save_emptydim(self, chunk) -> None: 717s if chunk and not has_dask: 717s pytest.skip("requires dask") 717s ds = Dataset({"x": (("a", "b"), np.empty((5, 0))), "y": ("a", [1, 2, 5, 8, 9])}) 717s if chunk: 717s ds = ds.chunk({}) # chunk dataset to save dask array 717s > with self.roundtrip(ds) as ds_reload: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3000: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'x' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _____ TestZarrWriteEmpty.test_no_warning_from_open_emptydim_with_chunks[3] _____ 717s 717s self = 717s 717s @requires_dask 717s def test_no_warning_from_open_emptydim_with_chunks(self) -> None: 717s ds = Dataset({"x": (("a", "b"), np.empty((5, 0)))}).chunk({"a": 1}) 717s with assert_no_warnings(): 717s with warnings.catch_warnings(): 717s warnings.filterwarnings( 717s "ignore", 717s message=".*Zarr format 3 specification.*", 717s category=UserWarning, 717s ) 717s > with self.roundtrip(ds, open_kwargs=dict(chunks={"a": 1})) as ds_reload: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3013: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'x' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _______ TestZarrWriteEmpty.test_write_region[3-False-False-False-False] ________ 717s 717s self = 717s consolidated = False, compute = False, use_dask = False, write_empty = False 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s assert_identical(actual, zeros) 717s for i in range(0, 10, 2): 717s region = {"x": slice(i, i + 2)} 717s > nonzeros.isel(region).to_zarr( 717s store, 717s region=region, 717s consolidated=consolidated, 717s write_empty_chunks=write_empty, 717s **self.version_kwargs, 717s ) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 717s return to_zarr( # type: ignore[call-overload,misc] 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 717s dump_to_store(dataset, zstore, writer, encoding=encoding) 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 717s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 717s k: self.open_store_variable(name=k) for k in existing_variable_names 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ________ TestZarrWriteEmpty.test_write_region[3-False-False-False-True] ________ 717s 717s self = 717s consolidated = True, compute = False, use_dask = False, write_empty = False 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s assert_identical(actual, zeros) 717s for i in range(0, 10, 2): 717s region = {"x": slice(i, i + 2)} 717s > nonzeros.isel(region).to_zarr( 717s store, 717s region=region, 717s consolidated=consolidated, 717s write_empty_chunks=write_empty, 717s **self.version_kwargs, 717s ) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 717s return to_zarr( # type: ignore[call-overload,misc] 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 717s dump_to_store(dataset, zstore, writer, encoding=encoding) 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 717s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 717s k: self.open_store_variable(name=k) for k in existing_variable_names 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ________ TestZarrWriteEmpty.test_write_region[3-False-False-False-None] ________ 717s 717s self = 717s consolidated = None, compute = False, use_dask = False, write_empty = False 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s assert_identical(actual, zeros) 717s for i in range(0, 10, 2): 717s region = {"x": slice(i, i + 2)} 717s > nonzeros.isel(region).to_zarr( 717s store, 717s region=region, 717s consolidated=consolidated, 717s write_empty_chunks=write_empty, 717s **self.version_kwargs, 717s ) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 717s return to_zarr( # type: ignore[call-overload,misc] 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 717s dump_to_store(dataset, zstore, writer, encoding=encoding) 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 717s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 717s k: self.open_store_variable(name=k) for k in existing_variable_names 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ________ TestZarrWriteEmpty.test_write_region[3-False-False-True-False] ________ 717s 717s self = 717s consolidated = False, compute = True, use_dask = False, write_empty = False 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s > with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 717s ds = open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ________ TestZarrWriteEmpty.test_write_region[3-False-False-True-True] _________ 717s 717s self = 717s consolidated = True, compute = True, use_dask = False, write_empty = False 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s > with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 717s ds = open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ________ TestZarrWriteEmpty.test_write_region[3-False-False-True-None] _________ 717s 717s self = 717s consolidated = None, compute = True, use_dask = False, write_empty = False 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s > with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 717s ds = open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ________ TestZarrWriteEmpty.test_write_region[3-False-True-False-False] ________ 717s 717s self = 717s consolidated = False, compute = False, use_dask = True, write_empty = False 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s assert_identical(actual, zeros) 717s for i in range(0, 10, 2): 717s region = {"x": slice(i, i + 2)} 717s > nonzeros.isel(region).to_zarr( 717s store, 717s region=region, 717s consolidated=consolidated, 717s write_empty_chunks=write_empty, 717s **self.version_kwargs, 717s ) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 717s return to_zarr( # type: ignore[call-overload,misc] 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 717s dump_to_store(dataset, zstore, writer, encoding=encoding) 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 717s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 717s k: self.open_store_variable(name=k) for k in existing_variable_names 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ________ TestZarrWriteEmpty.test_write_region[3-False-True-False-True] _________ 717s 717s self = 717s consolidated = True, compute = False, use_dask = True, write_empty = False 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s assert_identical(actual, zeros) 717s for i in range(0, 10, 2): 717s region = {"x": slice(i, i + 2)} 717s > nonzeros.isel(region).to_zarr( 717s store, 717s region=region, 717s consolidated=consolidated, 717s write_empty_chunks=write_empty, 717s **self.version_kwargs, 717s ) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 717s return to_zarr( # type: ignore[call-overload,misc] 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 717s dump_to_store(dataset, zstore, writer, encoding=encoding) 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 717s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 717s k: self.open_store_variable(name=k) for k in existing_variable_names 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ________ TestZarrWriteEmpty.test_write_region[3-False-True-False-None] _________ 717s 717s self = 717s consolidated = None, compute = False, use_dask = True, write_empty = False 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s assert_identical(actual, zeros) 717s for i in range(0, 10, 2): 717s region = {"x": slice(i, i + 2)} 717s > nonzeros.isel(region).to_zarr( 717s store, 717s region=region, 717s consolidated=consolidated, 717s write_empty_chunks=write_empty, 717s **self.version_kwargs, 717s ) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 717s return to_zarr( # type: ignore[call-overload,misc] 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 717s dump_to_store(dataset, zstore, writer, encoding=encoding) 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 717s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 717s k: self.open_store_variable(name=k) for k in existing_variable_names 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ________ TestZarrWriteEmpty.test_write_region[3-False-True-True-False] _________ 717s 717s self = 717s consolidated = False, compute = True, use_dask = True, write_empty = False 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s > with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 717s ds = open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _________ TestZarrWriteEmpty.test_write_region[3-False-True-True-True] _________ 717s 717s self = 717s consolidated = True, compute = True, use_dask = True, write_empty = False 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s > with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 717s ds = open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _________ TestZarrWriteEmpty.test_write_region[3-False-True-True-None] _________ 717s 717s self = 717s consolidated = None, compute = True, use_dask = True, write_empty = False 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s > with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 717s ds = open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ________ TestZarrWriteEmpty.test_write_region[3-True-False-False-False] ________ 717s 717s self = 717s consolidated = False, compute = False, use_dask = False, write_empty = True 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s assert_identical(actual, zeros) 717s for i in range(0, 10, 2): 717s region = {"x": slice(i, i + 2)} 717s > nonzeros.isel(region).to_zarr( 717s store, 717s region=region, 717s consolidated=consolidated, 717s write_empty_chunks=write_empty, 717s **self.version_kwargs, 717s ) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 717s return to_zarr( # type: ignore[call-overload,misc] 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 717s dump_to_store(dataset, zstore, writer, encoding=encoding) 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 717s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 717s k: self.open_store_variable(name=k) for k in existing_variable_names 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ________ TestZarrWriteEmpty.test_write_region[3-True-False-False-True] _________ 717s 717s self = 717s consolidated = True, compute = False, use_dask = False, write_empty = True 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s assert_identical(actual, zeros) 717s for i in range(0, 10, 2): 717s region = {"x": slice(i, i + 2)} 717s > nonzeros.isel(region).to_zarr( 717s store, 717s region=region, 717s consolidated=consolidated, 717s write_empty_chunks=write_empty, 717s **self.version_kwargs, 717s ) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 717s return to_zarr( # type: ignore[call-overload,misc] 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 717s dump_to_store(dataset, zstore, writer, encoding=encoding) 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 717s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 717s k: self.open_store_variable(name=k) for k in existing_variable_names 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ________ TestZarrWriteEmpty.test_write_region[3-True-False-False-None] _________ 717s 717s self = 717s consolidated = None, compute = False, use_dask = False, write_empty = True 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s assert_identical(actual, zeros) 717s for i in range(0, 10, 2): 717s region = {"x": slice(i, i + 2)} 717s > nonzeros.isel(region).to_zarr( 717s store, 717s region=region, 717s consolidated=consolidated, 717s write_empty_chunks=write_empty, 717s **self.version_kwargs, 717s ) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 717s return to_zarr( # type: ignore[call-overload,misc] 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 717s dump_to_store(dataset, zstore, writer, encoding=encoding) 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 717s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 717s k: self.open_store_variable(name=k) for k in existing_variable_names 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ________ TestZarrWriteEmpty.test_write_region[3-True-False-True-False] _________ 717s 717s self = 717s consolidated = False, compute = True, use_dask = False, write_empty = True 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s > with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 717s ds = open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _________ TestZarrWriteEmpty.test_write_region[3-True-False-True-True] _________ 717s 717s self = 717s consolidated = True, compute = True, use_dask = False, write_empty = True 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s > with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 717s ds = open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _________ TestZarrWriteEmpty.test_write_region[3-True-False-True-None] _________ 717s 717s self = 717s consolidated = None, compute = True, use_dask = False, write_empty = True 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s > with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 717s ds = open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ________ TestZarrWriteEmpty.test_write_region[3-True-True-False-False] _________ 717s 717s self = 717s consolidated = False, compute = False, use_dask = True, write_empty = True 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s assert_identical(actual, zeros) 717s for i in range(0, 10, 2): 717s region = {"x": slice(i, i + 2)} 717s > nonzeros.isel(region).to_zarr( 717s store, 717s region=region, 717s consolidated=consolidated, 717s write_empty_chunks=write_empty, 717s **self.version_kwargs, 717s ) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 717s return to_zarr( # type: ignore[call-overload,misc] 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 717s dump_to_store(dataset, zstore, writer, encoding=encoding) 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 717s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 717s k: self.open_store_variable(name=k) for k in existing_variable_names 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _________ TestZarrWriteEmpty.test_write_region[3-True-True-False-True] _________ 717s 717s self = 717s consolidated = True, compute = False, use_dask = True, write_empty = True 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s assert_identical(actual, zeros) 717s for i in range(0, 10, 2): 717s region = {"x": slice(i, i + 2)} 717s > nonzeros.isel(region).to_zarr( 717s store, 717s region=region, 717s consolidated=consolidated, 717s write_empty_chunks=write_empty, 717s **self.version_kwargs, 717s ) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 717s return to_zarr( # type: ignore[call-overload,misc] 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 717s dump_to_store(dataset, zstore, writer, encoding=encoding) 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 717s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 717s k: self.open_store_variable(name=k) for k in existing_variable_names 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _________ TestZarrWriteEmpty.test_write_region[3-True-True-False-None] _________ 717s 717s self = 717s consolidated = None, compute = False, use_dask = True, write_empty = True 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s assert_identical(actual, zeros) 717s for i in range(0, 10, 2): 717s region = {"x": slice(i, i + 2)} 717s > nonzeros.isel(region).to_zarr( 717s store, 717s region=region, 717s consolidated=consolidated, 717s write_empty_chunks=write_empty, 717s **self.version_kwargs, 717s ) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 717s return to_zarr( # type: ignore[call-overload,misc] 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 717s dump_to_store(dataset, zstore, writer, encoding=encoding) 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 717s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 717s k: self.open_store_variable(name=k) for k in existing_variable_names 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _________ TestZarrWriteEmpty.test_write_region[3-True-True-True-False] _________ 717s 717s self = 717s consolidated = False, compute = True, use_dask = True, write_empty = True 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s > with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 717s ds = open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _________ TestZarrWriteEmpty.test_write_region[3-True-True-True-True] __________ 717s 717s self = 717s consolidated = True, compute = True, use_dask = True, write_empty = True 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s > with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 717s ds = open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _________ TestZarrWriteEmpty.test_write_region[3-True-True-True-None] __________ 717s 717s self = 717s consolidated = None, compute = True, use_dask = True, write_empty = True 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s > with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 717s ds = open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ________ TestZarrWriteEmpty.test_write_region[3-None-False-False-False] ________ 717s 717s self = 717s consolidated = False, compute = False, use_dask = False, write_empty = None 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s assert_identical(actual, zeros) 717s for i in range(0, 10, 2): 717s region = {"x": slice(i, i + 2)} 717s > nonzeros.isel(region).to_zarr( 717s store, 717s region=region, 717s consolidated=consolidated, 717s write_empty_chunks=write_empty, 717s **self.version_kwargs, 717s ) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 717s return to_zarr( # type: ignore[call-overload,misc] 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 717s dump_to_store(dataset, zstore, writer, encoding=encoding) 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 717s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 717s k: self.open_store_variable(name=k) for k in existing_variable_names 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ________ TestZarrWriteEmpty.test_write_region[3-None-False-False-True] _________ 717s 717s self = 717s consolidated = True, compute = False, use_dask = False, write_empty = None 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s assert_identical(actual, zeros) 717s for i in range(0, 10, 2): 717s region = {"x": slice(i, i + 2)} 717s > nonzeros.isel(region).to_zarr( 717s store, 717s region=region, 717s consolidated=consolidated, 717s write_empty_chunks=write_empty, 717s **self.version_kwargs, 717s ) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 717s return to_zarr( # type: ignore[call-overload,misc] 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 717s dump_to_store(dataset, zstore, writer, encoding=encoding) 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 717s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 717s k: self.open_store_variable(name=k) for k in existing_variable_names 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ________ TestZarrWriteEmpty.test_write_region[3-None-False-False-None] _________ 717s 717s self = 717s consolidated = None, compute = False, use_dask = False, write_empty = None 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s assert_identical(actual, zeros) 717s for i in range(0, 10, 2): 717s region = {"x": slice(i, i + 2)} 717s > nonzeros.isel(region).to_zarr( 717s store, 717s region=region, 717s consolidated=consolidated, 717s write_empty_chunks=write_empty, 717s **self.version_kwargs, 717s ) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 717s return to_zarr( # type: ignore[call-overload,misc] 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 717s dump_to_store(dataset, zstore, writer, encoding=encoding) 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 717s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 717s k: self.open_store_variable(name=k) for k in existing_variable_names 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ________ TestZarrWriteEmpty.test_write_region[3-None-False-True-False] _________ 717s 717s self = 717s consolidated = False, compute = True, use_dask = False, write_empty = None 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s > with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 717s ds = open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _________ TestZarrWriteEmpty.test_write_region[3-None-False-True-True] _________ 717s 717s self = 717s consolidated = True, compute = True, use_dask = False, write_empty = None 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s > with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 717s ds = open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _________ TestZarrWriteEmpty.test_write_region[3-None-False-True-None] _________ 717s 717s self = 717s consolidated = None, compute = True, use_dask = False, write_empty = None 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s > with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 717s ds = open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ________ TestZarrWriteEmpty.test_write_region[3-None-True-False-False] _________ 717s 717s self = 717s consolidated = False, compute = False, use_dask = True, write_empty = None 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s assert_identical(actual, zeros) 717s for i in range(0, 10, 2): 717s region = {"x": slice(i, i + 2)} 717s > nonzeros.isel(region).to_zarr( 717s store, 717s region=region, 717s consolidated=consolidated, 717s write_empty_chunks=write_empty, 717s **self.version_kwargs, 717s ) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 717s return to_zarr( # type: ignore[call-overload,misc] 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 717s dump_to_store(dataset, zstore, writer, encoding=encoding) 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 717s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 717s k: self.open_store_variable(name=k) for k in existing_variable_names 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _________ TestZarrWriteEmpty.test_write_region[3-None-True-False-True] _________ 717s 717s self = 717s consolidated = True, compute = False, use_dask = True, write_empty = None 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s assert_identical(actual, zeros) 717s for i in range(0, 10, 2): 717s region = {"x": slice(i, i + 2)} 717s > nonzeros.isel(region).to_zarr( 717s store, 717s region=region, 717s consolidated=consolidated, 717s write_empty_chunks=write_empty, 717s **self.version_kwargs, 717s ) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 717s return to_zarr( # type: ignore[call-overload,misc] 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 717s dump_to_store(dataset, zstore, writer, encoding=encoding) 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 717s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 717s k: self.open_store_variable(name=k) for k in existing_variable_names 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _________ TestZarrWriteEmpty.test_write_region[3-None-True-False-None] _________ 717s 717s self = 717s consolidated = None, compute = False, use_dask = True, write_empty = None 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s assert_identical(actual, zeros) 717s for i in range(0, 10, 2): 717s region = {"x": slice(i, i + 2)} 717s > nonzeros.isel(region).to_zarr( 717s store, 717s region=region, 717s consolidated=consolidated, 717s write_empty_chunks=write_empty, 717s **self.version_kwargs, 717s ) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 717s return to_zarr( # type: ignore[call-overload,misc] 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 717s dump_to_store(dataset, zstore, writer, encoding=encoding) 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 717s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 717s k: self.open_store_variable(name=k) for k in existing_variable_names 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _________ TestZarrWriteEmpty.test_write_region[3-None-True-True-False] _________ 717s 717s self = 717s consolidated = False, compute = True, use_dask = True, write_empty = None 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s > with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 717s ds = open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _________ TestZarrWriteEmpty.test_write_region[3-None-True-True-True] __________ 717s 717s self = 717s consolidated = True, compute = True, use_dask = True, write_empty = None 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s > with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 717s ds = open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _________ TestZarrWriteEmpty.test_write_region[3-None-True-True-None] __________ 717s 717s self = 717s consolidated = None, compute = True, use_dask = True, write_empty = None 717s 717s @pytest.mark.parametrize("consolidated", [False, True, None]) 717s @pytest.mark.parametrize("compute", [False, True]) 717s @pytest.mark.parametrize("use_dask", [False, True]) 717s @pytest.mark.parametrize("write_empty", [False, True, None]) 717s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 717s if (use_dask or not compute) and not has_dask: 717s pytest.skip("requires dask") 717s 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s 717s if use_dask: 717s zeros = zeros.chunk(2) 717s nonzeros = nonzeros.chunk(2) 717s 717s with self.create_zarr_target() as store: 717s zeros.to_zarr( 717s store, 717s consolidated=consolidated, 717s compute=compute, 717s encoding={"u": dict(chunks=2)}, 717s **self.version_kwargs, 717s ) 717s if compute: 717s > with xr.open_zarr( 717s store, consolidated=consolidated, **self.version_kwargs 717s ) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 717s ds = open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ______________ TestZarrWriteEmpty.test_write_region_mode[3-None] _______________ 717s 717s self = 717s mode = None 717s 717s @pytest.mark.parametrize("mode", [None, "r+", "a"]) 717s def test_write_region_mode(self, mode) -> None: 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s with self.create_zarr_target() as store: 717s zeros.to_zarr(store, **self.version_kwargs) 717s for region in [{"x": slice(5)}, {"x": slice(5, 10)}]: 717s > nonzeros.isel(region).to_zarr( 717s store, region=region, mode=mode, **self.version_kwargs 717s ) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3065: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 717s return to_zarr( # type: ignore[call-overload,misc] 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 717s dump_to_store(dataset, zstore, writer, encoding=encoding) 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 717s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 717s k: self.open_store_variable(name=k) for k in existing_variable_names 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _______________ TestZarrWriteEmpty.test_write_region_mode[3-r+] ________________ 717s 717s self = 717s mode = 'r+' 717s 717s @pytest.mark.parametrize("mode", [None, "r+", "a"]) 717s def test_write_region_mode(self, mode) -> None: 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s with self.create_zarr_target() as store: 717s zeros.to_zarr(store, **self.version_kwargs) 717s for region in [{"x": slice(5)}, {"x": slice(5, 10)}]: 717s > nonzeros.isel(region).to_zarr( 717s store, region=region, mode=mode, **self.version_kwargs 717s ) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3065: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 717s return to_zarr( # type: ignore[call-overload,misc] 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 717s dump_to_store(dataset, zstore, writer, encoding=encoding) 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 717s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 717s k: self.open_store_variable(name=k) for k in existing_variable_names 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ________________ TestZarrWriteEmpty.test_write_region_mode[3-a] ________________ 717s 717s self = 717s mode = 'a' 717s 717s @pytest.mark.parametrize("mode", [None, "r+", "a"]) 717s def test_write_region_mode(self, mode) -> None: 717s zeros = Dataset({"u": (("x",), np.zeros(10))}) 717s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 717s with self.create_zarr_target() as store: 717s zeros.to_zarr(store, **self.version_kwargs) 717s for region in [{"x": slice(5)}, {"x": slice(5, 10)}]: 717s > nonzeros.isel(region).to_zarr( 717s store, region=region, mode=mode, **self.version_kwargs 717s ) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3065: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 717s return to_zarr( # type: ignore[call-overload,misc] 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 717s dump_to_store(dataset, zstore, writer, encoding=encoding) 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 717s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 717s k: self.open_store_variable(name=k) for k in existing_variable_names 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ________ TestZarrWriteEmpty.test_write_preexisting_override_metadata[3] ________ 717s 717s self = 717s 717s @requires_dask 717s def test_write_preexisting_override_metadata(self) -> None: 717s """Metadata should be overridden if mode="a" but not in mode="r+".""" 717s original = Dataset( 717s {"u": (("x",), np.zeros(10), {"variable": "original"})}, 717s attrs={"global": "original"}, 717s ) 717s both_modified = Dataset( 717s {"u": (("x",), np.ones(10), {"variable": "modified"})}, 717s attrs={"global": "modified"}, 717s ) 717s global_modified = Dataset( 717s {"u": (("x",), np.ones(10), {"variable": "original"})}, 717s attrs={"global": "modified"}, 717s ) 717s only_new_data = Dataset( 717s {"u": (("x",), np.ones(10), {"variable": "original"})}, 717s attrs={"global": "original"}, 717s ) 717s 717s with self.create_zarr_target() as store: 717s original.to_zarr(store, compute=False, **self.version_kwargs) 717s > both_modified.to_zarr(store, mode="a", **self.version_kwargs) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3093: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 717s return to_zarr( # type: ignore[call-overload,misc] 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 717s dump_to_store(dataset, zstore, writer, encoding=encoding) 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 717s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 717s k: self.open_store_variable(name=k) for k in existing_variable_names 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'u' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ________________ TestZarrWriteEmpty.test_encoding_chunksizes[3] ________________ 717s 717s self = 717s 717s @requires_dask 717s def test_encoding_chunksizes(self) -> None: 717s # regression test for GH2278 717s # see also test_encoding_chunksizes_unlimited 717s nx, ny, nt = 4, 4, 5 717s original = xr.Dataset( 717s {}, 717s coords={ 717s "x": np.arange(nx), 717s "y": np.arange(ny), 717s "t": np.arange(nt), 717s }, 717s ) 717s original["v"] = xr.Variable(("x", "y", "t"), np.zeros((nx, ny, nt))) 717s original = original.chunk({"t": 1, "x": 2, "y": 2}) 717s 717s > with self.roundtrip(original) as ds1: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3207: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'v' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ______ TestZarrWriteEmpty.test_chunk_encoding_with_partial_dask_chunks[3] ______ 717s 717s self = 717s 717s @requires_dask 717s def test_chunk_encoding_with_partial_dask_chunks(self) -> None: 717s original = xr.Dataset( 717s {"x": xr.DataArray(np.random.random(size=(6, 8)), dims=("a", "b"))} 717s ).chunk({"a": 3}) 717s 717s > with self.roundtrip( 717s original, save_kwargs={"encoding": {"x": {"chunks": [3, 2]}}} 717s ) as ds1: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3218: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'x' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _______________ TestZarrWriteEmpty.test_open_zarr_use_cftime[3] ________________ 717s 717s self = 717s 717s @requires_cftime 717s def test_open_zarr_use_cftime(self) -> None: 717s ds = create_test_data() 717s with self.create_zarr_target() as store_target: 717s ds.to_zarr(store_target, **self.version_kwargs) 717s > ds_a = xr.open_zarr(store_target, **self.version_kwargs) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3237: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 717s ds = open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'dim2' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ______________ TestZarrWriteEmpty.test_write_read_select_write[3] ______________ 717s 717s self = 717s 717s def test_write_read_select_write(self) -> None: 717s # Test for https://github.com/pydata/xarray/issues/4084 717s ds = create_test_data() 717s 717s # NOTE: using self.roundtrip, which uses open_dataset, will not trigger the bug. 717s with self.create_zarr_target() as initial_store: 717s ds.to_zarr(initial_store, mode="w", **self.version_kwargs) 717s > ds1 = xr.open_zarr(initial_store, **self.version_kwargs) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3252: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 717s ds = open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'dim2' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s __________________ TestZarrWriteEmpty.test_attributes[3-obj1] __________________ 717s 717s self = 717s obj = Size: 8B 717s array(nan) 717s Attributes: 717s good: {'key': 'value'} 717s 717s @pytest.mark.parametrize("obj", [Dataset(), DataArray(name="foo")]) 717s def test_attributes(self, obj) -> None: 717s obj = obj.copy() 717s 717s obj.attrs["good"] = {"key": "value"} 717s ds = obj if isinstance(obj, Dataset) else obj.to_dataset() 717s with self.create_zarr_target() as store_target: 717s ds.to_zarr(store_target, **self.version_kwargs) 717s > assert_identical(ds, xr.open_zarr(store_target, **self.version_kwargs)) 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3267: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 717s ds = open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'foo' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _ TestZarrWriteEmpty.test_chunked_datetime64_or_timedelta64[3-datetime64[ns]] __ 717s 717s self = 717s dtype = 'datetime64[ns]' 717s 717s @requires_dask 717s @pytest.mark.parametrize("dtype", ["datetime64[ns]", "timedelta64[ns]"]) 717s def test_chunked_datetime64_or_timedelta64(self, dtype) -> None: 717s # Generalized from @malmans2's test in PR #8253 717s original = create_test_data().astype(dtype).chunk(1) 717s > with self.roundtrip( 717s original, 717s open_kwargs={ 717s "chunks": {}, 717s "decode_timedelta": CFTimedeltaCoder(time_unit="ns"), 717s }, 717s ) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3280: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'dim2' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _ TestZarrWriteEmpty.test_chunked_datetime64_or_timedelta64[3-timedelta64[ns]] _ 717s 717s self = 717s dtype = 'timedelta64[ns]' 717s 717s @requires_dask 717s @pytest.mark.parametrize("dtype", ["datetime64[ns]", "timedelta64[ns]"]) 717s def test_chunked_datetime64_or_timedelta64(self, dtype) -> None: 717s # Generalized from @malmans2's test in PR #8253 717s original = create_test_data().astype(dtype).chunk(1) 717s > with self.roundtrip( 717s original, 717s open_kwargs={ 717s "chunks": {}, 717s "decode_timedelta": CFTimedeltaCoder(time_unit="ns"), 717s }, 717s ) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3280: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'dim2' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ___________ TestZarrWriteEmpty.test_zarr_fill_value_setting[3-float] ___________ 717s 717s self = 717s dtype = 717s 717s @requires_dask 717s @pytest.mark.parametrize("dtype", [int, float]) 717s def test_zarr_fill_value_setting(self, dtype): 717s # When zarr_format=2, _FillValue sets fill_value 717s # When zarr_format=3, fill_value is set independently 717s # We test this by writing a dask array with compute=False, 717s # on read we should receive chunks filled with `fill_value` 717s fv = -1 717s ds = xr.Dataset( 717s {"foo": ("x", dask.array.from_array(np.array([0, 0, 0], dtype=dtype)))} 717s ) 717s expected = xr.Dataset({"foo": ("x", [fv] * 3)}) 717s 717s zarr_format_2 = ( 717s has_zarr_v3 and zarr.config.get("default_zarr_format") == 2 717s ) or not has_zarr_v3 717s if zarr_format_2: 717s attr = "_FillValue" 717s expected.foo.attrs[attr] = fv 717s else: 717s attr = "fill_value" 717s if dtype is float: 717s # for floats, Xarray inserts a default `np.nan` 717s expected.foo.attrs["_FillValue"] = np.nan 717s 717s # turn off all decoding so we see what Zarr returns to us. 717s # Since chunks, are not written, we should receive on `fill_value` 717s open_kwargs = { 717s "mask_and_scale": False, 717s "consolidated": False, 717s "use_zarr_fill_value_as_mask": False, 717s } 717s save_kwargs = dict(compute=False, consolidated=False) 717s > with self.roundtrip( 717s ds, 717s save_kwargs=ChainMap(save_kwargs, dict(encoding={"foo": {attr: fv}})), 717s open_kwargs=open_kwargs, 717s ) as actual: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3374: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 717s with self.open(store_target, **open_kwargs) as ds: 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 717s with xr.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 717s backend_ds = backend.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 717s ds = store_entrypoint.open_dataset( 717s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 717s vars, attrs = filename_or_obj.load() 717s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 717s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 717s return Frozen(dict(*args, **kwargs)) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 717s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'foo' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _______________ TestZarrWriteEmpty.test_write_empty[3-True-True] _______________ 717s 717s self = 717s consolidated = True, write_empty = True 717s 717s @pytest.mark.parametrize("consolidated", [True, False, None]) 717s @pytest.mark.parametrize("write_empty", [True, False, None]) 717s def test_write_empty( 717s self, 717s consolidated: bool | None, 717s write_empty: bool | None, 717s ) -> None: 717s def assert_expected_files(expected: list[str], store: str) -> None: 717s """Convenience for comparing with actual files written""" 717s ls = [] 717s test_root = os.path.join(store, "test") 717s for root, _, files in os.walk(test_root): 717s ls.extend( 717s [ 717s os.path.join(root, f).removeprefix(test_root).lstrip("/") 717s for f in files 717s ] 717s ) 717s 717s assert set(expected) == set( 717s [ 717s file.lstrip("c/") 717s for file in ls 717s if (file not in (".zattrs", ".zarray", "zarr.json")) 717s ] 717s ) 717s 717s # The zarr format is set by the `default_zarr_format` 717s # pytest fixture that acts on a superclass 717s zarr_format_3 = has_zarr_v3 and zarr.config.config["default_zarr_format"] == 3 717s if (write_empty is False) or (write_empty is None and has_zarr_v3): 717s expected = ["0.1.0"] 717s else: 717s expected = [ 717s "0.0.0", 717s "0.0.1", 717s "0.1.0", 717s "0.1.1", 717s ] 717s 717s if zarr_format_3: 717s data = np.array([0.0, 0, 1.0, 0]).reshape((1, 2, 2)) 717s # transform to the path style of zarr 3 717s # e.g. 0/0/1 717s expected = [e.replace(".", "/") for e in expected] 717s else: 717s # use nan for default fill_value behaviour 717s data = np.array([np.nan, np.nan, 1.0, np.nan]).reshape((1, 2, 2)) 717s 717s ds = xr.Dataset(data_vars={"test": (("Z", "Y", "X"), data)}) 717s 717s if has_dask: 717s ds["test"] = ds["test"].chunk(1) 717s encoding = None 717s else: 717s encoding = {"test": {"chunks": (1, 1, 1)}} 717s 717s with self.temp_dir() as (d, store): 717s ds.to_zarr( 717s store, 717s mode="w", 717s encoding=encoding, 717s write_empty_chunks=write_empty, 717s ) 717s 717s # check expected files after a write 717s assert_expected_files(expected, store) 717s 717s > with self.roundtrip_dir( 717s ds, 717s store, 717s save_kwargs={ 717s "mode": "a", 717s "append_dim": "Z", 717s "write_empty_chunks": write_empty, 717s }, 717s ) as a_ds: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3761: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3687: in roundtrip_dir 717s data.to_zarr(store, **save_kwargs, **self.version_kwargs) 717s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 717s return to_zarr( # type: ignore[call-overload,misc] 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 717s dump_to_store(dataset, zstore, writer, encoding=encoding) 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 717s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 717s k: self.open_store_variable(name=k) for k in existing_variable_names 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'test' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ______________ TestZarrWriteEmpty.test_write_empty[3-True-False] _______________ 717s 717s self = 717s consolidated = False, write_empty = True 717s 717s @pytest.mark.parametrize("consolidated", [True, False, None]) 717s @pytest.mark.parametrize("write_empty", [True, False, None]) 717s def test_write_empty( 717s self, 717s consolidated: bool | None, 717s write_empty: bool | None, 717s ) -> None: 717s def assert_expected_files(expected: list[str], store: str) -> None: 717s """Convenience for comparing with actual files written""" 717s ls = [] 717s test_root = os.path.join(store, "test") 717s for root, _, files in os.walk(test_root): 717s ls.extend( 717s [ 717s os.path.join(root, f).removeprefix(test_root).lstrip("/") 717s for f in files 717s ] 717s ) 717s 717s assert set(expected) == set( 717s [ 717s file.lstrip("c/") 717s for file in ls 717s if (file not in (".zattrs", ".zarray", "zarr.json")) 717s ] 717s ) 717s 717s # The zarr format is set by the `default_zarr_format` 717s # pytest fixture that acts on a superclass 717s zarr_format_3 = has_zarr_v3 and zarr.config.config["default_zarr_format"] == 3 717s if (write_empty is False) or (write_empty is None and has_zarr_v3): 717s expected = ["0.1.0"] 717s else: 717s expected = [ 717s "0.0.0", 717s "0.0.1", 717s "0.1.0", 717s "0.1.1", 717s ] 717s 717s if zarr_format_3: 717s data = np.array([0.0, 0, 1.0, 0]).reshape((1, 2, 2)) 717s # transform to the path style of zarr 3 717s # e.g. 0/0/1 717s expected = [e.replace(".", "/") for e in expected] 717s else: 717s # use nan for default fill_value behaviour 717s data = np.array([np.nan, np.nan, 1.0, np.nan]).reshape((1, 2, 2)) 717s 717s ds = xr.Dataset(data_vars={"test": (("Z", "Y", "X"), data)}) 717s 717s if has_dask: 717s ds["test"] = ds["test"].chunk(1) 717s encoding = None 717s else: 717s encoding = {"test": {"chunks": (1, 1, 1)}} 717s 717s with self.temp_dir() as (d, store): 717s ds.to_zarr( 717s store, 717s mode="w", 717s encoding=encoding, 717s write_empty_chunks=write_empty, 717s ) 717s 717s # check expected files after a write 717s assert_expected_files(expected, store) 717s 717s > with self.roundtrip_dir( 717s ds, 717s store, 717s save_kwargs={ 717s "mode": "a", 717s "append_dim": "Z", 717s "write_empty_chunks": write_empty, 717s }, 717s ) as a_ds: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3761: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3687: in roundtrip_dir 717s data.to_zarr(store, **save_kwargs, **self.version_kwargs) 717s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 717s return to_zarr( # type: ignore[call-overload,misc] 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 717s dump_to_store(dataset, zstore, writer, encoding=encoding) 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 717s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 717s k: self.open_store_variable(name=k) for k in existing_variable_names 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'test' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _______________ TestZarrWriteEmpty.test_write_empty[3-True-None] _______________ 717s 717s self = 717s consolidated = None, write_empty = True 717s 717s @pytest.mark.parametrize("consolidated", [True, False, None]) 717s @pytest.mark.parametrize("write_empty", [True, False, None]) 717s def test_write_empty( 717s self, 717s consolidated: bool | None, 717s write_empty: bool | None, 717s ) -> None: 717s def assert_expected_files(expected: list[str], store: str) -> None: 717s """Convenience for comparing with actual files written""" 717s ls = [] 717s test_root = os.path.join(store, "test") 717s for root, _, files in os.walk(test_root): 717s ls.extend( 717s [ 717s os.path.join(root, f).removeprefix(test_root).lstrip("/") 717s for f in files 717s ] 717s ) 717s 717s assert set(expected) == set( 717s [ 717s file.lstrip("c/") 717s for file in ls 717s if (file not in (".zattrs", ".zarray", "zarr.json")) 717s ] 717s ) 717s 717s # The zarr format is set by the `default_zarr_format` 717s # pytest fixture that acts on a superclass 717s zarr_format_3 = has_zarr_v3 and zarr.config.config["default_zarr_format"] == 3 717s if (write_empty is False) or (write_empty is None and has_zarr_v3): 717s expected = ["0.1.0"] 717s else: 717s expected = [ 717s "0.0.0", 717s "0.0.1", 717s "0.1.0", 717s "0.1.1", 717s ] 717s 717s if zarr_format_3: 717s data = np.array([0.0, 0, 1.0, 0]).reshape((1, 2, 2)) 717s # transform to the path style of zarr 3 717s # e.g. 0/0/1 717s expected = [e.replace(".", "/") for e in expected] 717s else: 717s # use nan for default fill_value behaviour 717s data = np.array([np.nan, np.nan, 1.0, np.nan]).reshape((1, 2, 2)) 717s 717s ds = xr.Dataset(data_vars={"test": (("Z", "Y", "X"), data)}) 717s 717s if has_dask: 717s ds["test"] = ds["test"].chunk(1) 717s encoding = None 717s else: 717s encoding = {"test": {"chunks": (1, 1, 1)}} 717s 717s with self.temp_dir() as (d, store): 717s ds.to_zarr( 717s store, 717s mode="w", 717s encoding=encoding, 717s write_empty_chunks=write_empty, 717s ) 717s 717s # check expected files after a write 717s assert_expected_files(expected, store) 717s 717s > with self.roundtrip_dir( 717s ds, 717s store, 717s save_kwargs={ 717s "mode": "a", 717s "append_dim": "Z", 717s "write_empty_chunks": write_empty, 717s }, 717s ) as a_ds: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3761: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3687: in roundtrip_dir 717s data.to_zarr(store, **save_kwargs, **self.version_kwargs) 717s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 717s return to_zarr( # type: ignore[call-overload,misc] 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 717s dump_to_store(dataset, zstore, writer, encoding=encoding) 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 717s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 717s k: self.open_store_variable(name=k) for k in existing_variable_names 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'test' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ______________ TestZarrWriteEmpty.test_write_empty[3-False-True] _______________ 717s 717s self = 717s consolidated = True, write_empty = False 717s 717s @pytest.mark.parametrize("consolidated", [True, False, None]) 717s @pytest.mark.parametrize("write_empty", [True, False, None]) 717s def test_write_empty( 717s self, 717s consolidated: bool | None, 717s write_empty: bool | None, 717s ) -> None: 717s def assert_expected_files(expected: list[str], store: str) -> None: 717s """Convenience for comparing with actual files written""" 717s ls = [] 717s test_root = os.path.join(store, "test") 717s for root, _, files in os.walk(test_root): 717s ls.extend( 717s [ 717s os.path.join(root, f).removeprefix(test_root).lstrip("/") 717s for f in files 717s ] 717s ) 717s 717s assert set(expected) == set( 717s [ 717s file.lstrip("c/") 717s for file in ls 717s if (file not in (".zattrs", ".zarray", "zarr.json")) 717s ] 717s ) 717s 717s # The zarr format is set by the `default_zarr_format` 717s # pytest fixture that acts on a superclass 717s zarr_format_3 = has_zarr_v3 and zarr.config.config["default_zarr_format"] == 3 717s if (write_empty is False) or (write_empty is None and has_zarr_v3): 717s expected = ["0.1.0"] 717s else: 717s expected = [ 717s "0.0.0", 717s "0.0.1", 717s "0.1.0", 717s "0.1.1", 717s ] 717s 717s if zarr_format_3: 717s data = np.array([0.0, 0, 1.0, 0]).reshape((1, 2, 2)) 717s # transform to the path style of zarr 3 717s # e.g. 0/0/1 717s expected = [e.replace(".", "/") for e in expected] 717s else: 717s # use nan for default fill_value behaviour 717s data = np.array([np.nan, np.nan, 1.0, np.nan]).reshape((1, 2, 2)) 717s 717s ds = xr.Dataset(data_vars={"test": (("Z", "Y", "X"), data)}) 717s 717s if has_dask: 717s ds["test"] = ds["test"].chunk(1) 717s encoding = None 717s else: 717s encoding = {"test": {"chunks": (1, 1, 1)}} 717s 717s with self.temp_dir() as (d, store): 717s ds.to_zarr( 717s store, 717s mode="w", 717s encoding=encoding, 717s write_empty_chunks=write_empty, 717s ) 717s 717s # check expected files after a write 717s assert_expected_files(expected, store) 717s 717s > with self.roundtrip_dir( 717s ds, 717s store, 717s save_kwargs={ 717s "mode": "a", 717s "append_dim": "Z", 717s "write_empty_chunks": write_empty, 717s }, 717s ) as a_ds: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3761: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3687: in roundtrip_dir 717s data.to_zarr(store, **save_kwargs, **self.version_kwargs) 717s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 717s return to_zarr( # type: ignore[call-overload,misc] 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 717s dump_to_store(dataset, zstore, writer, encoding=encoding) 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 717s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 717s k: self.open_store_variable(name=k) for k in existing_variable_names 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'test' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ______________ TestZarrWriteEmpty.test_write_empty[3-False-False] ______________ 717s 717s self = 717s consolidated = False, write_empty = False 717s 717s @pytest.mark.parametrize("consolidated", [True, False, None]) 717s @pytest.mark.parametrize("write_empty", [True, False, None]) 717s def test_write_empty( 717s self, 717s consolidated: bool | None, 717s write_empty: bool | None, 717s ) -> None: 717s def assert_expected_files(expected: list[str], store: str) -> None: 717s """Convenience for comparing with actual files written""" 717s ls = [] 717s test_root = os.path.join(store, "test") 717s for root, _, files in os.walk(test_root): 717s ls.extend( 717s [ 717s os.path.join(root, f).removeprefix(test_root).lstrip("/") 717s for f in files 717s ] 717s ) 717s 717s assert set(expected) == set( 717s [ 717s file.lstrip("c/") 717s for file in ls 717s if (file not in (".zattrs", ".zarray", "zarr.json")) 717s ] 717s ) 717s 717s # The zarr format is set by the `default_zarr_format` 717s # pytest fixture that acts on a superclass 717s zarr_format_3 = has_zarr_v3 and zarr.config.config["default_zarr_format"] == 3 717s if (write_empty is False) or (write_empty is None and has_zarr_v3): 717s expected = ["0.1.0"] 717s else: 717s expected = [ 717s "0.0.0", 717s "0.0.1", 717s "0.1.0", 717s "0.1.1", 717s ] 717s 717s if zarr_format_3: 717s data = np.array([0.0, 0, 1.0, 0]).reshape((1, 2, 2)) 717s # transform to the path style of zarr 3 717s # e.g. 0/0/1 717s expected = [e.replace(".", "/") for e in expected] 717s else: 717s # use nan for default fill_value behaviour 717s data = np.array([np.nan, np.nan, 1.0, np.nan]).reshape((1, 2, 2)) 717s 717s ds = xr.Dataset(data_vars={"test": (("Z", "Y", "X"), data)}) 717s 717s if has_dask: 717s ds["test"] = ds["test"].chunk(1) 717s encoding = None 717s else: 717s encoding = {"test": {"chunks": (1, 1, 1)}} 717s 717s with self.temp_dir() as (d, store): 717s ds.to_zarr( 717s store, 717s mode="w", 717s encoding=encoding, 717s write_empty_chunks=write_empty, 717s ) 717s 717s # check expected files after a write 717s assert_expected_files(expected, store) 717s 717s > with self.roundtrip_dir( 717s ds, 717s store, 717s save_kwargs={ 717s "mode": "a", 717s "append_dim": "Z", 717s "write_empty_chunks": write_empty, 717s }, 717s ) as a_ds: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3761: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3687: in roundtrip_dir 717s data.to_zarr(store, **save_kwargs, **self.version_kwargs) 717s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 717s return to_zarr( # type: ignore[call-overload,misc] 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 717s dump_to_store(dataset, zstore, writer, encoding=encoding) 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 717s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 717s k: self.open_store_variable(name=k) for k in existing_variable_names 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'test' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s ______________ TestZarrWriteEmpty.test_write_empty[3-False-None] _______________ 717s 717s self = 717s consolidated = None, write_empty = False 717s 717s @pytest.mark.parametrize("consolidated", [True, False, None]) 717s @pytest.mark.parametrize("write_empty", [True, False, None]) 717s def test_write_empty( 717s self, 717s consolidated: bool | None, 717s write_empty: bool | None, 717s ) -> None: 717s def assert_expected_files(expected: list[str], store: str) -> None: 717s """Convenience for comparing with actual files written""" 717s ls = [] 717s test_root = os.path.join(store, "test") 717s for root, _, files in os.walk(test_root): 717s ls.extend( 717s [ 717s os.path.join(root, f).removeprefix(test_root).lstrip("/") 717s for f in files 717s ] 717s ) 717s 717s assert set(expected) == set( 717s [ 717s file.lstrip("c/") 717s for file in ls 717s if (file not in (".zattrs", ".zarray", "zarr.json")) 717s ] 717s ) 717s 717s # The zarr format is set by the `default_zarr_format` 717s # pytest fixture that acts on a superclass 717s zarr_format_3 = has_zarr_v3 and zarr.config.config["default_zarr_format"] == 3 717s if (write_empty is False) or (write_empty is None and has_zarr_v3): 717s expected = ["0.1.0"] 717s else: 717s expected = [ 717s "0.0.0", 717s "0.0.1", 717s "0.1.0", 717s "0.1.1", 717s ] 717s 717s if zarr_format_3: 717s data = np.array([0.0, 0, 1.0, 0]).reshape((1, 2, 2)) 717s # transform to the path style of zarr 3 717s # e.g. 0/0/1 717s expected = [e.replace(".", "/") for e in expected] 717s else: 717s # use nan for default fill_value behaviour 717s data = np.array([np.nan, np.nan, 1.0, np.nan]).reshape((1, 2, 2)) 717s 717s ds = xr.Dataset(data_vars={"test": (("Z", "Y", "X"), data)}) 717s 717s if has_dask: 717s ds["test"] = ds["test"].chunk(1) 717s encoding = None 717s else: 717s encoding = {"test": {"chunks": (1, 1, 1)}} 717s 717s with self.temp_dir() as (d, store): 717s ds.to_zarr( 717s store, 717s mode="w", 717s encoding=encoding, 717s write_empty_chunks=write_empty, 717s ) 717s 717s # check expected files after a write 717s assert_expected_files(expected, store) 717s 717s > with self.roundtrip_dir( 717s ds, 717s store, 717s save_kwargs={ 717s "mode": "a", 717s "append_dim": "Z", 717s "write_empty_chunks": write_empty, 717s }, 717s ) as a_ds: 717s 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3761: 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s /usr/lib/python3.14/contextlib.py:141: in __enter__ 717s return next(self.gen) 717s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3687: in roundtrip_dir 717s data.to_zarr(store, **save_kwargs, **self.version_kwargs) 717s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 717s return to_zarr( # type: ignore[call-overload,misc] 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 717s dump_to_store(dataset, zstore, writer, encoding=encoding) 717s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 717s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 717s k: self.open_store_variable(name=k) for k in existing_variable_names 717s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717s 717s self = , name = 'test' 717s 717s def open_store_variable(self, name): 717s zarr_array = self.members[name] 717s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 717s try_nczarr = self._mode == "r" 717s dimensions, attributes = _get_zarr_dims_and_attrs( 717s zarr_array, DIMENSION_KEY, try_nczarr 717s ) 717s attributes = dict(attributes) 717s 717s encoding = { 717s "chunks": zarr_array.chunks, 717s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 717s } 717s 717s if _zarr_v3(): 717s encoding.update( 717s { 717s "compressors": zarr_array.compressors, 717s "filters": zarr_array.filters, 717s "shards": zarr_array.shards, 717s } 717s ) 717s if self.zarr_group.metadata.zarr_format == 3: 717s encoding.update({"serializer": zarr_array.serializer}) 717s else: 717s encoding.update( 717s { 717s "compressor": zarr_array.compressor, 717s "filters": zarr_array.filters, 717s } 717s ) 717s 717s if self._use_zarr_fill_value_as_mask: 717s # Setting this attribute triggers CF decoding for missing values 717s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 717s if zarr_array.fill_value is not None: 717s attributes["_FillValue"] = zarr_array.fill_value 717s elif "_FillValue" in attributes: 717s original_zarr_dtype = zarr_array.metadata.data_type 717s attributes["_FillValue"] = FillValueCoder.decode( 717s > attributes["_FillValue"], original_zarr_dtype.value 717s ) 717s E AttributeError: 'Float64' object has no attribute 'value' 717s 717s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 717s _______________ TestZarrWriteEmpty.test_write_empty[3-None-True] _______________ 717s 717s self = 717s consolidated = True, write_empty = None 717s 717s @pytest.mark.parametrize("consolidated", [True, False, None]) 717s @pytest.mark.parametrize("write_empty", [True, False, None]) 717s def test_write_empty( 717s self, 717s consolidated: bool | None, 717s write_empty: bool | None, 717s ) -> None: 717s def assert_expected_files(expected: list[str], store: str) -> None: 717s """Convenience for comparing with actual files written""" 717s ls = [] 717s test_root = os.path.join(store, "test") 717s for root, _, files in os.walk(test_root): 717s ls.extend( 717s [ 717s os.path.join(root, f).removeprefix(test_root).lstrip("/") 717s for f in files 717s ] 717s ) 717s 717s assert set(expected) == set( 717s [ 717s file.lstrip("c/") 717s for file in ls 717s if (file not in (".zattrs", ".zarray", "zarr.json")) 717s ] 717s ) 717s 717s # The zarr format is set by the `default_zarr_format` 717s # pytest fixture that acts on a superclass 717s zarr_format_3 = has_zarr_v3 and zarr.config.config["default_zarr_format"] == 3 717s if (write_empty is False) or (write_empty is None and has_zarr_v3): 717s expected = ["0.1.0"] 717s else: 717s expected = [ 717s "0.0.0", 717s "0.0.1", 717s "0.1.0", 717s "0.1.1", 717s ] 717s 717s if zarr_format_3: 717s data = np.array([0.0, 0, 1.0, 0]).reshape((1, 2, 2)) 717s # transform to the path style of zarr 3 717s # e.g. 0/0/1 717s expected = [e.replace(".", "/") for e in expected] 717s else: 717s # use nan for default fill_value behaviour 717s data = np.array([np.nan, np.nan, 1.0, np.nan]).reshape((1, 2, 2)) 717s 717s ds = xr.Dataset(data_vars={"test": (("Z", "Y", "X"), data)}) 717s 717s if has_dask: 717s ds["test"] = ds["test"].chunk(1) 717s encoding = None 717s else: 717s encoding = {"test": {"chunks": (1, 1, 1)}} 717s 717s with self.temp_dir() as (d, store): 718s ds.to_zarr( 718s store, 718s mode="w", 718s encoding=encoding, 718s write_empty_chunks=write_empty, 718s ) 718s 718s # check expected files after a write 718s assert_expected_files(expected, store) 718s 718s > with self.roundtrip_dir( 718s ds, 718s store, 718s save_kwargs={ 718s "mode": "a", 718s "append_dim": "Z", 718s "write_empty_chunks": write_empty, 718s }, 718s ) as a_ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3761: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3687: in roundtrip_dir 718s data.to_zarr(store, **save_kwargs, **self.version_kwargs) 718s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 718s return to_zarr( # type: ignore[call-overload,misc] 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 718s dump_to_store(dataset, zstore, writer, encoding=encoding) 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 718s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 718s k: self.open_store_variable(name=k) for k in existing_variable_names 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = , name = 'test' 718s 718s def open_store_variable(self, name): 718s zarr_array = self.members[name] 718s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 718s try_nczarr = self._mode == "r" 718s dimensions, attributes = _get_zarr_dims_and_attrs( 718s zarr_array, DIMENSION_KEY, try_nczarr 718s ) 718s attributes = dict(attributes) 718s 718s encoding = { 718s "chunks": zarr_array.chunks, 718s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 718s } 718s 718s if _zarr_v3(): 718s encoding.update( 718s { 718s "compressors": zarr_array.compressors, 718s "filters": zarr_array.filters, 718s "shards": zarr_array.shards, 718s } 718s ) 718s if self.zarr_group.metadata.zarr_format == 3: 718s encoding.update({"serializer": zarr_array.serializer}) 718s else: 718s encoding.update( 718s { 718s "compressor": zarr_array.compressor, 718s "filters": zarr_array.filters, 718s } 718s ) 718s 718s if self._use_zarr_fill_value_as_mask: 718s # Setting this attribute triggers CF decoding for missing values 718s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 718s if zarr_array.fill_value is not None: 718s attributes["_FillValue"] = zarr_array.fill_value 718s elif "_FillValue" in attributes: 718s original_zarr_dtype = zarr_array.metadata.data_type 718s attributes["_FillValue"] = FillValueCoder.decode( 718s > attributes["_FillValue"], original_zarr_dtype.value 718s ) 718s E AttributeError: 'Float64' object has no attribute 'value' 718s 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 718s ______________ TestZarrWriteEmpty.test_write_empty[3-None-False] _______________ 718s 718s self = 718s consolidated = False, write_empty = None 718s 718s @pytest.mark.parametrize("consolidated", [True, False, None]) 718s @pytest.mark.parametrize("write_empty", [True, False, None]) 718s def test_write_empty( 718s self, 718s consolidated: bool | None, 718s write_empty: bool | None, 718s ) -> None: 718s def assert_expected_files(expected: list[str], store: str) -> None: 718s """Convenience for comparing with actual files written""" 718s ls = [] 718s test_root = os.path.join(store, "test") 718s for root, _, files in os.walk(test_root): 718s ls.extend( 718s [ 718s os.path.join(root, f).removeprefix(test_root).lstrip("/") 718s for f in files 718s ] 718s ) 718s 718s assert set(expected) == set( 718s [ 718s file.lstrip("c/") 718s for file in ls 718s if (file not in (".zattrs", ".zarray", "zarr.json")) 718s ] 718s ) 718s 718s # The zarr format is set by the `default_zarr_format` 718s # pytest fixture that acts on a superclass 718s zarr_format_3 = has_zarr_v3 and zarr.config.config["default_zarr_format"] == 3 718s if (write_empty is False) or (write_empty is None and has_zarr_v3): 718s expected = ["0.1.0"] 718s else: 718s expected = [ 718s "0.0.0", 718s "0.0.1", 718s "0.1.0", 718s "0.1.1", 718s ] 718s 718s if zarr_format_3: 718s data = np.array([0.0, 0, 1.0, 0]).reshape((1, 2, 2)) 718s # transform to the path style of zarr 3 718s # e.g. 0/0/1 718s expected = [e.replace(".", "/") for e in expected] 718s else: 718s # use nan for default fill_value behaviour 718s data = np.array([np.nan, np.nan, 1.0, np.nan]).reshape((1, 2, 2)) 718s 718s ds = xr.Dataset(data_vars={"test": (("Z", "Y", "X"), data)}) 718s 718s if has_dask: 718s ds["test"] = ds["test"].chunk(1) 718s encoding = None 718s else: 718s encoding = {"test": {"chunks": (1, 1, 1)}} 718s 718s with self.temp_dir() as (d, store): 718s ds.to_zarr( 718s store, 718s mode="w", 718s encoding=encoding, 718s write_empty_chunks=write_empty, 718s ) 718s 718s # check expected files after a write 718s assert_expected_files(expected, store) 718s 718s > with self.roundtrip_dir( 718s ds, 718s store, 718s save_kwargs={ 718s "mode": "a", 718s "append_dim": "Z", 718s "write_empty_chunks": write_empty, 718s }, 718s ) as a_ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3761: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3687: in roundtrip_dir 718s data.to_zarr(store, **save_kwargs, **self.version_kwargs) 718s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 718s return to_zarr( # type: ignore[call-overload,misc] 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 718s dump_to_store(dataset, zstore, writer, encoding=encoding) 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 718s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 718s k: self.open_store_variable(name=k) for k in existing_variable_names 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = , name = 'test' 718s 718s def open_store_variable(self, name): 718s zarr_array = self.members[name] 718s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 718s try_nczarr = self._mode == "r" 718s dimensions, attributes = _get_zarr_dims_and_attrs( 718s zarr_array, DIMENSION_KEY, try_nczarr 718s ) 718s attributes = dict(attributes) 718s 718s encoding = { 718s "chunks": zarr_array.chunks, 718s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 718s } 718s 718s if _zarr_v3(): 718s encoding.update( 718s { 718s "compressors": zarr_array.compressors, 718s "filters": zarr_array.filters, 718s "shards": zarr_array.shards, 718s } 718s ) 718s if self.zarr_group.metadata.zarr_format == 3: 718s encoding.update({"serializer": zarr_array.serializer}) 718s else: 718s encoding.update( 718s { 718s "compressor": zarr_array.compressor, 718s "filters": zarr_array.filters, 718s } 718s ) 718s 718s if self._use_zarr_fill_value_as_mask: 718s # Setting this attribute triggers CF decoding for missing values 718s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 718s if zarr_array.fill_value is not None: 718s attributes["_FillValue"] = zarr_array.fill_value 718s elif "_FillValue" in attributes: 718s original_zarr_dtype = zarr_array.metadata.data_type 718s attributes["_FillValue"] = FillValueCoder.decode( 718s > attributes["_FillValue"], original_zarr_dtype.value 718s ) 718s E AttributeError: 'Float64' object has no attribute 'value' 718s 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 718s _______________ TestZarrWriteEmpty.test_write_empty[3-None-None] _______________ 718s 718s self = 718s consolidated = None, write_empty = None 718s 718s @pytest.mark.parametrize("consolidated", [True, False, None]) 718s @pytest.mark.parametrize("write_empty", [True, False, None]) 718s def test_write_empty( 718s self, 718s consolidated: bool | None, 718s write_empty: bool | None, 718s ) -> None: 718s def assert_expected_files(expected: list[str], store: str) -> None: 718s """Convenience for comparing with actual files written""" 718s ls = [] 718s test_root = os.path.join(store, "test") 718s for root, _, files in os.walk(test_root): 718s ls.extend( 718s [ 718s os.path.join(root, f).removeprefix(test_root).lstrip("/") 718s for f in files 718s ] 718s ) 718s 718s assert set(expected) == set( 718s [ 718s file.lstrip("c/") 718s for file in ls 718s if (file not in (".zattrs", ".zarray", "zarr.json")) 718s ] 718s ) 718s 718s # The zarr format is set by the `default_zarr_format` 718s # pytest fixture that acts on a superclass 718s zarr_format_3 = has_zarr_v3 and zarr.config.config["default_zarr_format"] == 3 718s if (write_empty is False) or (write_empty is None and has_zarr_v3): 718s expected = ["0.1.0"] 718s else: 718s expected = [ 718s "0.0.0", 718s "0.0.1", 718s "0.1.0", 718s "0.1.1", 718s ] 718s 718s if zarr_format_3: 718s data = np.array([0.0, 0, 1.0, 0]).reshape((1, 2, 2)) 718s # transform to the path style of zarr 3 718s # e.g. 0/0/1 718s expected = [e.replace(".", "/") for e in expected] 718s else: 718s # use nan for default fill_value behaviour 718s data = np.array([np.nan, np.nan, 1.0, np.nan]).reshape((1, 2, 2)) 718s 718s ds = xr.Dataset(data_vars={"test": (("Z", "Y", "X"), data)}) 718s 718s if has_dask: 718s ds["test"] = ds["test"].chunk(1) 718s encoding = None 718s else: 718s encoding = {"test": {"chunks": (1, 1, 1)}} 718s 718s with self.temp_dir() as (d, store): 718s ds.to_zarr( 718s store, 718s mode="w", 718s encoding=encoding, 718s write_empty_chunks=write_empty, 718s ) 718s 718s # check expected files after a write 718s assert_expected_files(expected, store) 718s 718s > with self.roundtrip_dir( 718s ds, 718s store, 718s save_kwargs={ 718s "mode": "a", 718s "append_dim": "Z", 718s "write_empty_chunks": write_empty, 718s }, 718s ) as a_ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3761: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3687: in roundtrip_dir 718s data.to_zarr(store, **save_kwargs, **self.version_kwargs) 718s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 718s return to_zarr( # type: ignore[call-overload,misc] 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 718s dump_to_store(dataset, zstore, writer, encoding=encoding) 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 718s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 718s k: self.open_store_variable(name=k) for k in existing_variable_names 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = , name = 'test' 718s 718s def open_store_variable(self, name): 718s zarr_array = self.members[name] 718s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 718s try_nczarr = self._mode == "r" 718s dimensions, attributes = _get_zarr_dims_and_attrs( 718s zarr_array, DIMENSION_KEY, try_nczarr 718s ) 718s attributes = dict(attributes) 718s 718s encoding = { 718s "chunks": zarr_array.chunks, 718s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 718s } 718s 718s if _zarr_v3(): 718s encoding.update( 718s { 718s "compressors": zarr_array.compressors, 718s "filters": zarr_array.filters, 718s "shards": zarr_array.shards, 718s } 718s ) 718s if self.zarr_group.metadata.zarr_format == 3: 718s encoding.update({"serializer": zarr_array.serializer}) 718s else: 718s encoding.update( 718s { 718s "compressor": zarr_array.compressor, 718s "filters": zarr_array.filters, 718s } 718s ) 718s 718s if self._use_zarr_fill_value_as_mask: 718s # Setting this attribute triggers CF decoding for missing values 718s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 718s if zarr_array.fill_value is not None: 718s attributes["_FillValue"] = zarr_array.fill_value 718s elif "_FillValue" in attributes: 718s original_zarr_dtype = zarr_array.metadata.data_type 718s attributes["_FillValue"] = FillValueCoder.decode( 718s > attributes["_FillValue"], original_zarr_dtype.value 718s ) 718s E AttributeError: 'Float64' object has no attribute 'value' 718s 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 718s ____________ TestZarrRegionAuto.test_zarr_region_auto[3-full-auto] _____________ 718s 718s self = 718s region = 'auto' 718s 718s @pytest.mark.parametrize( 718s "region", 718s [ 718s pytest.param("auto", id="full-auto"), 718s pytest.param({"x": "auto", "y": slice(6, 8)}, id="mixed-auto"), 718s ], 718s ) 718s def test_zarr_region_auto(self, region): 718s with self.create() as (target, ds): 718s ds_region = 1 + ds.isel(x=slice(2, 4), y=slice(6, 8)) 718s > self.save(target, ds_region, region=region) 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6306: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6294: in save 718s ds.to_zarr(target, **kwargs) 718s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 718s return to_zarr( # type: ignore[call-overload,misc] 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 718s dump_to_store(dataset, zstore, writer, encoding=encoding) 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 718s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 718s k: self.open_store_variable(name=k) for k in existing_variable_names 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = , name = 'test' 718s 718s def open_store_variable(self, name): 718s zarr_array = self.members[name] 718s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 718s try_nczarr = self._mode == "r" 718s dimensions, attributes = _get_zarr_dims_and_attrs( 718s zarr_array, DIMENSION_KEY, try_nczarr 718s ) 718s attributes = dict(attributes) 718s 718s encoding = { 718s "chunks": zarr_array.chunks, 718s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 718s } 718s 718s if _zarr_v3(): 718s encoding.update( 718s { 718s "compressors": zarr_array.compressors, 718s "filters": zarr_array.filters, 718s "shards": zarr_array.shards, 718s } 718s ) 718s if self.zarr_group.metadata.zarr_format == 3: 718s encoding.update({"serializer": zarr_array.serializer}) 718s else: 718s encoding.update( 718s { 718s "compressor": zarr_array.compressor, 718s "filters": zarr_array.filters, 718s } 718s ) 718s 718s if self._use_zarr_fill_value_as_mask: 718s # Setting this attribute triggers CF decoding for missing values 718s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 718s if zarr_array.fill_value is not None: 718s attributes["_FillValue"] = zarr_array.fill_value 718s elif "_FillValue" in attributes: 718s original_zarr_dtype = zarr_array.metadata.data_type 718s attributes["_FillValue"] = FillValueCoder.decode( 718s > attributes["_FillValue"], original_zarr_dtype.value 718s ) 718s E AttributeError: 'Float64' object has no attribute 'value' 718s 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 718s ____________ TestZarrRegionAuto.test_zarr_region_auto[3-mixed-auto] ____________ 718s 718s self = 718s region = {'x': slice(np.int64(2), np.int64(4), None), 'y': slice(6, 8, None)} 718s 718s @pytest.mark.parametrize( 718s "region", 718s [ 718s pytest.param("auto", id="full-auto"), 718s pytest.param({"x": "auto", "y": slice(6, 8)}, id="mixed-auto"), 718s ], 718s ) 718s def test_zarr_region_auto(self, region): 718s with self.create() as (target, ds): 718s ds_region = 1 + ds.isel(x=slice(2, 4), y=slice(6, 8)) 718s > self.save(target, ds_region, region=region) 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6306: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6294: in save 718s ds.to_zarr(target, **kwargs) 718s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 718s return to_zarr( # type: ignore[call-overload,misc] 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 718s dump_to_store(dataset, zstore, writer, encoding=encoding) 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 718s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 718s k: self.open_store_variable(name=k) for k in existing_variable_names 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = , name = 'test' 718s 718s def open_store_variable(self, name): 718s zarr_array = self.members[name] 718s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 718s try_nczarr = self._mode == "r" 718s dimensions, attributes = _get_zarr_dims_and_attrs( 718s zarr_array, DIMENSION_KEY, try_nczarr 718s ) 718s attributes = dict(attributes) 718s 718s encoding = { 718s "chunks": zarr_array.chunks, 718s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 718s } 718s 718s if _zarr_v3(): 718s encoding.update( 718s { 718s "compressors": zarr_array.compressors, 718s "filters": zarr_array.filters, 718s "shards": zarr_array.shards, 718s } 718s ) 718s if self.zarr_group.metadata.zarr_format == 3: 718s encoding.update({"serializer": zarr_array.serializer}) 718s else: 718s encoding.update( 718s { 718s "compressor": zarr_array.compressor, 718s "filters": zarr_array.filters, 718s } 718s ) 718s 718s if self._use_zarr_fill_value_as_mask: 718s # Setting this attribute triggers CF decoding for missing values 718s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 718s if zarr_array.fill_value is not None: 718s attributes["_FillValue"] = zarr_array.fill_value 718s elif "_FillValue" in attributes: 718s original_zarr_dtype = zarr_array.metadata.data_type 718s attributes["_FillValue"] = FillValueCoder.decode( 718s > attributes["_FillValue"], original_zarr_dtype.value 718s ) 718s E AttributeError: 'Float64' object has no attribute 'value' 718s 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 718s ______________ TestZarrRegionAuto.test_zarr_region_index_write[3] ______________ 718s 718s self = 718s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_zarr_region_index_write_30') 718s 718s def test_zarr_region_index_write(self, tmp_path): 718s region: Mapping[str, slice] | Literal["auto"] 718s region_slice = dict(x=slice(2, 4), y=slice(6, 8)) 718s 718s with self.create() as (target, ds): 718s ds_region = 1 + ds.isel(region_slice) 718s for region in [region_slice, "auto"]: # type: ignore[assignment] 718s with patch.object( 718s ZarrStore, 718s "set_variables", 718s side_effect=ZarrStore.set_variables, 718s autospec=True, 718s ) as mock: 718s > self.save(target, ds_region, region=region, mode="r+") 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6336: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6294: in save 718s ds.to_zarr(target, **kwargs) 718s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 718s return to_zarr( # type: ignore[call-overload,misc] 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 718s dump_to_store(dataset, zstore, writer, encoding=encoding) 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 718s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 718s k: self.open_store_variable(name=k) for k in existing_variable_names 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = , name = 'test' 718s 718s def open_store_variable(self, name): 718s zarr_array = self.members[name] 718s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 718s try_nczarr = self._mode == "r" 718s dimensions, attributes = _get_zarr_dims_and_attrs( 718s zarr_array, DIMENSION_KEY, try_nczarr 718s ) 718s attributes = dict(attributes) 718s 718s encoding = { 718s "chunks": zarr_array.chunks, 718s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 718s } 718s 718s if _zarr_v3(): 718s encoding.update( 718s { 718s "compressors": zarr_array.compressors, 718s "filters": zarr_array.filters, 718s "shards": zarr_array.shards, 718s } 718s ) 718s if self.zarr_group.metadata.zarr_format == 3: 718s encoding.update({"serializer": zarr_array.serializer}) 718s else: 718s encoding.update( 718s { 718s "compressor": zarr_array.compressor, 718s "filters": zarr_array.filters, 718s } 718s ) 718s 718s if self._use_zarr_fill_value_as_mask: 718s # Setting this attribute triggers CF decoding for missing values 718s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 718s if zarr_array.fill_value is not None: 718s attributes["_FillValue"] = zarr_array.fill_value 718s elif "_FillValue" in attributes: 718s original_zarr_dtype = zarr_array.metadata.data_type 718s attributes["_FillValue"] = FillValueCoder.decode( 718s > attributes["_FillValue"], original_zarr_dtype.value 718s ) 718s E AttributeError: 'Float64' object has no attribute 'value' 718s 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 718s ____________________ TestZarrRegionAuto.test_zarr_region[3] ____________________ 718s 718s self = 718s 718s def test_zarr_region(self): 718s with self.create() as (target, ds): 718s ds_transposed = ds.transpose("y", "x") 718s ds_region = 1 + ds_transposed.isel(x=[0], y=[0]) 718s > self.save(target, ds_region, region={"x": slice(0, 1), "y": slice(0, 1)}) 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6369: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6294: in save 718s ds.to_zarr(target, **kwargs) 718s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 718s return to_zarr( # type: ignore[call-overload,misc] 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 718s dump_to_store(dataset, zstore, writer, encoding=encoding) 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 718s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 718s k: self.open_store_variable(name=k) for k in existing_variable_names 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = , name = 'test' 718s 718s def open_store_variable(self, name): 718s zarr_array = self.members[name] 718s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 718s try_nczarr = self._mode == "r" 718s dimensions, attributes = _get_zarr_dims_and_attrs( 718s zarr_array, DIMENSION_KEY, try_nczarr 718s ) 718s attributes = dict(attributes) 718s 718s encoding = { 718s "chunks": zarr_array.chunks, 718s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 718s } 718s 718s if _zarr_v3(): 718s encoding.update( 718s { 718s "compressors": zarr_array.compressors, 718s "filters": zarr_array.filters, 718s "shards": zarr_array.shards, 718s } 718s ) 718s if self.zarr_group.metadata.zarr_format == 3: 718s encoding.update({"serializer": zarr_array.serializer}) 718s else: 718s encoding.update( 718s { 718s "compressor": zarr_array.compressor, 718s "filters": zarr_array.filters, 718s } 718s ) 718s 718s if self._use_zarr_fill_value_as_mask: 718s # Setting this attribute triggers CF decoding for missing values 718s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 718s if zarr_array.fill_value is not None: 718s attributes["_FillValue"] = zarr_array.fill_value 718s elif "_FillValue" in attributes: 718s original_zarr_dtype = zarr_array.metadata.data_type 718s attributes["_FillValue"] = FillValueCoder.decode( 718s > attributes["_FillValue"], original_zarr_dtype.value 718s ) 718s E AttributeError: 'Float64' object has no attribute 'value' 718s 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 718s _____________ TestZarrRegionAuto.test_zarr_append_chunk_partial[3] _____________ 718s 718s self = 718s 718s @requires_dask 718s def test_zarr_append_chunk_partial(self): 718s t_coords = np.array([np.datetime64("2020-01-01").astype("datetime64[ns]")]) 718s data = np.ones((10, 10)) 718s 718s da = xr.DataArray( 718s data.reshape((-1, 10, 10)), 718s dims=["time", "x", "y"], 718s coords={"time": t_coords}, 718s name="foo", 718s ) 718s new_time = np.array([np.datetime64("2021-01-01").astype("datetime64[ns]")]) 718s da2 = xr.DataArray( 718s data.reshape((-1, 10, 10)), 718s dims=["time", "x", "y"], 718s coords={"time": new_time}, 718s name="foo", 718s ) 718s 718s with self.create_zarr_target() as target: 718s self.save(target, da, mode="w", encoding={"foo": {"chunks": (5, 5, 1)}}) 718s 718s with pytest.raises(ValueError, match="encoding was provided"): 718s self.save( 718s target, 718s da2, 718s append_dim="time", 718s mode="a", 718s encoding={"foo": {"chunks": (1, 1, 1)}}, 718s ) 718s 718s # chunking with dask sidesteps the encoding check, so we need a different check 718s with pytest.raises(ValueError, match="Specified zarr chunks"): 718s > self.save( 718s target, 718s da2.chunk({"x": 1, "y": 1, "time": 1}), 718s append_dim="time", 718s mode="a", 718s ) 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6426: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6294: in save 718s ds.to_zarr(target, **kwargs) 718s /usr/lib/python3/dist-packages/xarray/core/dataarray.py:4466: in to_zarr 718s return to_zarr( # type: ignore[call-overload,misc] 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 718s dump_to_store(dataset, zstore, writer, encoding=encoding) 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 718s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 718s k: self.open_store_variable(name=k) for k in existing_variable_names 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = , name = 'foo' 718s 718s def open_store_variable(self, name): 718s zarr_array = self.members[name] 718s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 718s try_nczarr = self._mode == "r" 718s dimensions, attributes = _get_zarr_dims_and_attrs( 718s zarr_array, DIMENSION_KEY, try_nczarr 718s ) 718s attributes = dict(attributes) 718s 718s encoding = { 718s "chunks": zarr_array.chunks, 718s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 718s } 718s 718s if _zarr_v3(): 718s encoding.update( 718s { 718s "compressors": zarr_array.compressors, 718s "filters": zarr_array.filters, 718s "shards": zarr_array.shards, 718s } 718s ) 718s if self.zarr_group.metadata.zarr_format == 3: 718s encoding.update({"serializer": zarr_array.serializer}) 718s else: 718s encoding.update( 718s { 718s "compressor": zarr_array.compressor, 718s "filters": zarr_array.filters, 718s } 718s ) 718s 718s if self._use_zarr_fill_value_as_mask: 718s # Setting this attribute triggers CF decoding for missing values 718s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 718s if zarr_array.fill_value is not None: 718s attributes["_FillValue"] = zarr_array.fill_value 718s elif "_FillValue" in attributes: 718s original_zarr_dtype = zarr_array.metadata.data_type 718s attributes["_FillValue"] = FillValueCoder.decode( 718s > attributes["_FillValue"], original_zarr_dtype.value 718s ) 718s E AttributeError: 'Float64' object has no attribute 'value' 718s 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 718s _________ TestZarrRegionAuto.test_zarr_region_chunk_partial_offset[3] __________ 718s 718s self = 718s 718s @requires_dask 718s def test_zarr_region_chunk_partial_offset(self): 718s # https://github.com/pydata/xarray/pull/8459#issuecomment-1819417545 718s with self.create_zarr_target() as store: 718s data = np.ones((30,)) 718s da = xr.DataArray( 718s data, dims=["x"], coords={"x": range(30)}, name="foo" 718s ).chunk(x=10) 718s self.save(store, da, compute=False) 718s 718s > self.save(store, da.isel(x=slice(10)).chunk(x=(10,)), region="auto") 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6443: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6294: in save 718s ds.to_zarr(target, **kwargs) 718s /usr/lib/python3/dist-packages/xarray/core/dataarray.py:4466: in to_zarr 718s return to_zarr( # type: ignore[call-overload,misc] 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 718s dump_to_store(dataset, zstore, writer, encoding=encoding) 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 718s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 718s k: self.open_store_variable(name=k) for k in existing_variable_names 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = , name = 'foo' 718s 718s def open_store_variable(self, name): 718s zarr_array = self.members[name] 718s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 718s try_nczarr = self._mode == "r" 718s dimensions, attributes = _get_zarr_dims_and_attrs( 718s zarr_array, DIMENSION_KEY, try_nczarr 718s ) 718s attributes = dict(attributes) 718s 718s encoding = { 718s "chunks": zarr_array.chunks, 718s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 718s } 718s 718s if _zarr_v3(): 718s encoding.update( 718s { 718s "compressors": zarr_array.compressors, 718s "filters": zarr_array.filters, 718s "shards": zarr_array.shards, 718s } 718s ) 718s if self.zarr_group.metadata.zarr_format == 3: 718s encoding.update({"serializer": zarr_array.serializer}) 718s else: 718s encoding.update( 718s { 718s "compressor": zarr_array.compressor, 718s "filters": zarr_array.filters, 718s } 718s ) 718s 718s if self._use_zarr_fill_value_as_mask: 718s # Setting this attribute triggers CF decoding for missing values 718s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 718s if zarr_array.fill_value is not None: 718s attributes["_FillValue"] = zarr_array.fill_value 718s elif "_FillValue" in attributes: 718s original_zarr_dtype = zarr_array.metadata.data_type 718s attributes["_FillValue"] = FillValueCoder.decode( 718s > attributes["_FillValue"], original_zarr_dtype.value 718s ) 718s E AttributeError: 'Float64' object has no attribute 'value' 718s 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 718s ____________ TestZarrRegionAuto.test_zarr_safe_chunk_append_dim[3] _____________ 718s 718s self = 718s 718s @requires_dask 718s def test_zarr_safe_chunk_append_dim(self): 718s with self.create_zarr_target() as store: 718s data = np.ones((20,)) 718s da = xr.DataArray( 718s data, dims=["x"], coords={"x": range(20)}, name="foo" 718s ).chunk(x=5) 718s 718s self.save(store, da.isel(x=slice(0, 7)), safe_chunks=True, mode="w") 718s with pytest.raises(ValueError): 718s # If the first chunk is smaller than the border size then raise an error 718s > self.save( 718s store, 718s da.isel(x=slice(7, 11)).chunk(x=(2, 2)), 718s append_dim="x", 718s safe_chunks=True, 718s ) 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6468: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6294: in save 718s ds.to_zarr(target, **kwargs) 718s /usr/lib/python3/dist-packages/xarray/core/dataarray.py:4466: in to_zarr 718s return to_zarr( # type: ignore[call-overload,misc] 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 718s dump_to_store(dataset, zstore, writer, encoding=encoding) 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 718s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 718s k: self.open_store_variable(name=k) for k in existing_variable_names 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = , name = 'foo' 718s 718s def open_store_variable(self, name): 718s zarr_array = self.members[name] 718s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 718s try_nczarr = self._mode == "r" 718s dimensions, attributes = _get_zarr_dims_and_attrs( 718s zarr_array, DIMENSION_KEY, try_nczarr 718s ) 718s attributes = dict(attributes) 718s 718s encoding = { 718s "chunks": zarr_array.chunks, 718s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 718s } 718s 718s if _zarr_v3(): 718s encoding.update( 718s { 718s "compressors": zarr_array.compressors, 718s "filters": zarr_array.filters, 718s "shards": zarr_array.shards, 718s } 718s ) 718s if self.zarr_group.metadata.zarr_format == 3: 718s encoding.update({"serializer": zarr_array.serializer}) 718s else: 718s encoding.update( 718s { 718s "compressor": zarr_array.compressor, 718s "filters": zarr_array.filters, 718s } 718s ) 718s 718s if self._use_zarr_fill_value_as_mask: 718s # Setting this attribute triggers CF decoding for missing values 718s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 718s if zarr_array.fill_value is not None: 718s attributes["_FillValue"] = zarr_array.fill_value 718s elif "_FillValue" in attributes: 718s original_zarr_dtype = zarr_array.metadata.data_type 718s attributes["_FillValue"] = FillValueCoder.decode( 718s > attributes["_FillValue"], original_zarr_dtype.value 718s ) 718s E AttributeError: 'Float64' object has no attribute 'value' 718s 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 718s _____________ TestZarrRegionAuto.test_zarr_safe_chunk_region[3-r+] _____________ 718s 718s self = 718s mode = 'r+' 718s 718s @requires_dask 718s @pytest.mark.parametrize("mode", ["r+", "a"]) 718s def test_zarr_safe_chunk_region(self, mode: Literal["r+", "a"]): 718s with self.create_zarr_target() as store: 718s arr = xr.DataArray( 718s list(range(11)), dims=["a"], coords={"a": list(range(11))}, name="foo" 718s ).chunk(a=3) 718s self.save(store, arr, mode="w") 718s 718s with pytest.raises(ValueError): 718s # There are two Dask chunks on the same Zarr chunk, 718s # which means that it is unsafe in any mode 718s self.save( 718s store, 718s arr.isel(a=slice(0, 3)).chunk(a=(2, 1)), 718s region="auto", 718s mode=mode, 718s ) 718s 718s with pytest.raises(ValueError): 718s # the first chunk is covering the border size, but it is not 718s # completely covering the second chunk, which means that it is 718s # unsafe in any mode 718s self.save( 718s store, 718s arr.isel(a=slice(1, 5)).chunk(a=(3, 1)), 718s region="auto", 718s mode=mode, 718s ) 718s 718s with pytest.raises(ValueError): 718s # The first chunk is safe but the other two chunks are overlapping with 718s # the same Zarr chunk 718s self.save( 718s store, 718s arr.isel(a=slice(0, 5)).chunk(a=(3, 1, 1)), 718s region="auto", 718s mode=mode, 718s ) 718s 718s # Fully update two contiguous chunks is safe in any mode 718s self.save(store, arr.isel(a=slice(3, 9)), region="auto", mode=mode) 718s 718s # The last chunk is considered full based on their current size (2) 718s self.save(store, arr.isel(a=slice(9, 11)), region="auto", mode=mode) 718s self.save( 718s store, arr.isel(a=slice(6, None)).chunk(a=-1), region="auto", mode=mode 718s ) 718s 718s # Write the last chunk of a region partially is safe in "a" mode 718s self.save(store, arr.isel(a=slice(3, 8)), region="auto", mode="a") 718s with pytest.raises(ValueError): 718s # with "r+" mode it is invalid to write partial chunk 718s self.save(store, arr.isel(a=slice(3, 8)), region="auto", mode="r+") 718s 718s # This is safe with mode "a", the border size is covered by the first chunk of Dask 718s self.save( 718s store, arr.isel(a=slice(1, 4)).chunk(a=(2, 1)), region="auto", mode="a" 718s ) 718s with pytest.raises(ValueError): 718s # This is considered unsafe in mode "r+" because it is writing in a partial chunk 718s self.save( 718s store, 718s arr.isel(a=slice(1, 4)).chunk(a=(2, 1)), 718s region="auto", 718s mode="r+", 718s ) 718s 718s # This is safe on mode "a" because there is a single dask chunk 718s self.save( 718s store, arr.isel(a=slice(1, 5)).chunk(a=(4,)), region="auto", mode="a" 718s ) 718s with pytest.raises(ValueError): 718s # This is unsafe on mode "r+", because the Dask chunk is partially writing 718s # in the first chunk of Zarr 718s self.save( 718s store, 718s arr.isel(a=slice(1, 5)).chunk(a=(4,)), 718s region="auto", 718s mode="r+", 718s ) 718s 718s # The first chunk is completely covering the first Zarr chunk 718s # and the last chunk is a partial one 718s self.save( 718s store, arr.isel(a=slice(0, 5)).chunk(a=(3, 2)), region="auto", mode="a" 718s ) 718s 718s with pytest.raises(ValueError): 718s # The last chunk is partial, so it is considered unsafe on mode "r+" 718s self.save( 718s store, 718s arr.isel(a=slice(0, 5)).chunk(a=(3, 2)), 718s region="auto", 718s mode="r+", 718s ) 718s 718s # The first chunk is covering the border size (2 elements) 718s # and also the second chunk (3 elements), so it is valid 718s self.save( 718s store, arr.isel(a=slice(1, 8)).chunk(a=(5, 2)), region="auto", mode="a" 718s ) 718s 718s with pytest.raises(ValueError): 718s # The first chunk is not fully covering the first zarr chunk 718s self.save( 718s store, 718s arr.isel(a=slice(1, 8)).chunk(a=(5, 2)), 718s region="auto", 718s mode="r+", 718s ) 718s 718s with pytest.raises(ValueError): 718s # Validate that the border condition is not affecting the "r+" mode 718s self.save(store, arr.isel(a=slice(1, 9)), region="auto", mode="r+") 718s 718s self.save(store, arr.isel(a=slice(10, 11)), region="auto", mode="a") 718s with pytest.raises(ValueError): 718s # Validate that even if we write with a single Dask chunk on the last Zarr 718s # chunk it is still unsafe if it is not fully covering it 718s # (the last Zarr chunk has size 2) 718s self.save(store, arr.isel(a=slice(10, 11)), region="auto", mode="r+") 718s 718s # Validate the same as the above test but in the beginning of the last chunk 718s self.save(store, arr.isel(a=slice(9, 10)), region="auto", mode="a") 718s with pytest.raises(ValueError): 718s self.save(store, arr.isel(a=slice(9, 10)), region="auto", mode="r+") 718s 718s self.save( 718s store, arr.isel(a=slice(7, None)).chunk(a=-1), region="auto", mode="a" 718s ) 718s with pytest.raises(ValueError): 718s # Test that even a Dask chunk that covers the last Zarr chunk can be unsafe 718s # if it is partial covering other Zarr chunks 718s self.save( 718s store, 718s arr.isel(a=slice(7, None)).chunk(a=-1), 718s region="auto", 718s mode="r+", 718s ) 718s 718s with pytest.raises(ValueError): 718s # If the chunk is of size equal to the one in the Zarr encoding, but 718s # it is partially writing in the first chunk then raise an error 718s self.save( 718s store, 718s arr.isel(a=slice(8, None)).chunk(a=3), 718s region="auto", 718s mode="r+", 718s ) 718s 718s with pytest.raises(ValueError): 718s self.save( 718s store, arr.isel(a=slice(5, -1)).chunk(a=5), region="auto", mode="r+" 718s ) 718s 718s # Test if the code is detecting the last chunk correctly 718s data = np.random.default_rng(0).random((2920, 25, 53)) 718s ds = xr.Dataset({"temperature": (("time", "lat", "lon"), data)}) 718s chunks = {"time": 1000, "lat": 25, "lon": 53} 718s self.save(store, ds.chunk(chunks), compute=False, mode="w") 718s region = {"time": slice(1000, 2000, 1)} 718s chunk = ds.isel(region) 718s chunk = chunk.chunk() 718s > self.save(store, chunk.chunk(), region=region) 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6691: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6294: in save 718s ds.to_zarr(target, **kwargs) 718s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 718s return to_zarr( # type: ignore[call-overload,misc] 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 718s dump_to_store(dataset, zstore, writer, encoding=encoding) 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 718s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 718s k: self.open_store_variable(name=k) for k in existing_variable_names 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = 718s name = 'temperature' 718s 718s def open_store_variable(self, name): 718s zarr_array = self.members[name] 718s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 718s try_nczarr = self._mode == "r" 718s dimensions, attributes = _get_zarr_dims_and_attrs( 718s zarr_array, DIMENSION_KEY, try_nczarr 718s ) 718s attributes = dict(attributes) 718s 718s encoding = { 718s "chunks": zarr_array.chunks, 718s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 718s } 718s 718s if _zarr_v3(): 718s encoding.update( 718s { 718s "compressors": zarr_array.compressors, 718s "filters": zarr_array.filters, 718s "shards": zarr_array.shards, 718s } 718s ) 718s if self.zarr_group.metadata.zarr_format == 3: 718s encoding.update({"serializer": zarr_array.serializer}) 718s else: 718s encoding.update( 718s { 718s "compressor": zarr_array.compressor, 718s "filters": zarr_array.filters, 718s } 718s ) 718s 718s if self._use_zarr_fill_value_as_mask: 718s # Setting this attribute triggers CF decoding for missing values 718s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 718s if zarr_array.fill_value is not None: 718s attributes["_FillValue"] = zarr_array.fill_value 718s elif "_FillValue" in attributes: 718s original_zarr_dtype = zarr_array.metadata.data_type 718s attributes["_FillValue"] = FillValueCoder.decode( 718s > attributes["_FillValue"], original_zarr_dtype.value 718s ) 718s E AttributeError: 'Float64' object has no attribute 'value' 718s 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 718s _____________ TestZarrRegionAuto.test_zarr_safe_chunk_region[3-a] ______________ 718s 718s self = 718s mode = 'a' 718s 718s @requires_dask 718s @pytest.mark.parametrize("mode", ["r+", "a"]) 718s def test_zarr_safe_chunk_region(self, mode: Literal["r+", "a"]): 718s with self.create_zarr_target() as store: 718s arr = xr.DataArray( 718s list(range(11)), dims=["a"], coords={"a": list(range(11))}, name="foo" 718s ).chunk(a=3) 718s self.save(store, arr, mode="w") 718s 718s with pytest.raises(ValueError): 718s # There are two Dask chunks on the same Zarr chunk, 718s # which means that it is unsafe in any mode 718s self.save( 718s store, 718s arr.isel(a=slice(0, 3)).chunk(a=(2, 1)), 718s region="auto", 718s mode=mode, 718s ) 718s 718s with pytest.raises(ValueError): 718s # the first chunk is covering the border size, but it is not 718s # completely covering the second chunk, which means that it is 718s # unsafe in any mode 718s self.save( 718s store, 718s arr.isel(a=slice(1, 5)).chunk(a=(3, 1)), 718s region="auto", 718s mode=mode, 718s ) 718s 718s with pytest.raises(ValueError): 718s # The first chunk is safe but the other two chunks are overlapping with 718s # the same Zarr chunk 718s self.save( 718s store, 718s arr.isel(a=slice(0, 5)).chunk(a=(3, 1, 1)), 718s region="auto", 718s mode=mode, 718s ) 718s 718s # Fully update two contiguous chunks is safe in any mode 718s self.save(store, arr.isel(a=slice(3, 9)), region="auto", mode=mode) 718s 718s # The last chunk is considered full based on their current size (2) 718s self.save(store, arr.isel(a=slice(9, 11)), region="auto", mode=mode) 718s self.save( 718s store, arr.isel(a=slice(6, None)).chunk(a=-1), region="auto", mode=mode 718s ) 718s 718s # Write the last chunk of a region partially is safe in "a" mode 718s self.save(store, arr.isel(a=slice(3, 8)), region="auto", mode="a") 718s with pytest.raises(ValueError): 718s # with "r+" mode it is invalid to write partial chunk 718s self.save(store, arr.isel(a=slice(3, 8)), region="auto", mode="r+") 718s 718s # This is safe with mode "a", the border size is covered by the first chunk of Dask 718s self.save( 718s store, arr.isel(a=slice(1, 4)).chunk(a=(2, 1)), region="auto", mode="a" 718s ) 718s with pytest.raises(ValueError): 718s # This is considered unsafe in mode "r+" because it is writing in a partial chunk 718s self.save( 718s store, 718s arr.isel(a=slice(1, 4)).chunk(a=(2, 1)), 718s region="auto", 718s mode="r+", 718s ) 718s 718s # This is safe on mode "a" because there is a single dask chunk 718s self.save( 718s store, arr.isel(a=slice(1, 5)).chunk(a=(4,)), region="auto", mode="a" 718s ) 718s with pytest.raises(ValueError): 718s # This is unsafe on mode "r+", because the Dask chunk is partially writing 718s # in the first chunk of Zarr 718s self.save( 718s store, 718s arr.isel(a=slice(1, 5)).chunk(a=(4,)), 718s region="auto", 718s mode="r+", 718s ) 718s 718s # The first chunk is completely covering the first Zarr chunk 718s # and the last chunk is a partial one 718s self.save( 718s store, arr.isel(a=slice(0, 5)).chunk(a=(3, 2)), region="auto", mode="a" 718s ) 718s 718s with pytest.raises(ValueError): 718s # The last chunk is partial, so it is considered unsafe on mode "r+" 718s self.save( 718s store, 718s arr.isel(a=slice(0, 5)).chunk(a=(3, 2)), 718s region="auto", 718s mode="r+", 718s ) 718s 718s # The first chunk is covering the border size (2 elements) 718s # and also the second chunk (3 elements), so it is valid 718s self.save( 718s store, arr.isel(a=slice(1, 8)).chunk(a=(5, 2)), region="auto", mode="a" 718s ) 718s 718s with pytest.raises(ValueError): 718s # The first chunk is not fully covering the first zarr chunk 718s self.save( 718s store, 718s arr.isel(a=slice(1, 8)).chunk(a=(5, 2)), 718s region="auto", 718s mode="r+", 718s ) 718s 718s with pytest.raises(ValueError): 718s # Validate that the border condition is not affecting the "r+" mode 718s self.save(store, arr.isel(a=slice(1, 9)), region="auto", mode="r+") 718s 718s self.save(store, arr.isel(a=slice(10, 11)), region="auto", mode="a") 718s with pytest.raises(ValueError): 718s # Validate that even if we write with a single Dask chunk on the last Zarr 718s # chunk it is still unsafe if it is not fully covering it 718s # (the last Zarr chunk has size 2) 718s self.save(store, arr.isel(a=slice(10, 11)), region="auto", mode="r+") 718s 718s # Validate the same as the above test but in the beginning of the last chunk 718s self.save(store, arr.isel(a=slice(9, 10)), region="auto", mode="a") 718s with pytest.raises(ValueError): 718s self.save(store, arr.isel(a=slice(9, 10)), region="auto", mode="r+") 718s 718s self.save( 718s store, arr.isel(a=slice(7, None)).chunk(a=-1), region="auto", mode="a" 718s ) 718s with pytest.raises(ValueError): 718s # Test that even a Dask chunk that covers the last Zarr chunk can be unsafe 718s # if it is partial covering other Zarr chunks 718s self.save( 718s store, 718s arr.isel(a=slice(7, None)).chunk(a=-1), 718s region="auto", 718s mode="r+", 718s ) 718s 718s with pytest.raises(ValueError): 718s # If the chunk is of size equal to the one in the Zarr encoding, but 718s # it is partially writing in the first chunk then raise an error 718s self.save( 718s store, 718s arr.isel(a=slice(8, None)).chunk(a=3), 718s region="auto", 718s mode="r+", 718s ) 718s 718s with pytest.raises(ValueError): 718s self.save( 718s store, arr.isel(a=slice(5, -1)).chunk(a=5), region="auto", mode="r+" 718s ) 718s 718s # Test if the code is detecting the last chunk correctly 718s data = np.random.default_rng(0).random((2920, 25, 53)) 718s ds = xr.Dataset({"temperature": (("time", "lat", "lon"), data)}) 718s chunks = {"time": 1000, "lat": 25, "lon": 53} 718s self.save(store, ds.chunk(chunks), compute=False, mode="w") 718s region = {"time": slice(1000, 2000, 1)} 718s chunk = ds.isel(region) 718s chunk = chunk.chunk() 718s > self.save(store, chunk.chunk(), region=region) 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6691: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6294: in save 718s ds.to_zarr(target, **kwargs) 718s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 718s return to_zarr( # type: ignore[call-overload,misc] 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 718s dump_to_store(dataset, zstore, writer, encoding=encoding) 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 718s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 718s k: self.open_store_variable(name=k) for k in existing_variable_names 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = 718s name = 'temperature' 718s 718s def open_store_variable(self, name): 718s zarr_array = self.members[name] 718s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 718s try_nczarr = self._mode == "r" 718s dimensions, attributes = _get_zarr_dims_and_attrs( 718s zarr_array, DIMENSION_KEY, try_nczarr 718s ) 718s attributes = dict(attributes) 718s 718s encoding = { 718s "chunks": zarr_array.chunks, 718s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 718s } 718s 718s if _zarr_v3(): 718s encoding.update( 718s { 718s "compressors": zarr_array.compressors, 718s "filters": zarr_array.filters, 718s "shards": zarr_array.shards, 718s } 718s ) 718s if self.zarr_group.metadata.zarr_format == 3: 718s encoding.update({"serializer": zarr_array.serializer}) 718s else: 718s encoding.update( 718s { 718s "compressor": zarr_array.compressor, 718s "filters": zarr_array.filters, 718s } 718s ) 718s 718s if self._use_zarr_fill_value_as_mask: 718s # Setting this attribute triggers CF decoding for missing values 718s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 718s if zarr_array.fill_value is not None: 718s attributes["_FillValue"] = zarr_array.fill_value 718s elif "_FillValue" in attributes: 718s original_zarr_dtype = zarr_array.metadata.data_type 718s attributes["_FillValue"] = FillValueCoder.decode( 718s > attributes["_FillValue"], original_zarr_dtype.value 718s ) 718s E AttributeError: 'Float64' object has no attribute 'value' 718s 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 718s _____________ TestScipyFilePath.test_roundtrip_example_1_netcdf_gz _____________ 718s 718s self = 718s 718s def test_roundtrip_example_1_netcdf_gz(self) -> None: 718s with open_example_dataset("example_1.nc.gz") as expected: 718s > with open_example_dataset("example_1.nc") as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3940: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:164: in open_example_dataset 718s return open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _____________ TestGenericNetCDFData.test_zero_dimensional_variable _____________ 718s 718s self = 718s 718s def test_zero_dimensional_variable(self) -> None: 718s expected = create_test_data() 718s expected["float_var"] = ([], 1.0e9, {"units": "units of awesome"}) 718s expected["bytes_var"] = ([], b"foobar") 718s expected["string_var"] = ([], "foobar") 718s > with self.roundtrip(expected) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:408: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:374: in roundtrip 718s with self.open(path, **open_kwargs) as ds: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ________________ TestGenericNetCDFData.test_roundtrip_test_data ________________ 718s 718s self = 718s 718s def test_roundtrip_test_data(self) -> None: 718s expected = create_test_data() 718s > with self.roundtrip(expected) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:441: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:374: in roundtrip 718s with self.open(path, **open_kwargs) as ds: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _______________________ TestGenericNetCDFData.test_load ________________________ 718s 718s self = 718s 718s def test_load(self) -> None: 718s expected = create_test_data() 718s 718s @contextlib.contextmanager 718s def assert_loads(vars=None): 718s if vars is None: 718s vars = expected 718s with self.roundtrip(expected) as actual: 718s for k, v in actual.variables.items(): 718s # IndexVariables are eagerly loaded into memory 718s assert v._in_memory == (k in actual.dims) 718s yield actual 718s for k, v in actual.variables.items(): 718s if k in vars: 718s assert v._in_memory 718s assert_identical(expected, actual) 718s 718s with pytest.raises(AssertionError): 718s # make sure the contextmanager works! 718s > with assert_loads() as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:464: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:452: in assert_loads 718s with self.roundtrip(expected) as actual: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:374: in roundtrip 718s with self.open(path, **open_kwargs) as ds: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s __________________ TestGenericNetCDFData.test_dataset_compute __________________ 718s 718s self = 718s 718s def test_dataset_compute(self) -> None: 718s expected = create_test_data() 718s 718s > with self.roundtrip(expected) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:481: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:374: in roundtrip 718s with self.open(path, **open_kwargs) as ds: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ______________________ TestGenericNetCDFData.test_pickle _______________________ 718s 718s self = 718s 718s def test_pickle(self) -> None: 718s expected = Dataset({"foo": ("x", [42])}) 718s > with self.roundtrip(expected, allow_cleanup_failure=ON_WINDOWS) as roundtripped: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:499: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:374: in roundtrip 718s with self.open(path, **open_kwargs) as ds: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _________________ TestGenericNetCDFData.test_pickle_dataarray __________________ 718s 718s self = 718s 718s @pytest.mark.filterwarnings("ignore:deallocating CachingFileManager") 718s def test_pickle_dataarray(self) -> None: 718s expected = Dataset({"foo": ("x", [42])}) 718s > with self.roundtrip(expected, allow_cleanup_failure=ON_WINDOWS) as roundtripped: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:509: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:374: in roundtrip 718s with self.open(path, **open_kwargs) as ds: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s __________________ TestGenericNetCDFData.test_dataset_caching __________________ 718s 718s self = 718s 718s def test_dataset_caching(self) -> None: 718s expected = Dataset({"foo": ("x", [5, 6, 7])}) 718s > with self.roundtrip(expected) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:519: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:374: in roundtrip 718s with self.open(path, **open_kwargs) as ds: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ______________ TestGenericNetCDFData.test_roundtrip_None_variable ______________ 718s 718s self = 718s 718s @pytest.mark.filterwarnings("ignore:deallocating CachingFileManager") 718s def test_roundtrip_None_variable(self) -> None: 718s expected = Dataset({None: (("x", "y"), [[0, 1], [2, 3]])}) 718s > with self.roundtrip(expected) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:534: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:374: in roundtrip 718s with self.open(path, **open_kwargs) as ds: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ______________ TestGenericNetCDFData.test_roundtrip_object_dtype _______________ 718s 718s self = 718s 718s def test_roundtrip_object_dtype(self) -> None: 718s floats = np.array([0.0, 0.0, 1.0, 2.0, 3.0], dtype=object) 718s floats_nans = np.array([np.nan, np.nan, 1.0, 2.0, 3.0], dtype=object) 718s bytes_ = np.array([b"ab", b"cdef", b"g"], dtype=object) 718s bytes_nans = np.array([b"ab", b"cdef", np.nan], dtype=object) 718s strings = np.array(["ab", "cdef", "g"], dtype=object) 718s strings_nans = np.array(["ab", "cdef", np.nan], dtype=object) 718s all_nans = np.array([np.nan, np.nan], dtype=object) 718s original = Dataset( 718s { 718s "floats": ("a", floats), 718s "floats_nans": ("a", floats_nans), 718s "bytes": ("b", bytes_), 718s "bytes_nans": ("b", bytes_nans), 718s "strings": ("b", strings), 718s "strings_nans": ("b", strings_nans), 718s "all_nans": ("c", all_nans), 718s "nan": ([], np.nan), 718s } 718s ) 718s expected = original.copy(deep=True) 718s > with self.roundtrip(original) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:558: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:374: in roundtrip 718s with self.open(path, **open_kwargs) as ds: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _______________ TestGenericNetCDFData.test_roundtrip_string_data _______________ 718s 718s self = 718s 718s def test_roundtrip_string_data(self) -> None: 718s expected = Dataset({"x": ("t", ["ab", "cdef"])}) 718s > with self.roundtrip(expected) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:575: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:374: in roundtrip 718s with self.open(path, **open_kwargs) as ds: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ________ TestGenericNetCDFData.test_roundtrip_string_encoded_characters ________ 718s 718s self = 718s 718s def test_roundtrip_string_encoded_characters(self) -> None: 718s expected = Dataset({"x": ("t", ["ab", "cdef"])}) 718s expected["x"].encoding["dtype"] = "S1" 718s > with self.roundtrip(expected) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:581: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:374: in roundtrip 718s with self.open(path, **open_kwargs) as ds: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ___________ TestGenericNetCDFData.test_roundtrip_numpy_datetime_data ___________ 718s 718s self = 718s 718s def test_roundtrip_numpy_datetime_data(self) -> None: 718s times = pd.to_datetime(["2000-01-01", "2000-01-02", "NaT"], unit="ns") 718s expected = Dataset({"t": ("t", times), "t0": times[0]}) 718s kwargs = {"encoding": {"t0": {"units": "days since 1950-01-01"}}} 718s > with self.roundtrip(expected, save_kwargs=kwargs) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:594: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:374: in roundtrip 718s with self.open(path, **open_kwargs) as ds: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s __________ TestGenericNetCDFData.test_roundtrip_cftime_datetime_data ___________ 718s 718s self = 718s 718s @requires_cftime 718s def test_roundtrip_cftime_datetime_data(self) -> None: 718s from xarray.tests.test_coding_times import _all_cftime_date_types 718s 718s date_types = _all_cftime_date_types() 718s for date_type in date_types.values(): 718s times = [date_type(1, 1, 1), date_type(1, 1, 2)] 718s expected = Dataset({"t": ("t", times), "t0": times[0]}) 718s kwargs = {"encoding": {"t0": {"units": "days since 0001-01-01"}}} 718s expected_decoded_t = np.array(times) 718s expected_decoded_t0 = np.array([date_type(1, 1, 1)]) 718s expected_calendar = times[0].calendar 718s 718s with warnings.catch_warnings(): 718s if expected_calendar in {"proleptic_gregorian", "standard"}: 718s warnings.filterwarnings("ignore", "Unable to decode time axis") 718s 718s > with self.roundtrip(expected, save_kwargs=kwargs) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:615: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:374: in roundtrip 718s with self.open(path, **open_kwargs) as ds: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _____________ TestGenericNetCDFData.test_roundtrip_timedelta_data ______________ 718s 718s self = 718s 718s def test_roundtrip_timedelta_data(self) -> None: 718s # todo: suggestion from review: 718s # roundtrip large microsecond or coarser resolution timedeltas, 718s # though we cannot test that until we fix the timedelta decoding 718s # to support large ranges 718s time_deltas = pd.to_timedelta(["1h", "2h", "NaT"]).as_unit("s") # type: ignore[arg-type, unused-ignore] 718s expected = Dataset({"td": ("td", time_deltas), "td0": time_deltas[0]}) 718s > with self.roundtrip( 718s expected, open_kwargs={"decode_timedelta": CFTimedeltaCoder(time_unit="ns")} 718s ) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:639: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:374: in roundtrip 718s with self.open(path, **open_kwargs) as ds: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ______________ TestGenericNetCDFData.test_roundtrip_float64_data _______________ 718s 718s self = 718s 718s def test_roundtrip_float64_data(self) -> None: 718s expected = Dataset({"x": ("y", np.array([1.0, 2.0, np.pi], dtype="float64"))}) 718s > with self.roundtrip(expected) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:646: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:374: in roundtrip 718s with self.open(path, **open_kwargs) as ds: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _______________ TestGenericNetCDFData.test_roundtrip_coordinates _______________ 718s 718s self = 718s 718s def test_roundtrip_coordinates(self) -> None: 718s original = Dataset( 718s {"foo": ("x", [0, 1])}, {"x": [2, 3], "y": ("a", [42]), "z": ("x", [4, 5])} 718s ) 718s 718s > with self.roundtrip(original) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:664: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:374: in roundtrip 718s with self.open(path, **open_kwargs) as ds: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ___________ TestGenericNetCDFData.test_roundtrip_global_coordinates ____________ 718s 718s self = 718s 718s def test_roundtrip_global_coordinates(self) -> None: 718s original = Dataset( 718s {"foo": ("x", [0, 1])}, {"x": [2, 3], "y": ("a", [42]), "z": ("x", [4, 5])} 718s ) 718s > with self.roundtrip(original) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:679: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:374: in roundtrip 718s with self.open(path, **open_kwargs) as ds: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _________ TestGenericNetCDFData.test_roundtrip_coordinates_with_space __________ 718s 718s self = 718s 718s def test_roundtrip_coordinates_with_space(self) -> None: 718s original = Dataset(coords={"x": 0, "y z": 1}) 718s expected = Dataset({"y z": 1}, {"x": 0}) 718s with pytest.warns(SerializationWarning): 718s > with self.roundtrip(original) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:696: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:374: in roundtrip 718s with self.open(path, **open_kwargs) as ds: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ______________ TestGenericNetCDFData.test_roundtrip_boolean_dtype ______________ 718s 718s self = 718s 718s def test_roundtrip_boolean_dtype(self) -> None: 718s original = create_boolean_data() 718s assert original["x"].dtype == "bool" 718s > with self.roundtrip(original) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:702: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:374: in roundtrip 718s with self.open(path, **open_kwargs) as ds: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ________________ TestGenericNetCDFData.test_orthogonal_indexing ________________ 718s 718s self = 718s 718s def test_orthogonal_indexing(self) -> None: 718s in_memory = create_test_data() 718s > with self.roundtrip(in_memory) as on_disk: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:713: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:374: in roundtrip 718s with self.open(path, **open_kwargs) as ds: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ________________ TestGenericNetCDFData.test_vectorized_indexing ________________ 718s 718s self = 718s 718s def test_vectorized_indexing(self) -> None: 718s in_memory = create_test_data() 718s > with self.roundtrip(in_memory) as on_disk: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:727: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:374: in roundtrip 718s with self.open(path, **open_kwargs) as ds: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _________ TestGenericNetCDFData.test_vectorized_indexing_negative_step _________ 718s 718s self = 718s 718s def test_vectorized_indexing_negative_step(self) -> None: 718s # use dask explicitly when present 718s open_kwargs: dict[str, Any] | None 718s if has_dask: 718s open_kwargs = {"chunks": {}} 718s else: 718s open_kwargs = None 718s in_memory = create_test_data() 718s 718s def multiple_indexing(indexers): 718s # make sure a sequence of lazy indexings certainly works. 718s with self.roundtrip(in_memory, open_kwargs=open_kwargs) as on_disk: 718s actual = on_disk["var3"] 718s expected = in_memory["var3"] 718s for ind in indexers: 718s actual = actual.isel(ind) 718s expected = expected.isel(ind) 718s # make sure the array is not yet loaded into memory 718s assert not actual.variable._in_memory 718s assert_identical(expected, actual.load()) 718s 718s # with negative step slice. 718s indexers = [ 718s { 718s "dim1": DataArray([[0, 7], [2, 6], [3, 5]], dims=["a", "b"]), 718s "dim3": slice(-1, 1, -1), 718s } 718s ] 718s > multiple_indexing(indexers) 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:817: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:800: in multiple_indexing 718s with self.roundtrip(in_memory, open_kwargs=open_kwargs) as on_disk: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:374: in roundtrip 718s with self.open(path, **open_kwargs) as ds: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ______________ TestGenericNetCDFData.test_outer_indexing_reversed ______________ 718s 718s self = 718s 718s def test_outer_indexing_reversed(self) -> None: 718s # regression test for GH6560 718s ds = xr.Dataset( 718s {"z": (("t", "p", "y", "x"), np.ones((1, 1, 31, 40)))}, 718s ) 718s 718s > with self.roundtrip(ds) as on_disk: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:834: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:374: in roundtrip 718s with self.open(path, **open_kwargs) as ds: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s __________________ TestGenericNetCDFData.test_isel_dataarray ___________________ 718s 718s self = 718s 718s def test_isel_dataarray(self) -> None: 718s # Make sure isel works lazily. GH:issue:1688 718s in_memory = create_test_data() 718s > with self.roundtrip(in_memory) as on_disk: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:841: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:374: in roundtrip 718s with self.open(path, **open_kwargs) as ds: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _____________ TestGenericNetCDFData.test_array_type_after_indexing _____________ 718s 718s self = 718s 718s def test_array_type_after_indexing(self) -> None: 718s in_memory = create_test_data() 718s > with self.roundtrip(in_memory) as on_disk: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:868: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:374: in roundtrip 718s with self.open(path, **open_kwargs) as ds: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ______________________ TestGenericNetCDFData.test_dropna _______________________ 718s 718s self = 718s 718s def test_dropna(self) -> None: 718s # regression test for GH:issue:1694 718s a = np.random.randn(4, 3) 718s a[1, 1] = np.nan 718s in_memory = xr.Dataset( 718s {"a": (("y", "x"), a)}, coords={"y": np.arange(4), "x": np.arange(3)} 718s ) 718s 718s assert_identical( 718s in_memory.dropna(dim="x"), in_memory.isel(x=slice(None, None, 2)) 718s ) 718s 718s > with self.roundtrip(in_memory) as on_disk: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:893: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:374: in roundtrip 718s with self.open(path, **open_kwargs) as ds: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ________________ TestGenericNetCDFData.test_ondisk_after_print _________________ 718s 718s self = 718s 718s def test_ondisk_after_print(self) -> None: 718s """Make sure print does not load file into memory""" 718s in_memory = create_test_data() 718s > with self.roundtrip(in_memory) as on_disk: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:902: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:374: in roundtrip 718s with self.open(path, **open_kwargs) as ds: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s __________ TestGenericNetCDFData.test_roundtrip_bytes_with_fill_value __________ 718s 718s self = 718s 718s def test_roundtrip_bytes_with_fill_value(self) -> None: 718s values = np.array([b"ab", b"cdef", np.nan], dtype=object) 718s encoding = {"_FillValue": b"X", "dtype": "S1"} 718s original = Dataset({"x": ("t", values, {}, encoding)}) 718s expected = original.copy(deep=True) 718s > with self.roundtrip(original) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:913: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:374: in roundtrip 718s with self.open(path, **open_kwargs) as ds: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _________ TestGenericNetCDFData.test_roundtrip_empty_vlen_string_array _________ 718s 718s self = 718s 718s def test_roundtrip_empty_vlen_string_array(self) -> None: 718s # checks preserving vlen dtype for empty arrays GH7862 718s dtype = create_vlen_dtype(str) 718s original = Dataset({"a": np.array([], dtype=dtype)}) 718s assert check_vlen_dtype(original["a"].dtype) is str 718s > with self.roundtrip(original) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:936: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:374: in roundtrip 718s with self.open(path, **open_kwargs) as ds: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _______ TestGenericNetCDFData.test_roundtrip_unsigned[fill_value0-False] _______ 718s 718s self = 718s fill_value = np.int8(-1), exp_fill_warning = False 718s 718s @pytest.mark.parametrize( 718s ("fill_value", "exp_fill_warning"), 718s [ 718s (np.int8(-1), False), 718s (np.uint8(255), True), 718s (-1, False), 718s (255, True), 718s ], 718s ) 718s def test_roundtrip_unsigned(self, fill_value, exp_fill_warning): 718s @contextlib.contextmanager 718s def _roundtrip_with_warnings(*args, **kwargs): 718s is_np2 = module_available("numpy", minversion="2.0.0.dev0") 718s if exp_fill_warning and is_np2: 718s warn_checker: contextlib.AbstractContextManager = pytest.warns( 718s SerializationWarning, 718s match="_FillValue attribute can't be represented", 718s ) 718s else: 718s warn_checker = contextlib.nullcontext() 718s with warn_checker: 718s with self.roundtrip(*args, **kwargs) as actual: 718s yield actual 718s 718s # regression/numpy2 test for 718s encoding = { 718s "_FillValue": fill_value, 718s "_Unsigned": "true", 718s "dtype": "i1", 718s } 718s x = np.array([0, 1, 127, 128, 254, np.nan], dtype=np.float32) 718s decoded = Dataset({"x": ("t", x, {}, encoding)}) 718s 718s attributes = { 718s "_FillValue": fill_value, 718s "_Unsigned": "true", 718s } 718s # Create unsigned data corresponding to [0, 1, 127, 128, 255] unsigned 718s sb = np.asarray([0, 1, 127, -128, -2, -1], dtype="i1") 718s encoded = Dataset({"x": ("t", sb, attributes)}) 718s unsigned_dtype = np.dtype(f"u{sb.dtype.itemsize}") 718s 718s > with _roundtrip_with_warnings(decoded) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1066: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1045: in _roundtrip_with_warnings 718s with self.roundtrip(*args, **kwargs) as actual: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:374: in roundtrip 718s with self.open(path, **open_kwargs) as ds: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _______ TestGenericNetCDFData.test_roundtrip_unsigned[fill_value1-True] ________ 718s 718s self = 718s fill_value = np.uint8(255), exp_fill_warning = True 718s 718s @pytest.mark.parametrize( 718s ("fill_value", "exp_fill_warning"), 718s [ 718s (np.int8(-1), False), 718s (np.uint8(255), True), 718s (-1, False), 718s (255, True), 718s ], 718s ) 718s def test_roundtrip_unsigned(self, fill_value, exp_fill_warning): 718s @contextlib.contextmanager 718s def _roundtrip_with_warnings(*args, **kwargs): 718s is_np2 = module_available("numpy", minversion="2.0.0.dev0") 718s if exp_fill_warning and is_np2: 718s warn_checker: contextlib.AbstractContextManager = pytest.warns( 718s SerializationWarning, 718s match="_FillValue attribute can't be represented", 718s ) 718s else: 718s warn_checker = contextlib.nullcontext() 718s with warn_checker: 718s with self.roundtrip(*args, **kwargs) as actual: 718s yield actual 718s 718s # regression/numpy2 test for 718s encoding = { 718s "_FillValue": fill_value, 718s "_Unsigned": "true", 718s "dtype": "i1", 718s } 718s x = np.array([0, 1, 127, 128, 254, np.nan], dtype=np.float32) 718s decoded = Dataset({"x": ("t", x, {}, encoding)}) 718s 718s attributes = { 718s "_FillValue": fill_value, 718s "_Unsigned": "true", 718s } 718s # Create unsigned data corresponding to [0, 1, 127, 128, 255] unsigned 718s sb = np.asarray([0, 1, 127, -128, -2, -1], dtype="i1") 718s encoded = Dataset({"x": ("t", sb, attributes)}) 718s unsigned_dtype = np.dtype(f"u{sb.dtype.itemsize}") 718s 718s > with _roundtrip_with_warnings(decoded) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1066: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1045: in _roundtrip_with_warnings 718s with self.roundtrip(*args, **kwargs) as actual: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:374: in roundtrip 718s with self.open(path, **open_kwargs) as ds: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ___________ TestGenericNetCDFData.test_roundtrip_unsigned[-1-False] ____________ 718s 718s self = 718s fill_value = -1, exp_fill_warning = False 718s 718s @pytest.mark.parametrize( 718s ("fill_value", "exp_fill_warning"), 718s [ 718s (np.int8(-1), False), 718s (np.uint8(255), True), 718s (-1, False), 718s (255, True), 718s ], 718s ) 718s def test_roundtrip_unsigned(self, fill_value, exp_fill_warning): 718s @contextlib.contextmanager 718s def _roundtrip_with_warnings(*args, **kwargs): 718s is_np2 = module_available("numpy", minversion="2.0.0.dev0") 718s if exp_fill_warning and is_np2: 718s warn_checker: contextlib.AbstractContextManager = pytest.warns( 718s SerializationWarning, 718s match="_FillValue attribute can't be represented", 718s ) 718s else: 718s warn_checker = contextlib.nullcontext() 718s with warn_checker: 718s with self.roundtrip(*args, **kwargs) as actual: 718s yield actual 718s 718s # regression/numpy2 test for 718s encoding = { 718s "_FillValue": fill_value, 718s "_Unsigned": "true", 718s "dtype": "i1", 718s } 718s x = np.array([0, 1, 127, 128, 254, np.nan], dtype=np.float32) 718s decoded = Dataset({"x": ("t", x, {}, encoding)}) 718s 718s attributes = { 718s "_FillValue": fill_value, 718s "_Unsigned": "true", 718s } 718s # Create unsigned data corresponding to [0, 1, 127, 128, 255] unsigned 718s sb = np.asarray([0, 1, 127, -128, -2, -1], dtype="i1") 718s encoded = Dataset({"x": ("t", sb, attributes)}) 718s unsigned_dtype = np.dtype(f"u{sb.dtype.itemsize}") 718s 718s > with _roundtrip_with_warnings(decoded) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1066: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1045: in _roundtrip_with_warnings 718s with self.roundtrip(*args, **kwargs) as actual: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:374: in roundtrip 718s with self.open(path, **open_kwargs) as ds: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ___________ TestGenericNetCDFData.test_roundtrip_unsigned[255-True] ____________ 718s 718s self = 718s fill_value = 255, exp_fill_warning = True 718s 718s @pytest.mark.parametrize( 718s ("fill_value", "exp_fill_warning"), 718s [ 718s (np.int8(-1), False), 718s (np.uint8(255), True), 718s (-1, False), 718s (255, True), 718s ], 718s ) 718s def test_roundtrip_unsigned(self, fill_value, exp_fill_warning): 718s @contextlib.contextmanager 718s def _roundtrip_with_warnings(*args, **kwargs): 718s is_np2 = module_available("numpy", minversion="2.0.0.dev0") 718s if exp_fill_warning and is_np2: 718s warn_checker: contextlib.AbstractContextManager = pytest.warns( 718s SerializationWarning, 718s match="_FillValue attribute can't be represented", 718s ) 718s else: 718s warn_checker = contextlib.nullcontext() 718s with warn_checker: 718s with self.roundtrip(*args, **kwargs) as actual: 718s yield actual 718s 718s # regression/numpy2 test for 718s encoding = { 718s "_FillValue": fill_value, 718s "_Unsigned": "true", 718s "dtype": "i1", 718s } 718s x = np.array([0, 1, 127, 128, 254, np.nan], dtype=np.float32) 718s decoded = Dataset({"x": ("t", x, {}, encoding)}) 718s 718s attributes = { 718s "_FillValue": fill_value, 718s "_Unsigned": "true", 718s } 718s # Create unsigned data corresponding to [0, 1, 127, 128, 255] unsigned 718s sb = np.asarray([0, 1, 127, -128, -2, -1], dtype="i1") 718s encoded = Dataset({"x": ("t", sb, attributes)}) 718s unsigned_dtype = np.dtype(f"u{sb.dtype.itemsize}") 718s 718s > with _roundtrip_with_warnings(decoded) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1066: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1045: in _roundtrip_with_warnings 718s with self.roundtrip(*args, **kwargs) as actual: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:374: in roundtrip 718s with self.open(path, **open_kwargs) as ds: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _ TestGenericNetCDFData.test_grid_mapping_and_bounds_are_not_coordinates_in_file _ 718s 718s self = 718s 718s def test_grid_mapping_and_bounds_are_not_coordinates_in_file(self) -> None: 718s original = self._create_cf_dataset() 718s > with self.roundtrip(original, open_kwargs={"decode_coords": False}) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1142: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:374: in roundtrip 718s with self.open(path, **open_kwargs) as ds: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ___ TestGenericNetCDFData.test_coordinate_variables_after_dataset_roundtrip ____ 718s 718s self = 718s 718s def test_coordinate_variables_after_dataset_roundtrip(self) -> None: 718s original = self._create_cf_dataset() 718s > with self.roundtrip(original, open_kwargs={"decode_coords": "all"}) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1150: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:374: in roundtrip 718s with self.open(path, **open_kwargs) as ds: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _ TestGenericNetCDFData.test_grid_mapping_and_bounds_are_coordinates_after_dataarray_roundtrip _ 718s 718s self = 718s 718s def test_grid_mapping_and_bounds_are_coordinates_after_dataarray_roundtrip( 718s self, 718s ) -> None: 718s original = self._create_cf_dataset() 718s # The DataArray roundtrip should have the same warnings as the 718s # Dataset, but we already tested for those, so just go for the 718s # new warnings. It would appear that there is no way to tell 718s # pytest "This warning and also this warning should both be 718s # present". 718s # xarray/tests/test_conventions.py::TestCFEncodedDataStore 718s # needs the to_dataset. The other backends should be fine 718s # without it. 718s with pytest.warns( 718s UserWarning, 718s match=( 718s r"Variable\(s\) referenced in bounds not in variables: " 718s r"\['l(at|ong)itude_bnds'\]" 718s ), 718s ): 718s > with self.roundtrip( 718s original["variable"].to_dataset(), open_kwargs={"decode_coords": "all"} 718s ) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1182: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:374: in roundtrip 718s with self.open(path, **open_kwargs) as ds: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s 718s During handling of the above exception, another exception occurred: 718s 718s self = 718s 718s def test_grid_mapping_and_bounds_are_coordinates_after_dataarray_roundtrip( 718s self, 718s ) -> None: 718s original = self._create_cf_dataset() 718s # The DataArray roundtrip should have the same warnings as the 718s # Dataset, but we already tested for those, so just go for the 718s # new warnings. It would appear that there is no way to tell 718s # pytest "This warning and also this warning should both be 718s # present". 718s # xarray/tests/test_conventions.py::TestCFEncodedDataStore 718s # needs the to_dataset. The other backends should be fine 718s # without it. 718s > with pytest.warns( 718s UserWarning, 718s match=( 718s r"Variable\(s\) referenced in bounds not in variables: " 718s r"\['l(at|ong)itude_bnds'\]" 718s ), 718s ): 718s E Failed: DID NOT WARN. No warnings of type (,) were emitted. 718s E Emitted warnings: []. 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1175: Failed 718s _______________ TestGenericNetCDFData.test_coordinates_encoding ________________ 718s 718s self = 718s 718s def test_coordinates_encoding(self) -> None: 718s def equals_latlon(obj): 718s return obj == "lat lon" or obj == "lon lat" 718s 718s original = Dataset( 718s {"temp": ("x", [0, 1]), "precip": ("x", [0, -1])}, 718s {"lat": ("x", [2, 3]), "lon": ("x", [4, 5])}, 718s ) 718s > with self.roundtrip(original) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1207: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:374: in roundtrip 718s with self.open(path, **open_kwargs) as ds: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s __________________ TestGenericNetCDFData.test_encoding_kwarg ___________________ 718s 718s self = 718s 718s def test_encoding_kwarg(self) -> None: 718s ds = Dataset({"x": ("y", np.arange(10.0))}) 718s 718s kwargs: dict[str, Any] = dict(encoding={"x": {"dtype": "f4"}}) 718s > with self.roundtrip(ds, save_kwargs=kwargs) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1277: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:374: in roundtrip 718s with self.open(path, **open_kwargs) as ds: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _______________ TestGenericNetCDFData.test_encoding_kwarg_dates ________________ 718s 718s self = 718s 718s def test_encoding_kwarg_dates(self) -> None: 718s ds = Dataset({"t": pd.date_range("2000-01-01", periods=3)}) 718s units = "days since 1900-01-01" 718s kwargs = dict(encoding={"t": {"units": units}}) 718s > with self.roundtrip(ds, save_kwargs=kwargs) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1302: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:374: in roundtrip 718s with self.open(path, **open_kwargs) as ds: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _________ TestGenericNetCDFData.test_encoding_kwarg_fixed_width_string _________ 718s 718s self = 718s 718s def test_encoding_kwarg_fixed_width_string(self) -> None: 718s # regression test for GH2149 718s for strings in [[b"foo", b"bar", b"baz"], ["foo", "bar", "baz"]]: 718s ds = Dataset({"x": strings}) 718s kwargs = dict(encoding={"x": {"dtype": "S1"}}) 718s > with self.roundtrip(ds, save_kwargs=kwargs) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1311: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:374: in roundtrip 718s with self.open(path, **open_kwargs) as ds: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ________________ TestGenericNetCDFData.test_default_fill_value _________________ 718s 718s self = 718s 718s def test_default_fill_value(self) -> None: 718s # Test default encoding for float: 718s ds = Dataset({"x": ("y", np.arange(10.0))}) 718s kwargs = dict(encoding={"x": {"dtype": "f4"}}) 718s > with self.roundtrip(ds, save_kwargs=kwargs) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1319: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:374: in roundtrip 718s with self.open(path, **open_kwargs) as ds: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ____________ TestGenericNetCDFData.test_explicitly_omit_fill_value _____________ 718s 718s self = 718s 718s def test_explicitly_omit_fill_value(self) -> None: 718s ds = Dataset({"x": ("y", [np.pi, -np.pi])}) 718s ds.x.encoding["_FillValue"] = None 718s > with self.roundtrip(ds) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1341: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:374: in roundtrip 718s with self.open(path, **open_kwargs) as ds: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ___ TestGenericNetCDFData.test_explicitly_omit_fill_value_via_encoding_kwarg ___ 718s 718s self = 718s 718s def test_explicitly_omit_fill_value_via_encoding_kwarg(self) -> None: 718s ds = Dataset({"x": ("y", [np.pi, -np.pi])}) 718s kwargs = dict(encoding={"x": {"_FillValue": None}}) 718s # _FillValue is not a valid encoding for Zarr 718s > with self.roundtrip(ds, save_kwargs=kwargs) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1348: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:374: in roundtrip 718s with self.open(path, **open_kwargs) as ds: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ________ TestGenericNetCDFData.test_explicitly_omit_fill_value_in_coord ________ 718s 718s self = 718s 718s def test_explicitly_omit_fill_value_in_coord(self) -> None: 718s ds = Dataset({"x": ("y", [np.pi, -np.pi])}, coords={"y": [0.0, 1.0]}) 718s ds.y.encoding["_FillValue"] = None 718s > with self.roundtrip(ds) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1355: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:374: in roundtrip 718s with self.open(path, **open_kwargs) as ds: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _ TestGenericNetCDFData.test_explicitly_omit_fill_value_in_coord_via_encoding_kwarg _ 718s 718s self = 718s 718s def test_explicitly_omit_fill_value_in_coord_via_encoding_kwarg(self) -> None: 718s ds = Dataset({"x": ("y", [np.pi, -np.pi])}, coords={"y": [0.0, 1.0]}) 718s kwargs = dict(encoding={"y": {"_FillValue": None}}) 718s > with self.roundtrip(ds, save_kwargs=kwargs) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1361: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:374: in roundtrip 718s with self.open(path, **open_kwargs) as ds: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ________________ TestGenericNetCDFData.test_encoding_same_dtype ________________ 718s 718s self = 718s 718s def test_encoding_same_dtype(self) -> None: 718s ds = Dataset({"x": ("y", np.arange(10.0, dtype="f4"))}) 718s kwargs = dict(encoding={"x": {"dtype": "f4"}}) 718s > with self.roundtrip(ds, save_kwargs=kwargs) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1368: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:374: in roundtrip 718s with self.open(path, **open_kwargs) as ds: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ___________________ TestGenericNetCDFData.test_append_write ____________________ 718s 718s self = 718s 718s def test_append_write(self) -> None: 718s # regression for GH1215 718s data = create_test_data() 718s > with self.roundtrip_append(data) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1377: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:389: in roundtrip_append 718s with self.open(path, **open_kwargs) as ds: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ______________ TestGenericNetCDFData.test_append_overwrite_values ______________ 718s 718s self = 718s 718s def test_append_overwrite_values(self) -> None: 718s # regression for GH1215 718s data = create_test_data() 718s with create_tmp_file(allow_cleanup_failure=False) as tmp_file: 718s self.save(data, tmp_file, mode="w") 718s data["var2"][:] = -999 718s data["var9"] = data["var2"] * 3 718s self.save(data[["var2", "var9"]], tmp_file, mode="a") 718s > with self.open(tmp_file) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1388: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ____________ TestGenericNetCDFData.test_multiindex_not_implemented _____________ 718s 718s self = 718s 718s def test_multiindex_not_implemented(self) -> None: 718s ds = Dataset(coords={"y": ("x", [1, 2]), "z": ("x", ["a", "b"])}).set_index( 718s x=["y", "z"] 718s ) 718s with pytest.raises(NotImplementedError, match=r"MultiIndex"): 718s with self.roundtrip(ds): 718s pass 718s 718s # regression GH8628 (can serialize reset multi-index level coordinates) 718s ds_reset = ds.reset_index("x") 718s > with self.roundtrip(ds_reset) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1412: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:374: in roundtrip 718s with self.open(path, **open_kwargs) as ds: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _______________ TestGenericNetCDFData.test_string_object_warning _______________ 718s 718s self = 718s 718s @requires_dask 718s def test_string_object_warning(self) -> None: 718s original = Dataset( 718s { 718s "x": ( 718s [ 718s "y", 718s ], 718s np.array(["foo", "bar"], dtype=object), 718s ) 718s } 718s ).chunk() 718s with pytest.warns(SerializationWarning, match="dask array with dtype=object"): 718s > with self.roundtrip(original) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1428: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:374: in roundtrip 718s with self.open(path, **open_kwargs) as ds: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ______________ TestGenericNetCDFData.test_encoding_unlimited_dims ______________ 718s 718s self = 718s 718s def test_encoding_unlimited_dims(self) -> None: 718s ds = Dataset({"x": ("y", np.arange(10.0))}) 718s > with self.roundtrip(ds, save_kwargs=dict(unlimited_dims=["y"])) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:4046: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:374: in roundtrip 718s with self.open(path, **open_kwargs) as ds: 718s /usr/lib/python3.14/contextlib.py:141: in __enter__ 718s return next(self.gen) 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:400: in open 718s with open_dataset(path, engine=self.engine, **kwargs) as ds: 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _ TestOpenMFDatasetWithDataVarsAndCoordsKw.test_open_mfdataset_does_same_as_concat[outer-all-nested-t] _ 718s 718s self = 718s combine = 'nested', concat_dim = 't', opt = 'all', join = 'outer' 718s 718s @pytest.mark.parametrize( 718s "combine, concat_dim", [("nested", "t"), ("by_coords", None)] 718s ) 718s @pytest.mark.parametrize("opt", ["all", "minimal", "different"]) 718s @pytest.mark.parametrize("join", ["outer", "inner", "left", "right"]) 718s def test_open_mfdataset_does_same_as_concat( 718s self, combine, concat_dim, opt, join 718s ) -> None: 718s with self.setup_files_and_datasets() as (files, [ds1, ds2]): 718s if combine == "by_coords": 718s files.reverse() 718s > with open_mfdataset( 718s files, data_vars=opt, combine=combine, concat_dim=concat_dim, join=join 718s ) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:4658: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1635: in open_mfdataset 718s datasets = [open_(p, **open_kwargs) for p in paths1d] 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _ TestOpenMFDatasetWithDataVarsAndCoordsKw.test_open_mfdataset_does_same_as_concat[outer-all-by_coords-None] _ 718s 718s self = 718s combine = 'by_coords', concat_dim = None, opt = 'all', join = 'outer' 718s 718s @pytest.mark.parametrize( 718s "combine, concat_dim", [("nested", "t"), ("by_coords", None)] 718s ) 718s @pytest.mark.parametrize("opt", ["all", "minimal", "different"]) 718s @pytest.mark.parametrize("join", ["outer", "inner", "left", "right"]) 718s def test_open_mfdataset_does_same_as_concat( 718s self, combine, concat_dim, opt, join 718s ) -> None: 718s with self.setup_files_and_datasets() as (files, [ds1, ds2]): 718s if combine == "by_coords": 718s files.reverse() 718s > with open_mfdataset( 718s files, data_vars=opt, combine=combine, concat_dim=concat_dim, join=join 718s ) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:4658: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1635: in open_mfdataset 718s datasets = [open_(p, **open_kwargs) for p in paths1d] 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _ TestOpenMFDatasetWithDataVarsAndCoordsKw.test_open_mfdataset_does_same_as_concat[outer-minimal-nested-t] _ 718s 718s self = 718s combine = 'nested', concat_dim = 't', opt = 'minimal', join = 'outer' 718s 718s @pytest.mark.parametrize( 718s "combine, concat_dim", [("nested", "t"), ("by_coords", None)] 718s ) 718s @pytest.mark.parametrize("opt", ["all", "minimal", "different"]) 718s @pytest.mark.parametrize("join", ["outer", "inner", "left", "right"]) 718s def test_open_mfdataset_does_same_as_concat( 718s self, combine, concat_dim, opt, join 718s ) -> None: 718s with self.setup_files_and_datasets() as (files, [ds1, ds2]): 718s if combine == "by_coords": 718s files.reverse() 718s > with open_mfdataset( 718s files, data_vars=opt, combine=combine, concat_dim=concat_dim, join=join 718s ) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:4658: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1635: in open_mfdataset 718s datasets = [open_(p, **open_kwargs) for p in paths1d] 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _ TestOpenMFDatasetWithDataVarsAndCoordsKw.test_open_mfdataset_does_same_as_concat[outer-minimal-by_coords-None] _ 718s 718s self = 718s combine = 'by_coords', concat_dim = None, opt = 'minimal', join = 'outer' 718s 718s @pytest.mark.parametrize( 718s "combine, concat_dim", [("nested", "t"), ("by_coords", None)] 718s ) 718s @pytest.mark.parametrize("opt", ["all", "minimal", "different"]) 718s @pytest.mark.parametrize("join", ["outer", "inner", "left", "right"]) 718s def test_open_mfdataset_does_same_as_concat( 718s self, combine, concat_dim, opt, join 718s ) -> None: 718s with self.setup_files_and_datasets() as (files, [ds1, ds2]): 718s if combine == "by_coords": 718s files.reverse() 718s > with open_mfdataset( 718s files, data_vars=opt, combine=combine, concat_dim=concat_dim, join=join 718s ) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:4658: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1635: in open_mfdataset 718s datasets = [open_(p, **open_kwargs) for p in paths1d] 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _ TestOpenMFDatasetWithDataVarsAndCoordsKw.test_open_mfdataset_does_same_as_concat[outer-different-nested-t] _ 718s 718s self = 718s combine = 'nested', concat_dim = 't', opt = 'different', join = 'outer' 718s 718s @pytest.mark.parametrize( 718s "combine, concat_dim", [("nested", "t"), ("by_coords", None)] 718s ) 718s @pytest.mark.parametrize("opt", ["all", "minimal", "different"]) 718s @pytest.mark.parametrize("join", ["outer", "inner", "left", "right"]) 718s def test_open_mfdataset_does_same_as_concat( 718s self, combine, concat_dim, opt, join 718s ) -> None: 718s with self.setup_files_and_datasets() as (files, [ds1, ds2]): 718s if combine == "by_coords": 718s files.reverse() 718s > with open_mfdataset( 718s files, data_vars=opt, combine=combine, concat_dim=concat_dim, join=join 718s ) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:4658: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1635: in open_mfdataset 718s datasets = [open_(p, **open_kwargs) for p in paths1d] 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _ TestOpenMFDatasetWithDataVarsAndCoordsKw.test_open_mfdataset_does_same_as_concat[outer-different-by_coords-None] _ 718s 718s self = 718s combine = 'by_coords', concat_dim = None, opt = 'different', join = 'outer' 718s 718s @pytest.mark.parametrize( 718s "combine, concat_dim", [("nested", "t"), ("by_coords", None)] 718s ) 718s @pytest.mark.parametrize("opt", ["all", "minimal", "different"]) 718s @pytest.mark.parametrize("join", ["outer", "inner", "left", "right"]) 718s def test_open_mfdataset_does_same_as_concat( 718s self, combine, concat_dim, opt, join 718s ) -> None: 718s with self.setup_files_and_datasets() as (files, [ds1, ds2]): 718s if combine == "by_coords": 718s files.reverse() 718s > with open_mfdataset( 718s files, data_vars=opt, combine=combine, concat_dim=concat_dim, join=join 718s ) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:4658: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1635: in open_mfdataset 718s datasets = [open_(p, **open_kwargs) for p in paths1d] 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _ TestOpenMFDatasetWithDataVarsAndCoordsKw.test_open_mfdataset_does_same_as_concat[inner-all-nested-t] _ 718s 718s self = 718s combine = 'nested', concat_dim = 't', opt = 'all', join = 'inner' 718s 718s @pytest.mark.parametrize( 718s "combine, concat_dim", [("nested", "t"), ("by_coords", None)] 718s ) 718s @pytest.mark.parametrize("opt", ["all", "minimal", "different"]) 718s @pytest.mark.parametrize("join", ["outer", "inner", "left", "right"]) 718s def test_open_mfdataset_does_same_as_concat( 718s self, combine, concat_dim, opt, join 718s ) -> None: 718s with self.setup_files_and_datasets() as (files, [ds1, ds2]): 718s if combine == "by_coords": 718s files.reverse() 718s > with open_mfdataset( 718s files, data_vars=opt, combine=combine, concat_dim=concat_dim, join=join 718s ) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:4658: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1635: in open_mfdataset 718s datasets = [open_(p, **open_kwargs) for p in paths1d] 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _ TestOpenMFDatasetWithDataVarsAndCoordsKw.test_open_mfdataset_does_same_as_concat[inner-all-by_coords-None] _ 718s 718s self = 718s combine = 'by_coords', concat_dim = None, opt = 'all', join = 'inner' 718s 718s @pytest.mark.parametrize( 718s "combine, concat_dim", [("nested", "t"), ("by_coords", None)] 718s ) 718s @pytest.mark.parametrize("opt", ["all", "minimal", "different"]) 718s @pytest.mark.parametrize("join", ["outer", "inner", "left", "right"]) 718s def test_open_mfdataset_does_same_as_concat( 718s self, combine, concat_dim, opt, join 718s ) -> None: 718s with self.setup_files_and_datasets() as (files, [ds1, ds2]): 718s if combine == "by_coords": 718s files.reverse() 718s > with open_mfdataset( 718s files, data_vars=opt, combine=combine, concat_dim=concat_dim, join=join 718s ) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:4658: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1635: in open_mfdataset 718s datasets = [open_(p, **open_kwargs) for p in paths1d] 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _ TestOpenMFDatasetWithDataVarsAndCoordsKw.test_open_mfdataset_does_same_as_concat[inner-minimal-nested-t] _ 718s 718s self = 718s combine = 'nested', concat_dim = 't', opt = 'minimal', join = 'inner' 718s 718s @pytest.mark.parametrize( 718s "combine, concat_dim", [("nested", "t"), ("by_coords", None)] 718s ) 718s @pytest.mark.parametrize("opt", ["all", "minimal", "different"]) 718s @pytest.mark.parametrize("join", ["outer", "inner", "left", "right"]) 718s def test_open_mfdataset_does_same_as_concat( 718s self, combine, concat_dim, opt, join 718s ) -> None: 718s with self.setup_files_and_datasets() as (files, [ds1, ds2]): 718s if combine == "by_coords": 718s files.reverse() 718s > with open_mfdataset( 718s files, data_vars=opt, combine=combine, concat_dim=concat_dim, join=join 718s ) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:4658: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1635: in open_mfdataset 718s datasets = [open_(p, **open_kwargs) for p in paths1d] 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _ TestOpenMFDatasetWithDataVarsAndCoordsKw.test_open_mfdataset_does_same_as_concat[inner-minimal-by_coords-None] _ 718s 718s self = 718s combine = 'by_coords', concat_dim = None, opt = 'minimal', join = 'inner' 718s 718s @pytest.mark.parametrize( 718s "combine, concat_dim", [("nested", "t"), ("by_coords", None)] 718s ) 718s @pytest.mark.parametrize("opt", ["all", "minimal", "different"]) 718s @pytest.mark.parametrize("join", ["outer", "inner", "left", "right"]) 718s def test_open_mfdataset_does_same_as_concat( 718s self, combine, concat_dim, opt, join 718s ) -> None: 718s with self.setup_files_and_datasets() as (files, [ds1, ds2]): 718s if combine == "by_coords": 718s files.reverse() 718s > with open_mfdataset( 718s files, data_vars=opt, combine=combine, concat_dim=concat_dim, join=join 718s ) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:4658: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1635: in open_mfdataset 718s datasets = [open_(p, **open_kwargs) for p in paths1d] 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _ TestOpenMFDatasetWithDataVarsAndCoordsKw.test_open_mfdataset_does_same_as_concat[inner-different-nested-t] _ 718s 718s self = 718s combine = 'nested', concat_dim = 't', opt = 'different', join = 'inner' 718s 718s @pytest.mark.parametrize( 718s "combine, concat_dim", [("nested", "t"), ("by_coords", None)] 718s ) 718s @pytest.mark.parametrize("opt", ["all", "minimal", "different"]) 718s @pytest.mark.parametrize("join", ["outer", "inner", "left", "right"]) 718s def test_open_mfdataset_does_same_as_concat( 718s self, combine, concat_dim, opt, join 718s ) -> None: 718s with self.setup_files_and_datasets() as (files, [ds1, ds2]): 718s if combine == "by_coords": 718s files.reverse() 718s > with open_mfdataset( 718s files, data_vars=opt, combine=combine, concat_dim=concat_dim, join=join 718s ) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:4658: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1635: in open_mfdataset 718s datasets = [open_(p, **open_kwargs) for p in paths1d] 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _ TestOpenMFDatasetWithDataVarsAndCoordsKw.test_open_mfdataset_does_same_as_concat[inner-different-by_coords-None] _ 718s 718s self = 718s combine = 'by_coords', concat_dim = None, opt = 'different', join = 'inner' 718s 718s @pytest.mark.parametrize( 718s "combine, concat_dim", [("nested", "t"), ("by_coords", None)] 718s ) 718s @pytest.mark.parametrize("opt", ["all", "minimal", "different"]) 718s @pytest.mark.parametrize("join", ["outer", "inner", "left", "right"]) 718s def test_open_mfdataset_does_same_as_concat( 718s self, combine, concat_dim, opt, join 718s ) -> None: 718s with self.setup_files_and_datasets() as (files, [ds1, ds2]): 718s if combine == "by_coords": 718s files.reverse() 718s > with open_mfdataset( 718s files, data_vars=opt, combine=combine, concat_dim=concat_dim, join=join 718s ) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:4658: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1635: in open_mfdataset 718s datasets = [open_(p, **open_kwargs) for p in paths1d] 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _ TestOpenMFDatasetWithDataVarsAndCoordsKw.test_open_mfdataset_does_same_as_concat[left-all-nested-t] _ 718s 718s self = 718s combine = 'nested', concat_dim = 't', opt = 'all', join = 'left' 718s 718s @pytest.mark.parametrize( 718s "combine, concat_dim", [("nested", "t"), ("by_coords", None)] 718s ) 718s @pytest.mark.parametrize("opt", ["all", "minimal", "different"]) 718s @pytest.mark.parametrize("join", ["outer", "inner", "left", "right"]) 718s def test_open_mfdataset_does_same_as_concat( 718s self, combine, concat_dim, opt, join 718s ) -> None: 718s with self.setup_files_and_datasets() as (files, [ds1, ds2]): 718s if combine == "by_coords": 718s files.reverse() 718s > with open_mfdataset( 718s files, data_vars=opt, combine=combine, concat_dim=concat_dim, join=join 718s ) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:4658: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1635: in open_mfdataset 718s datasets = [open_(p, **open_kwargs) for p in paths1d] 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _ TestOpenMFDatasetWithDataVarsAndCoordsKw.test_open_mfdataset_does_same_as_concat[left-all-by_coords-None] _ 718s 718s self = 718s combine = 'by_coords', concat_dim = None, opt = 'all', join = 'left' 718s 718s @pytest.mark.parametrize( 718s "combine, concat_dim", [("nested", "t"), ("by_coords", None)] 718s ) 718s @pytest.mark.parametrize("opt", ["all", "minimal", "different"]) 718s @pytest.mark.parametrize("join", ["outer", "inner", "left", "right"]) 718s def test_open_mfdataset_does_same_as_concat( 718s self, combine, concat_dim, opt, join 718s ) -> None: 718s with self.setup_files_and_datasets() as (files, [ds1, ds2]): 718s if combine == "by_coords": 718s files.reverse() 718s > with open_mfdataset( 718s files, data_vars=opt, combine=combine, concat_dim=concat_dim, join=join 718s ) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:4658: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1635: in open_mfdataset 718s datasets = [open_(p, **open_kwargs) for p in paths1d] 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _ TestOpenMFDatasetWithDataVarsAndCoordsKw.test_open_mfdataset_does_same_as_concat[left-minimal-nested-t] _ 718s 718s self = 718s combine = 'nested', concat_dim = 't', opt = 'minimal', join = 'left' 718s 718s @pytest.mark.parametrize( 718s "combine, concat_dim", [("nested", "t"), ("by_coords", None)] 718s ) 718s @pytest.mark.parametrize("opt", ["all", "minimal", "different"]) 718s @pytest.mark.parametrize("join", ["outer", "inner", "left", "right"]) 718s def test_open_mfdataset_does_same_as_concat( 718s self, combine, concat_dim, opt, join 718s ) -> None: 718s with self.setup_files_and_datasets() as (files, [ds1, ds2]): 718s if combine == "by_coords": 718s files.reverse() 718s > with open_mfdataset( 718s files, data_vars=opt, combine=combine, concat_dim=concat_dim, join=join 718s ) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:4658: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1635: in open_mfdataset 718s datasets = [open_(p, **open_kwargs) for p in paths1d] 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _ TestOpenMFDatasetWithDataVarsAndCoordsKw.test_open_mfdataset_does_same_as_concat[left-minimal-by_coords-None] _ 718s 718s self = 718s combine = 'by_coords', concat_dim = None, opt = 'minimal', join = 'left' 718s 718s @pytest.mark.parametrize( 718s "combine, concat_dim", [("nested", "t"), ("by_coords", None)] 718s ) 718s @pytest.mark.parametrize("opt", ["all", "minimal", "different"]) 718s @pytest.mark.parametrize("join", ["outer", "inner", "left", "right"]) 718s def test_open_mfdataset_does_same_as_concat( 718s self, combine, concat_dim, opt, join 718s ) -> None: 718s with self.setup_files_and_datasets() as (files, [ds1, ds2]): 718s if combine == "by_coords": 718s files.reverse() 718s > with open_mfdataset( 718s files, data_vars=opt, combine=combine, concat_dim=concat_dim, join=join 718s ) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:4658: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1635: in open_mfdataset 718s datasets = [open_(p, **open_kwargs) for p in paths1d] 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _ TestOpenMFDatasetWithDataVarsAndCoordsKw.test_open_mfdataset_does_same_as_concat[left-different-nested-t] _ 718s 718s self = 718s combine = 'nested', concat_dim = 't', opt = 'different', join = 'left' 718s 718s @pytest.mark.parametrize( 718s "combine, concat_dim", [("nested", "t"), ("by_coords", None)] 718s ) 718s @pytest.mark.parametrize("opt", ["all", "minimal", "different"]) 718s @pytest.mark.parametrize("join", ["outer", "inner", "left", "right"]) 718s def test_open_mfdataset_does_same_as_concat( 718s self, combine, concat_dim, opt, join 718s ) -> None: 718s with self.setup_files_and_datasets() as (files, [ds1, ds2]): 718s if combine == "by_coords": 718s files.reverse() 718s > with open_mfdataset( 718s files, data_vars=opt, combine=combine, concat_dim=concat_dim, join=join 718s ) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:4658: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1635: in open_mfdataset 718s datasets = [open_(p, **open_kwargs) for p in paths1d] 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _ TestOpenMFDatasetWithDataVarsAndCoordsKw.test_open_mfdataset_does_same_as_concat[left-different-by_coords-None] _ 718s 718s self = 718s combine = 'by_coords', concat_dim = None, opt = 'different', join = 'left' 718s 718s @pytest.mark.parametrize( 718s "combine, concat_dim", [("nested", "t"), ("by_coords", None)] 718s ) 718s @pytest.mark.parametrize("opt", ["all", "minimal", "different"]) 718s @pytest.mark.parametrize("join", ["outer", "inner", "left", "right"]) 718s def test_open_mfdataset_does_same_as_concat( 718s self, combine, concat_dim, opt, join 718s ) -> None: 718s with self.setup_files_and_datasets() as (files, [ds1, ds2]): 718s if combine == "by_coords": 718s files.reverse() 718s > with open_mfdataset( 718s files, data_vars=opt, combine=combine, concat_dim=concat_dim, join=join 718s ) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:4658: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1635: in open_mfdataset 718s datasets = [open_(p, **open_kwargs) for p in paths1d] 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _ TestOpenMFDatasetWithDataVarsAndCoordsKw.test_open_mfdataset_does_same_as_concat[right-all-nested-t] _ 718s 718s self = 718s combine = 'nested', concat_dim = 't', opt = 'all', join = 'right' 718s 718s @pytest.mark.parametrize( 718s "combine, concat_dim", [("nested", "t"), ("by_coords", None)] 718s ) 718s @pytest.mark.parametrize("opt", ["all", "minimal", "different"]) 718s @pytest.mark.parametrize("join", ["outer", "inner", "left", "right"]) 718s def test_open_mfdataset_does_same_as_concat( 718s self, combine, concat_dim, opt, join 718s ) -> None: 718s with self.setup_files_and_datasets() as (files, [ds1, ds2]): 718s if combine == "by_coords": 718s files.reverse() 718s > with open_mfdataset( 718s files, data_vars=opt, combine=combine, concat_dim=concat_dim, join=join 718s ) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:4658: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1635: in open_mfdataset 718s datasets = [open_(p, **open_kwargs) for p in paths1d] 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _ TestOpenMFDatasetWithDataVarsAndCoordsKw.test_open_mfdataset_does_same_as_concat[right-all-by_coords-None] _ 718s 718s self = 718s combine = 'by_coords', concat_dim = None, opt = 'all', join = 'right' 718s 718s @pytest.mark.parametrize( 718s "combine, concat_dim", [("nested", "t"), ("by_coords", None)] 718s ) 718s @pytest.mark.parametrize("opt", ["all", "minimal", "different"]) 718s @pytest.mark.parametrize("join", ["outer", "inner", "left", "right"]) 718s def test_open_mfdataset_does_same_as_concat( 718s self, combine, concat_dim, opt, join 718s ) -> None: 718s with self.setup_files_and_datasets() as (files, [ds1, ds2]): 718s if combine == "by_coords": 718s files.reverse() 718s > with open_mfdataset( 718s files, data_vars=opt, combine=combine, concat_dim=concat_dim, join=join 718s ) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:4658: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1635: in open_mfdataset 718s datasets = [open_(p, **open_kwargs) for p in paths1d] 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _ TestOpenMFDatasetWithDataVarsAndCoordsKw.test_open_mfdataset_does_same_as_concat[right-minimal-nested-t] _ 718s 718s self = 718s combine = 'nested', concat_dim = 't', opt = 'minimal', join = 'right' 718s 718s @pytest.mark.parametrize( 718s "combine, concat_dim", [("nested", "t"), ("by_coords", None)] 718s ) 718s @pytest.mark.parametrize("opt", ["all", "minimal", "different"]) 718s @pytest.mark.parametrize("join", ["outer", "inner", "left", "right"]) 718s def test_open_mfdataset_does_same_as_concat( 718s self, combine, concat_dim, opt, join 718s ) -> None: 718s with self.setup_files_and_datasets() as (files, [ds1, ds2]): 718s if combine == "by_coords": 718s files.reverse() 718s > with open_mfdataset( 718s files, data_vars=opt, combine=combine, concat_dim=concat_dim, join=join 718s ) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:4658: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1635: in open_mfdataset 718s datasets = [open_(p, **open_kwargs) for p in paths1d] 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _ TestOpenMFDatasetWithDataVarsAndCoordsKw.test_open_mfdataset_does_same_as_concat[right-minimal-by_coords-None] _ 718s 718s self = 718s combine = 'by_coords', concat_dim = None, opt = 'minimal', join = 'right' 718s 718s @pytest.mark.parametrize( 718s "combine, concat_dim", [("nested", "t"), ("by_coords", None)] 718s ) 718s @pytest.mark.parametrize("opt", ["all", "minimal", "different"]) 718s @pytest.mark.parametrize("join", ["outer", "inner", "left", "right"]) 718s def test_open_mfdataset_does_same_as_concat( 718s self, combine, concat_dim, opt, join 718s ) -> None: 718s with self.setup_files_and_datasets() as (files, [ds1, ds2]): 718s if combine == "by_coords": 718s files.reverse() 718s > with open_mfdataset( 718s files, data_vars=opt, combine=combine, concat_dim=concat_dim, join=join 718s ) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:4658: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1635: in open_mfdataset 718s datasets = [open_(p, **open_kwargs) for p in paths1d] 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _ TestOpenMFDatasetWithDataVarsAndCoordsKw.test_open_mfdataset_does_same_as_concat[right-different-nested-t] _ 718s 718s self = 718s combine = 'nested', concat_dim = 't', opt = 'different', join = 'right' 718s 718s @pytest.mark.parametrize( 718s "combine, concat_dim", [("nested", "t"), ("by_coords", None)] 718s ) 718s @pytest.mark.parametrize("opt", ["all", "minimal", "different"]) 718s @pytest.mark.parametrize("join", ["outer", "inner", "left", "right"]) 718s def test_open_mfdataset_does_same_as_concat( 718s self, combine, concat_dim, opt, join 718s ) -> None: 718s with self.setup_files_and_datasets() as (files, [ds1, ds2]): 718s if combine == "by_coords": 718s files.reverse() 718s > with open_mfdataset( 718s files, data_vars=opt, combine=combine, concat_dim=concat_dim, join=join 718s ) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:4658: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1635: in open_mfdataset 718s datasets = [open_(p, **open_kwargs) for p in paths1d] 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _ TestOpenMFDatasetWithDataVarsAndCoordsKw.test_open_mfdataset_does_same_as_concat[right-different-by_coords-None] _ 718s 718s self = 718s combine = 'by_coords', concat_dim = None, opt = 'different', join = 'right' 718s 718s @pytest.mark.parametrize( 718s "combine, concat_dim", [("nested", "t"), ("by_coords", None)] 718s ) 718s @pytest.mark.parametrize("opt", ["all", "minimal", "different"]) 718s @pytest.mark.parametrize("join", ["outer", "inner", "left", "right"]) 718s def test_open_mfdataset_does_same_as_concat( 718s self, combine, concat_dim, opt, join 718s ) -> None: 718s with self.setup_files_and_datasets() as (files, [ds1, ds2]): 718s if combine == "by_coords": 718s files.reverse() 718s > with open_mfdataset( 718s files, data_vars=opt, combine=combine, concat_dim=concat_dim, join=join 718s ) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:4658: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1635: in open_mfdataset 718s datasets = [open_(p, **open_kwargs) for p in paths1d] 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _ TestOpenMFDatasetWithDataVarsAndCoordsKw.test_open_mfdataset_dataset_combine_attrs[drop] _ 718s 718s self = 718s combine_attrs = 'drop', attrs = [{'a': 1}, {'a': 2}], expected = {} 718s expect_error = False 718s 718s @pytest.mark.parametrize( 718s ["combine_attrs", "attrs", "expected", "expect_error"], 718s ( 718s pytest.param("drop", [{"a": 1}, {"a": 2}], {}, False, id="drop"), 718s pytest.param( 718s "override", [{"a": 1}, {"a": 2}], {"a": 1}, False, id="override" 718s ), 718s pytest.param( 718s "no_conflicts", [{"a": 1}, {"a": 2}], None, True, id="no_conflicts" 718s ), 718s pytest.param( 718s "identical", 718s [{"a": 1, "b": 2}, {"a": 1, "c": 3}], 718s None, 718s True, 718s id="identical", 718s ), 718s pytest.param( 718s "drop_conflicts", 718s [{"a": 1, "b": 2}, {"b": -1, "c": 3}], 718s {"a": 1, "c": 3}, 718s False, 718s id="drop_conflicts", 718s ), 718s ), 718s ) 718s def test_open_mfdataset_dataset_combine_attrs( 718s self, combine_attrs, attrs, expected, expect_error 718s ): 718s with self.setup_files_and_datasets() as (files, [ds1, ds2]): 718s # Give the files an inconsistent attribute 718s for i, f in enumerate(files): 718s > ds = open_dataset(f).load() 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:4696: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _ TestOpenMFDatasetWithDataVarsAndCoordsKw.test_open_mfdataset_dataset_combine_attrs[override] _ 718s 718s self = 718s combine_attrs = 'override', attrs = [{'a': 1}, {'a': 2}], expected = {'a': 1} 718s expect_error = False 718s 718s @pytest.mark.parametrize( 718s ["combine_attrs", "attrs", "expected", "expect_error"], 718s ( 718s pytest.param("drop", [{"a": 1}, {"a": 2}], {}, False, id="drop"), 718s pytest.param( 718s "override", [{"a": 1}, {"a": 2}], {"a": 1}, False, id="override" 718s ), 718s pytest.param( 718s "no_conflicts", [{"a": 1}, {"a": 2}], None, True, id="no_conflicts" 718s ), 718s pytest.param( 718s "identical", 718s [{"a": 1, "b": 2}, {"a": 1, "c": 3}], 718s None, 718s True, 718s id="identical", 718s ), 718s pytest.param( 718s "drop_conflicts", 718s [{"a": 1, "b": 2}, {"b": -1, "c": 3}], 718s {"a": 1, "c": 3}, 718s False, 718s id="drop_conflicts", 718s ), 718s ), 718s ) 718s def test_open_mfdataset_dataset_combine_attrs( 718s self, combine_attrs, attrs, expected, expect_error 718s ): 718s with self.setup_files_and_datasets() as (files, [ds1, ds2]): 718s # Give the files an inconsistent attribute 718s for i, f in enumerate(files): 718s > ds = open_dataset(f).load() 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:4696: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _ TestOpenMFDatasetWithDataVarsAndCoordsKw.test_open_mfdataset_dataset_combine_attrs[no_conflicts] _ 718s 718s self = 718s combine_attrs = 'no_conflicts', attrs = [{'a': 1}, {'a': 2}], expected = None 718s expect_error = True 718s 718s @pytest.mark.parametrize( 718s ["combine_attrs", "attrs", "expected", "expect_error"], 718s ( 718s pytest.param("drop", [{"a": 1}, {"a": 2}], {}, False, id="drop"), 718s pytest.param( 718s "override", [{"a": 1}, {"a": 2}], {"a": 1}, False, id="override" 718s ), 718s pytest.param( 718s "no_conflicts", [{"a": 1}, {"a": 2}], None, True, id="no_conflicts" 718s ), 718s pytest.param( 718s "identical", 718s [{"a": 1, "b": 2}, {"a": 1, "c": 3}], 718s None, 718s True, 718s id="identical", 718s ), 718s pytest.param( 718s "drop_conflicts", 718s [{"a": 1, "b": 2}, {"b": -1, "c": 3}], 718s {"a": 1, "c": 3}, 718s False, 718s id="drop_conflicts", 718s ), 718s ), 718s ) 718s def test_open_mfdataset_dataset_combine_attrs( 718s self, combine_attrs, attrs, expected, expect_error 718s ): 718s with self.setup_files_and_datasets() as (files, [ds1, ds2]): 718s # Give the files an inconsistent attribute 718s for i, f in enumerate(files): 718s > ds = open_dataset(f).load() 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:4696: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _ TestOpenMFDatasetWithDataVarsAndCoordsKw.test_open_mfdataset_dataset_combine_attrs[identical] _ 718s 718s self = 718s combine_attrs = 'identical', attrs = [{'a': 1, 'b': 2}, {'a': 1, 'c': 3}] 718s expected = None, expect_error = True 718s 718s @pytest.mark.parametrize( 718s ["combine_attrs", "attrs", "expected", "expect_error"], 718s ( 718s pytest.param("drop", [{"a": 1}, {"a": 2}], {}, False, id="drop"), 718s pytest.param( 718s "override", [{"a": 1}, {"a": 2}], {"a": 1}, False, id="override" 718s ), 718s pytest.param( 718s "no_conflicts", [{"a": 1}, {"a": 2}], None, True, id="no_conflicts" 718s ), 718s pytest.param( 718s "identical", 718s [{"a": 1, "b": 2}, {"a": 1, "c": 3}], 718s None, 718s True, 718s id="identical", 718s ), 718s pytest.param( 718s "drop_conflicts", 718s [{"a": 1, "b": 2}, {"b": -1, "c": 3}], 718s {"a": 1, "c": 3}, 718s False, 718s id="drop_conflicts", 718s ), 718s ), 718s ) 718s def test_open_mfdataset_dataset_combine_attrs( 718s self, combine_attrs, attrs, expected, expect_error 718s ): 718s with self.setup_files_and_datasets() as (files, [ds1, ds2]): 718s # Give the files an inconsistent attribute 718s for i, f in enumerate(files): 718s > ds = open_dataset(f).load() 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:4696: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _ TestOpenMFDatasetWithDataVarsAndCoordsKw.test_open_mfdataset_dataset_combine_attrs[drop_conflicts] _ 718s 718s self = 718s combine_attrs = 'drop_conflicts', attrs = [{'a': 1, 'b': 2}, {'b': -1, 'c': 3}] 718s expected = {'a': 1, 'c': 3}, expect_error = False 718s 718s @pytest.mark.parametrize( 718s ["combine_attrs", "attrs", "expected", "expect_error"], 718s ( 718s pytest.param("drop", [{"a": 1}, {"a": 2}], {}, False, id="drop"), 718s pytest.param( 718s "override", [{"a": 1}, {"a": 2}], {"a": 1}, False, id="override" 718s ), 718s pytest.param( 718s "no_conflicts", [{"a": 1}, {"a": 2}], None, True, id="no_conflicts" 718s ), 718s pytest.param( 718s "identical", 718s [{"a": 1, "b": 2}, {"a": 1, "c": 3}], 718s None, 718s True, 718s id="identical", 718s ), 718s pytest.param( 718s "drop_conflicts", 718s [{"a": 1, "b": 2}, {"b": -1, "c": 3}], 718s {"a": 1, "c": 3}, 718s False, 718s id="drop_conflicts", 718s ), 718s ), 718s ) 718s def test_open_mfdataset_dataset_combine_attrs( 718s self, combine_attrs, attrs, expected, expect_error 718s ): 718s with self.setup_files_and_datasets() as (files, [ds1, ds2]): 718s # Give the files an inconsistent attribute 718s for i, f in enumerate(files): 718s > ds = open_dataset(f).load() 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:4696: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _ TestOpenMFDatasetWithDataVarsAndCoordsKw.test_open_mfdataset_dataset_attr_by_coords _ 718s 718s self = 718s 718s def test_open_mfdataset_dataset_attr_by_coords(self) -> None: 718s """ 718s Case when an attribute differs across the multiple files 718s """ 718s with self.setup_files_and_datasets() as (files, [ds1, ds2]): 718s # Give the files an inconsistent attribute 718s for i, f in enumerate(files): 718s > ds = open_dataset(f).load() 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:4725: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _ TestOpenMFDatasetWithDataVarsAndCoordsKw.test_open_mfdataset_dataarray_attr_by_coords _ 718s 718s self = 718s 718s def test_open_mfdataset_dataarray_attr_by_coords(self) -> None: 718s """ 718s Case when an attribute of a member DataArray differs across the multiple files 718s """ 718s with self.setup_files_and_datasets() as (files, [ds1, ds2]): 718s # Give the files an inconsistent attribute 718s for i, f in enumerate(files): 718s > ds = open_dataset(f).load() 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:4740: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _ TestOpenMFDatasetWithDataVarsAndCoordsKw.test_open_mfdataset_exact_join_raises_error[all-nested-t] _ 718s 718s self = 718s combine = 'nested', concat_dim = 't', opt = 'all' 718s 718s @pytest.mark.parametrize( 718s "combine, concat_dim", [("nested", "t"), ("by_coords", None)] 718s ) 718s @pytest.mark.parametrize("opt", ["all", "minimal", "different"]) 718s def test_open_mfdataset_exact_join_raises_error( 718s self, combine, concat_dim, opt 718s ) -> None: 718s with self.setup_files_and_datasets(fuzz=0.1) as (files, [ds1, ds2]): 718s if combine == "by_coords": 718s files.reverse() 718s with pytest.raises( 718s ValueError, match=r"cannot align objects.*join.*exact.*" 718s ): 718s > open_mfdataset( 718s files, 718s data_vars=opt, 718s combine=combine, 718s concat_dim=concat_dim, 718s join="exact", 718s ) 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:4761: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1635: in open_mfdataset 718s datasets = [open_(p, **open_kwargs) for p in paths1d] 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _ TestOpenMFDatasetWithDataVarsAndCoordsKw.test_open_mfdataset_exact_join_raises_error[all-by_coords-None] _ 718s 718s self = 718s combine = 'by_coords', concat_dim = None, opt = 'all' 718s 718s @pytest.mark.parametrize( 718s "combine, concat_dim", [("nested", "t"), ("by_coords", None)] 718s ) 718s @pytest.mark.parametrize("opt", ["all", "minimal", "different"]) 718s def test_open_mfdataset_exact_join_raises_error( 718s self, combine, concat_dim, opt 718s ) -> None: 718s with self.setup_files_and_datasets(fuzz=0.1) as (files, [ds1, ds2]): 718s if combine == "by_coords": 718s files.reverse() 718s with pytest.raises( 718s ValueError, match=r"cannot align objects.*join.*exact.*" 718s ): 718s > open_mfdataset( 718s files, 718s data_vars=opt, 718s combine=combine, 718s concat_dim=concat_dim, 718s join="exact", 718s ) 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:4761: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1635: in open_mfdataset 718s datasets = [open_(p, **open_kwargs) for p in paths1d] 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _ TestOpenMFDatasetWithDataVarsAndCoordsKw.test_open_mfdataset_exact_join_raises_error[minimal-nested-t] _ 718s 718s self = 718s combine = 'nested', concat_dim = 't', opt = 'minimal' 718s 718s @pytest.mark.parametrize( 718s "combine, concat_dim", [("nested", "t"), ("by_coords", None)] 718s ) 718s @pytest.mark.parametrize("opt", ["all", "minimal", "different"]) 718s def test_open_mfdataset_exact_join_raises_error( 718s self, combine, concat_dim, opt 718s ) -> None: 718s with self.setup_files_and_datasets(fuzz=0.1) as (files, [ds1, ds2]): 718s if combine == "by_coords": 718s files.reverse() 718s with pytest.raises( 718s ValueError, match=r"cannot align objects.*join.*exact.*" 718s ): 718s > open_mfdataset( 718s files, 718s data_vars=opt, 718s combine=combine, 718s concat_dim=concat_dim, 718s join="exact", 718s ) 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:4761: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1635: in open_mfdataset 718s datasets = [open_(p, **open_kwargs) for p in paths1d] 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _ TestOpenMFDatasetWithDataVarsAndCoordsKw.test_open_mfdataset_exact_join_raises_error[minimal-by_coords-None] _ 718s 718s self = 718s combine = 'by_coords', concat_dim = None, opt = 'minimal' 718s 718s @pytest.mark.parametrize( 718s "combine, concat_dim", [("nested", "t"), ("by_coords", None)] 718s ) 718s @pytest.mark.parametrize("opt", ["all", "minimal", "different"]) 718s def test_open_mfdataset_exact_join_raises_error( 718s self, combine, concat_dim, opt 718s ) -> None: 718s with self.setup_files_and_datasets(fuzz=0.1) as (files, [ds1, ds2]): 718s if combine == "by_coords": 718s files.reverse() 718s with pytest.raises( 718s ValueError, match=r"cannot align objects.*join.*exact.*" 718s ): 718s > open_mfdataset( 718s files, 718s data_vars=opt, 718s combine=combine, 718s concat_dim=concat_dim, 718s join="exact", 718s ) 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:4761: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1635: in open_mfdataset 718s datasets = [open_(p, **open_kwargs) for p in paths1d] 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _ TestOpenMFDatasetWithDataVarsAndCoordsKw.test_open_mfdataset_exact_join_raises_error[different-nested-t] _ 718s 718s self = 718s combine = 'nested', concat_dim = 't', opt = 'different' 718s 718s @pytest.mark.parametrize( 718s "combine, concat_dim", [("nested", "t"), ("by_coords", None)] 718s ) 718s @pytest.mark.parametrize("opt", ["all", "minimal", "different"]) 718s def test_open_mfdataset_exact_join_raises_error( 718s self, combine, concat_dim, opt 718s ) -> None: 718s with self.setup_files_and_datasets(fuzz=0.1) as (files, [ds1, ds2]): 718s if combine == "by_coords": 718s files.reverse() 718s with pytest.raises( 718s ValueError, match=r"cannot align objects.*join.*exact.*" 718s ): 718s > open_mfdataset( 718s files, 718s data_vars=opt, 718s combine=combine, 718s concat_dim=concat_dim, 718s join="exact", 718s ) 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:4761: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1635: in open_mfdataset 718s datasets = [open_(p, **open_kwargs) for p in paths1d] 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _ TestOpenMFDatasetWithDataVarsAndCoordsKw.test_open_mfdataset_exact_join_raises_error[different-by_coords-None] _ 718s 718s self = 718s combine = 'by_coords', concat_dim = None, opt = 'different' 718s 718s @pytest.mark.parametrize( 718s "combine, concat_dim", [("nested", "t"), ("by_coords", None)] 718s ) 718s @pytest.mark.parametrize("opt", ["all", "minimal", "different"]) 718s def test_open_mfdataset_exact_join_raises_error( 718s self, combine, concat_dim, opt 718s ) -> None: 718s with self.setup_files_and_datasets(fuzz=0.1) as (files, [ds1, ds2]): 718s if combine == "by_coords": 718s files.reverse() 718s with pytest.raises( 718s ValueError, match=r"cannot align objects.*join.*exact.*" 718s ): 718s > open_mfdataset( 718s files, 718s data_vars=opt, 718s combine=combine, 718s concat_dim=concat_dim, 718s join="exact", 718s ) 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:4761: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1635: in open_mfdataset 718s datasets = [open_(p, **open_kwargs) for p in paths1d] 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _ TestOpenMFDatasetWithDataVarsAndCoordsKw.test_common_coord_when_datavars_all _ 718s 718s self = 718s 718s def test_common_coord_when_datavars_all(self) -> None: 718s opt: Final = "all" 718s 718s with self.setup_files_and_datasets() as (files, [ds1, ds2]): 718s # open the files with the data_var option 718s > with open_mfdataset( 718s files, data_vars=opt, combine="nested", concat_dim="t" 718s ) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:4774: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1635: in open_mfdataset 718s datasets = [open_(p, **open_kwargs) for p in paths1d] 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _ TestOpenMFDatasetWithDataVarsAndCoordsKw.test_common_coord_when_datavars_minimal _ 718s 718s self = 718s 718s def test_common_coord_when_datavars_minimal(self) -> None: 718s opt: Final = "minimal" 718s 718s with self.setup_files_and_datasets() as (files, [ds1, ds2]): 718s # open the files using data_vars option 718s > with open_mfdataset( 718s files, data_vars=opt, combine="nested", concat_dim="t" 718s ) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:4792: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1635: in open_mfdataset 718s datasets = [open_(p, **open_kwargs) for p in paths1d] 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _ TestOpenMFDatasetWithDataVarsAndCoordsKw.test_invalid_data_vars_value_should_fail _ 718s 718s self = 718s 718s def test_invalid_data_vars_value_should_fail(self) -> None: 718s with self.setup_files_and_datasets() as (files, _): 718s with pytest.raises(ValueError): 718s > with open_mfdataset(files, data_vars="minimum", combine="by_coords"): # type: ignore[arg-type] 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:4808: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1635: in open_mfdataset 718s datasets = [open_(p, **open_kwargs) for p in paths1d] 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ____________ TestDataArrayToNetCDF.test_dataarray_to_netcdf_no_name ____________ 718s 718s self = 718s 718s def test_dataarray_to_netcdf_no_name(self) -> None: 718s original_da = DataArray(np.arange(12).reshape((3, 4))) 718s 718s with create_tmp_file() as tmp: 718s original_da.to_netcdf(tmp) 718s 718s > with open_dataarray(tmp) as loaded_da: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5576: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:881: in open_dataarray 718s dataset = open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ___________ TestDataArrayToNetCDF.test_dataarray_to_netcdf_with_name ___________ 718s 718s self = 718s 718s def test_dataarray_to_netcdf_with_name(self) -> None: 718s original_da = DataArray(np.arange(12).reshape((3, 4)), name="test") 718s 718s with create_tmp_file() as tmp: 718s original_da.to_netcdf(tmp) 718s 718s > with open_dataarray(tmp) as loaded_da: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5585: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:881: in open_dataarray 718s dataset = open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _______ TestDataArrayToNetCDF.test_dataarray_to_netcdf_coord_name_clash ________ 718s 718s self = 718s 718s def test_dataarray_to_netcdf_coord_name_clash(self) -> None: 718s original_da = DataArray( 718s np.arange(12).reshape((3, 4)), dims=["x", "y"], name="x" 718s ) 718s 718s with create_tmp_file() as tmp: 718s original_da.to_netcdf(tmp) 718s 718s > with open_dataarray(tmp) as loaded_da: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5596: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:881: in open_dataarray 718s dataset = open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ______________ TestDataArrayToNetCDF.test_open_dataarray_options _______________ 718s 718s self = 718s 718s def test_open_dataarray_options(self) -> None: 718s data = DataArray(np.arange(5), coords={"y": ("x", range(5))}, dims=["x"]) 718s 718s with create_tmp_file() as tmp: 718s data.to_netcdf(tmp) 718s 718s expected = data.drop_vars("y") 718s > with open_dataarray(tmp, drop_variables=["y"]) as loaded: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5606: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:881: in open_dataarray 718s dataset = open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ________ TestDataArrayToNetCDF.test_dataarray_to_netcdf_no_name_pathlib ________ 718s 718s self = 718s 718s def test_dataarray_to_netcdf_no_name_pathlib(self) -> None: 718s original_da = DataArray(np.arange(12).reshape((3, 4))) 718s 718s with create_tmp_file() as tmps: 718s tmp = Path(tmps) 718s original_da.to_netcdf(tmp) 718s 718s > with open_dataarray(tmp) as loaded_da: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5623: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:881: in open_dataarray 718s dataset = open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _____________________ test_source_encoding_always_present ______________________ 718s 718s @requires_scipy_or_netCDF4 718s def test_source_encoding_always_present() -> None: 718s # Test for GH issue #2550. 718s rnddata = np.random.randn(10) 718s original = Dataset({"foo": ("x", rnddata)}) 718s with create_tmp_file() as tmp: 718s original.to_netcdf(tmp) 718s > with open_dataset(tmp) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5703: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _______________ test_source_encoding_always_present_with_pathlib _______________ 718s 718s @requires_scipy_or_netCDF4 718s def test_source_encoding_always_present_with_pathlib() -> None: 718s # Test for GH issue #5888. 718s rnddata = np.random.randn(10) 718s original = Dataset({"foo": ("x", rnddata)}) 718s with create_tmp_file() as tmp: 718s original.to_netcdf(tmp) 718s > with open_dataset(Path(tmp)) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5714: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ________ test_use_cftime_standard_calendar_default_in_range[gregorian] _________ 718s 718s calendar = 'gregorian' 718s 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", _STANDARD_CALENDARS) 718s def test_use_cftime_standard_calendar_default_in_range(calendar) -> None: 718s x = [0, 1] 718s time = [0, 720] 718s units_date = "2000-01-01" 718s units = "days since 2000-01-01" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s x_timedeltas = np.array(x).astype("timedelta64[D]") 718s time_timedeltas = np.array(time).astype("timedelta64[D]") 718s decoded_x = np.datetime64(units_date, "ns") + x_timedeltas 718s decoded_time = np.datetime64(units_date, "ns") + time_timedeltas 718s expected_x = DataArray(decoded_x, [("time", decoded_time)], name="x") 718s expected_time = DataArray(decoded_time, [("time", decoded_time)], name="time") 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with warnings.catch_warnings(record=True) as record: 718s > with open_dataset(tmp_file) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5763: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ___ test_use_cftime_standard_calendar_default_in_range[proleptic_gregorian] ____ 718s 718s calendar = 'proleptic_gregorian' 718s 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", _STANDARD_CALENDARS) 718s def test_use_cftime_standard_calendar_default_in_range(calendar) -> None: 718s x = [0, 1] 718s time = [0, 720] 718s units_date = "2000-01-01" 718s units = "days since 2000-01-01" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s x_timedeltas = np.array(x).astype("timedelta64[D]") 718s time_timedeltas = np.array(time).astype("timedelta64[D]") 718s decoded_x = np.datetime64(units_date, "ns") + x_timedeltas 718s decoded_time = np.datetime64(units_date, "ns") + time_timedeltas 718s expected_x = DataArray(decoded_x, [("time", decoded_time)], name="x") 718s expected_time = DataArray(decoded_time, [("time", decoded_time)], name="time") 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with warnings.catch_warnings(record=True) as record: 718s > with open_dataset(tmp_file) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5763: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _________ test_use_cftime_standard_calendar_default_in_range[standard] _________ 718s 718s calendar = 'standard' 718s 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", _STANDARD_CALENDARS) 718s def test_use_cftime_standard_calendar_default_in_range(calendar) -> None: 718s x = [0, 1] 718s time = [0, 720] 718s units_date = "2000-01-01" 718s units = "days since 2000-01-01" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s x_timedeltas = np.array(x).astype("timedelta64[D]") 718s time_timedeltas = np.array(time).astype("timedelta64[D]") 718s decoded_x = np.datetime64(units_date, "ns") + x_timedeltas 718s decoded_time = np.datetime64(units_date, "ns") + time_timedeltas 718s expected_x = DataArray(decoded_x, [("time", decoded_time)], name="x") 718s expected_time = DataArray(decoded_time, [("time", decoded_time)], name="time") 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with warnings.catch_warnings(record=True) as record: 718s > with open_dataset(tmp_file) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5763: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _______ test_use_cftime_standard_calendar_default_out_of_range[standard] _______ 718s 718s calendar = 'standard' 718s 718s @requires_cftime 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", ["standard", "gregorian"]) 718s def test_use_cftime_standard_calendar_default_out_of_range(calendar) -> None: 718s # todo: check, if we still need to test for two dates 718s import cftime 718s 718s x = [0, 1] 718s time = [0, 720] 718s units = "days since 1582-01-01" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s decoded_x = cftime.num2date(x, units, calendar, only_use_cftime_datetimes=True) 718s decoded_time = cftime.num2date( 718s time, units, calendar, only_use_cftime_datetimes=True 718s ) 718s expected_x = DataArray(decoded_x, [("time", decoded_time)], name="x") 718s expected_time = DataArray(decoded_time, [("time", decoded_time)], name="time") 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with pytest.warns(SerializationWarning): 718s > with open_dataset(tmp_file) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5794: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s 718s During handling of the above exception, another exception occurred: 718s 718s calendar = 'standard' 718s 718s @requires_cftime 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", ["standard", "gregorian"]) 718s def test_use_cftime_standard_calendar_default_out_of_range(calendar) -> None: 718s # todo: check, if we still need to test for two dates 718s import cftime 718s 718s x = [0, 1] 718s time = [0, 720] 718s units = "days since 1582-01-01" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s decoded_x = cftime.num2date(x, units, calendar, only_use_cftime_datetimes=True) 718s decoded_time = cftime.num2date( 718s time, units, calendar, only_use_cftime_datetimes=True 718s ) 718s expected_x = DataArray(decoded_x, [("time", decoded_time)], name="x") 718s expected_time = DataArray(decoded_time, [("time", decoded_time)], name="time") 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s > with pytest.warns(SerializationWarning): 718s E Failed: DID NOT WARN. No warnings of type (,) were emitted. 718s E Emitted warnings: []. 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5793: Failed 718s ______ test_use_cftime_standard_calendar_default_out_of_range[gregorian] _______ 718s 718s calendar = 'gregorian' 718s 718s @requires_cftime 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", ["standard", "gregorian"]) 718s def test_use_cftime_standard_calendar_default_out_of_range(calendar) -> None: 718s # todo: check, if we still need to test for two dates 718s import cftime 718s 718s x = [0, 1] 718s time = [0, 720] 718s units = "days since 1582-01-01" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s decoded_x = cftime.num2date(x, units, calendar, only_use_cftime_datetimes=True) 718s decoded_time = cftime.num2date( 718s time, units, calendar, only_use_cftime_datetimes=True 718s ) 718s expected_x = DataArray(decoded_x, [("time", decoded_time)], name="x") 718s expected_time = DataArray(decoded_time, [("time", decoded_time)], name="time") 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with pytest.warns(SerializationWarning): 718s > with open_dataset(tmp_file) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5794: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s 718s During handling of the above exception, another exception occurred: 718s 718s calendar = 'gregorian' 718s 718s @requires_cftime 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", ["standard", "gregorian"]) 718s def test_use_cftime_standard_calendar_default_out_of_range(calendar) -> None: 718s # todo: check, if we still need to test for two dates 718s import cftime 718s 718s x = [0, 1] 718s time = [0, 720] 718s units = "days since 1582-01-01" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s decoded_x = cftime.num2date(x, units, calendar, only_use_cftime_datetimes=True) 718s decoded_time = cftime.num2date( 718s time, units, calendar, only_use_cftime_datetimes=True 718s ) 718s expected_x = DataArray(decoded_x, [("time", decoded_time)], name="x") 718s expected_time = DataArray(decoded_time, [("time", decoded_time)], name="time") 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s > with pytest.warns(SerializationWarning): 718s E Failed: DID NOT WARN. No warnings of type (,) were emitted. 718s E Emitted warnings: []. 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5793: Failed 718s ______________________ test_use_cftime_true[1500-360_day] ______________________ 718s 718s calendar = '360_day', units_year = 1500 718s 718s @requires_cftime 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", _ALL_CALENDARS) 718s @pytest.mark.parametrize("units_year", [1500, 2000, 2500]) 718s def test_use_cftime_true(calendar, units_year) -> None: 718s import cftime 718s 718s x = [0, 1] 718s time = [0, 720] 718s units = f"days since {units_year}-01-01" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s decoded_x = cftime.num2date(x, units, calendar, only_use_cftime_datetimes=True) 718s decoded_time = cftime.num2date( 718s time, units, calendar, only_use_cftime_datetimes=True 718s ) 718s expected_x = DataArray(decoded_x, [("time", decoded_time)], name="x") 718s expected_time = DataArray(decoded_time, [("time", decoded_time)], name="time") 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with warnings.catch_warnings(record=True) as record: 718s decoder = CFDatetimeCoder(use_cftime=True) 718s > with open_dataset(tmp_file, decode_times=decoder) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5825: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ______________________ test_use_cftime_true[1500-365_day] ______________________ 718s 718s calendar = '365_day', units_year = 1500 718s 718s @requires_cftime 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", _ALL_CALENDARS) 718s @pytest.mark.parametrize("units_year", [1500, 2000, 2500]) 718s def test_use_cftime_true(calendar, units_year) -> None: 718s import cftime 718s 718s x = [0, 1] 718s time = [0, 720] 718s units = f"days since {units_year}-01-01" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s decoded_x = cftime.num2date(x, units, calendar, only_use_cftime_datetimes=True) 718s decoded_time = cftime.num2date( 718s time, units, calendar, only_use_cftime_datetimes=True 718s ) 718s expected_x = DataArray(decoded_x, [("time", decoded_time)], name="x") 718s expected_time = DataArray(decoded_time, [("time", decoded_time)], name="time") 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with warnings.catch_warnings(record=True) as record: 718s decoder = CFDatetimeCoder(use_cftime=True) 718s > with open_dataset(tmp_file, decode_times=decoder) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5825: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ______________________ test_use_cftime_true[1500-366_day] ______________________ 718s 718s calendar = '366_day', units_year = 1500 718s 718s @requires_cftime 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", _ALL_CALENDARS) 718s @pytest.mark.parametrize("units_year", [1500, 2000, 2500]) 718s def test_use_cftime_true(calendar, units_year) -> None: 718s import cftime 718s 718s x = [0, 1] 718s time = [0, 720] 718s units = f"days since {units_year}-01-01" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s decoded_x = cftime.num2date(x, units, calendar, only_use_cftime_datetimes=True) 718s decoded_time = cftime.num2date( 718s time, units, calendar, only_use_cftime_datetimes=True 718s ) 718s expected_x = DataArray(decoded_x, [("time", decoded_time)], name="x") 718s expected_time = DataArray(decoded_time, [("time", decoded_time)], name="time") 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with warnings.catch_warnings(record=True) as record: 718s decoder = CFDatetimeCoder(use_cftime=True) 718s > with open_dataset(tmp_file, decode_times=decoder) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5825: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _____________________ test_use_cftime_true[1500-all_leap] ______________________ 718s 718s calendar = 'all_leap', units_year = 1500 718s 718s @requires_cftime 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", _ALL_CALENDARS) 718s @pytest.mark.parametrize("units_year", [1500, 2000, 2500]) 718s def test_use_cftime_true(calendar, units_year) -> None: 718s import cftime 718s 718s x = [0, 1] 718s time = [0, 720] 718s units = f"days since {units_year}-01-01" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s decoded_x = cftime.num2date(x, units, calendar, only_use_cftime_datetimes=True) 718s decoded_time = cftime.num2date( 718s time, units, calendar, only_use_cftime_datetimes=True 718s ) 718s expected_x = DataArray(decoded_x, [("time", decoded_time)], name="x") 718s expected_time = DataArray(decoded_time, [("time", decoded_time)], name="time") 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with warnings.catch_warnings(record=True) as record: 718s decoder = CFDatetimeCoder(use_cftime=True) 718s > with open_dataset(tmp_file, decode_times=decoder) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5825: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _____________________ test_use_cftime_true[1500-gregorian] _____________________ 718s 718s calendar = 'gregorian', units_year = 1500 718s 718s @requires_cftime 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", _ALL_CALENDARS) 718s @pytest.mark.parametrize("units_year", [1500, 2000, 2500]) 718s def test_use_cftime_true(calendar, units_year) -> None: 718s import cftime 718s 718s x = [0, 1] 718s time = [0, 720] 718s units = f"days since {units_year}-01-01" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s decoded_x = cftime.num2date(x, units, calendar, only_use_cftime_datetimes=True) 718s decoded_time = cftime.num2date( 718s time, units, calendar, only_use_cftime_datetimes=True 718s ) 718s expected_x = DataArray(decoded_x, [("time", decoded_time)], name="x") 718s expected_time = DataArray(decoded_time, [("time", decoded_time)], name="time") 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with warnings.catch_warnings(record=True) as record: 718s decoder = CFDatetimeCoder(use_cftime=True) 718s > with open_dataset(tmp_file, decode_times=decoder) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5825: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ______________________ test_use_cftime_true[1500-julian] _______________________ 718s 718s calendar = 'julian', units_year = 1500 718s 718s @requires_cftime 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", _ALL_CALENDARS) 718s @pytest.mark.parametrize("units_year", [1500, 2000, 2500]) 718s def test_use_cftime_true(calendar, units_year) -> None: 718s import cftime 718s 718s x = [0, 1] 718s time = [0, 720] 718s units = f"days since {units_year}-01-01" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s decoded_x = cftime.num2date(x, units, calendar, only_use_cftime_datetimes=True) 718s decoded_time = cftime.num2date( 718s time, units, calendar, only_use_cftime_datetimes=True 718s ) 718s expected_x = DataArray(decoded_x, [("time", decoded_time)], name="x") 718s expected_time = DataArray(decoded_time, [("time", decoded_time)], name="time") 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with warnings.catch_warnings(record=True) as record: 718s decoder = CFDatetimeCoder(use_cftime=True) 718s > with open_dataset(tmp_file, decode_times=decoder) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5825: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ______________________ test_use_cftime_true[1500-noleap] _______________________ 718s 718s calendar = 'noleap', units_year = 1500 718s 718s @requires_cftime 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", _ALL_CALENDARS) 718s @pytest.mark.parametrize("units_year", [1500, 2000, 2500]) 718s def test_use_cftime_true(calendar, units_year) -> None: 718s import cftime 718s 718s x = [0, 1] 718s time = [0, 720] 718s units = f"days since {units_year}-01-01" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s decoded_x = cftime.num2date(x, units, calendar, only_use_cftime_datetimes=True) 718s decoded_time = cftime.num2date( 718s time, units, calendar, only_use_cftime_datetimes=True 718s ) 718s expected_x = DataArray(decoded_x, [("time", decoded_time)], name="x") 718s expected_time = DataArray(decoded_time, [("time", decoded_time)], name="time") 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with warnings.catch_warnings(record=True) as record: 718s decoder = CFDatetimeCoder(use_cftime=True) 718s > with open_dataset(tmp_file, decode_times=decoder) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5825: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ________________ test_use_cftime_true[1500-proleptic_gregorian] ________________ 718s 718s calendar = 'proleptic_gregorian', units_year = 1500 718s 718s @requires_cftime 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", _ALL_CALENDARS) 718s @pytest.mark.parametrize("units_year", [1500, 2000, 2500]) 718s def test_use_cftime_true(calendar, units_year) -> None: 718s import cftime 718s 718s x = [0, 1] 718s time = [0, 720] 718s units = f"days since {units_year}-01-01" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s decoded_x = cftime.num2date(x, units, calendar, only_use_cftime_datetimes=True) 718s decoded_time = cftime.num2date( 718s time, units, calendar, only_use_cftime_datetimes=True 718s ) 718s expected_x = DataArray(decoded_x, [("time", decoded_time)], name="x") 718s expected_time = DataArray(decoded_time, [("time", decoded_time)], name="time") 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with warnings.catch_warnings(record=True) as record: 718s decoder = CFDatetimeCoder(use_cftime=True) 718s > with open_dataset(tmp_file, decode_times=decoder) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5825: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _____________________ test_use_cftime_true[1500-standard] ______________________ 718s 718s calendar = 'standard', units_year = 1500 718s 718s @requires_cftime 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", _ALL_CALENDARS) 718s @pytest.mark.parametrize("units_year", [1500, 2000, 2500]) 718s def test_use_cftime_true(calendar, units_year) -> None: 718s import cftime 718s 718s x = [0, 1] 718s time = [0, 720] 718s units = f"days since {units_year}-01-01" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s decoded_x = cftime.num2date(x, units, calendar, only_use_cftime_datetimes=True) 718s decoded_time = cftime.num2date( 718s time, units, calendar, only_use_cftime_datetimes=True 718s ) 718s expected_x = DataArray(decoded_x, [("time", decoded_time)], name="x") 718s expected_time = DataArray(decoded_time, [("time", decoded_time)], name="time") 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with warnings.catch_warnings(record=True) as record: 718s decoder = CFDatetimeCoder(use_cftime=True) 718s > with open_dataset(tmp_file, decode_times=decoder) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5825: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ______________________ test_use_cftime_true[2000-360_day] ______________________ 718s 718s calendar = '360_day', units_year = 2000 718s 718s @requires_cftime 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", _ALL_CALENDARS) 718s @pytest.mark.parametrize("units_year", [1500, 2000, 2500]) 718s def test_use_cftime_true(calendar, units_year) -> None: 718s import cftime 718s 718s x = [0, 1] 718s time = [0, 720] 718s units = f"days since {units_year}-01-01" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s decoded_x = cftime.num2date(x, units, calendar, only_use_cftime_datetimes=True) 718s decoded_time = cftime.num2date( 718s time, units, calendar, only_use_cftime_datetimes=True 718s ) 718s expected_x = DataArray(decoded_x, [("time", decoded_time)], name="x") 718s expected_time = DataArray(decoded_time, [("time", decoded_time)], name="time") 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with warnings.catch_warnings(record=True) as record: 718s decoder = CFDatetimeCoder(use_cftime=True) 718s > with open_dataset(tmp_file, decode_times=decoder) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5825: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ______________________ test_use_cftime_true[2000-365_day] ______________________ 718s 718s calendar = '365_day', units_year = 2000 718s 718s @requires_cftime 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", _ALL_CALENDARS) 718s @pytest.mark.parametrize("units_year", [1500, 2000, 2500]) 718s def test_use_cftime_true(calendar, units_year) -> None: 718s import cftime 718s 718s x = [0, 1] 718s time = [0, 720] 718s units = f"days since {units_year}-01-01" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s decoded_x = cftime.num2date(x, units, calendar, only_use_cftime_datetimes=True) 718s decoded_time = cftime.num2date( 718s time, units, calendar, only_use_cftime_datetimes=True 718s ) 718s expected_x = DataArray(decoded_x, [("time", decoded_time)], name="x") 718s expected_time = DataArray(decoded_time, [("time", decoded_time)], name="time") 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with warnings.catch_warnings(record=True) as record: 718s decoder = CFDatetimeCoder(use_cftime=True) 718s > with open_dataset(tmp_file, decode_times=decoder) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5825: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ______________________ test_use_cftime_true[2000-366_day] ______________________ 718s 718s calendar = '366_day', units_year = 2000 718s 718s @requires_cftime 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", _ALL_CALENDARS) 718s @pytest.mark.parametrize("units_year", [1500, 2000, 2500]) 718s def test_use_cftime_true(calendar, units_year) -> None: 718s import cftime 718s 718s x = [0, 1] 718s time = [0, 720] 718s units = f"days since {units_year}-01-01" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s decoded_x = cftime.num2date(x, units, calendar, only_use_cftime_datetimes=True) 718s decoded_time = cftime.num2date( 718s time, units, calendar, only_use_cftime_datetimes=True 718s ) 718s expected_x = DataArray(decoded_x, [("time", decoded_time)], name="x") 718s expected_time = DataArray(decoded_time, [("time", decoded_time)], name="time") 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with warnings.catch_warnings(record=True) as record: 718s decoder = CFDatetimeCoder(use_cftime=True) 718s > with open_dataset(tmp_file, decode_times=decoder) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5825: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _____________________ test_use_cftime_true[2000-all_leap] ______________________ 718s 718s calendar = 'all_leap', units_year = 2000 718s 718s @requires_cftime 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", _ALL_CALENDARS) 718s @pytest.mark.parametrize("units_year", [1500, 2000, 2500]) 718s def test_use_cftime_true(calendar, units_year) -> None: 718s import cftime 718s 718s x = [0, 1] 718s time = [0, 720] 718s units = f"days since {units_year}-01-01" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s decoded_x = cftime.num2date(x, units, calendar, only_use_cftime_datetimes=True) 718s decoded_time = cftime.num2date( 718s time, units, calendar, only_use_cftime_datetimes=True 718s ) 718s expected_x = DataArray(decoded_x, [("time", decoded_time)], name="x") 718s expected_time = DataArray(decoded_time, [("time", decoded_time)], name="time") 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with warnings.catch_warnings(record=True) as record: 718s decoder = CFDatetimeCoder(use_cftime=True) 718s > with open_dataset(tmp_file, decode_times=decoder) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5825: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _____________________ test_use_cftime_true[2000-gregorian] _____________________ 718s 718s calendar = 'gregorian', units_year = 2000 718s 718s @requires_cftime 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", _ALL_CALENDARS) 718s @pytest.mark.parametrize("units_year", [1500, 2000, 2500]) 718s def test_use_cftime_true(calendar, units_year) -> None: 718s import cftime 718s 718s x = [0, 1] 718s time = [0, 720] 718s units = f"days since {units_year}-01-01" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s decoded_x = cftime.num2date(x, units, calendar, only_use_cftime_datetimes=True) 718s decoded_time = cftime.num2date( 718s time, units, calendar, only_use_cftime_datetimes=True 718s ) 718s expected_x = DataArray(decoded_x, [("time", decoded_time)], name="x") 718s expected_time = DataArray(decoded_time, [("time", decoded_time)], name="time") 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with warnings.catch_warnings(record=True) as record: 718s decoder = CFDatetimeCoder(use_cftime=True) 718s > with open_dataset(tmp_file, decode_times=decoder) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5825: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ______________________ test_use_cftime_true[2000-julian] _______________________ 718s 718s calendar = 'julian', units_year = 2000 718s 718s @requires_cftime 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", _ALL_CALENDARS) 718s @pytest.mark.parametrize("units_year", [1500, 2000, 2500]) 718s def test_use_cftime_true(calendar, units_year) -> None: 718s import cftime 718s 718s x = [0, 1] 718s time = [0, 720] 718s units = f"days since {units_year}-01-01" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s decoded_x = cftime.num2date(x, units, calendar, only_use_cftime_datetimes=True) 718s decoded_time = cftime.num2date( 718s time, units, calendar, only_use_cftime_datetimes=True 718s ) 718s expected_x = DataArray(decoded_x, [("time", decoded_time)], name="x") 718s expected_time = DataArray(decoded_time, [("time", decoded_time)], name="time") 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with warnings.catch_warnings(record=True) as record: 718s decoder = CFDatetimeCoder(use_cftime=True) 718s > with open_dataset(tmp_file, decode_times=decoder) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5825: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ______________________ test_use_cftime_true[2000-noleap] _______________________ 718s 718s calendar = 'noleap', units_year = 2000 718s 718s @requires_cftime 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", _ALL_CALENDARS) 718s @pytest.mark.parametrize("units_year", [1500, 2000, 2500]) 718s def test_use_cftime_true(calendar, units_year) -> None: 718s import cftime 718s 718s x = [0, 1] 718s time = [0, 720] 718s units = f"days since {units_year}-01-01" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s decoded_x = cftime.num2date(x, units, calendar, only_use_cftime_datetimes=True) 718s decoded_time = cftime.num2date( 718s time, units, calendar, only_use_cftime_datetimes=True 718s ) 718s expected_x = DataArray(decoded_x, [("time", decoded_time)], name="x") 718s expected_time = DataArray(decoded_time, [("time", decoded_time)], name="time") 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with warnings.catch_warnings(record=True) as record: 718s decoder = CFDatetimeCoder(use_cftime=True) 718s > with open_dataset(tmp_file, decode_times=decoder) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5825: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ________________ test_use_cftime_true[2000-proleptic_gregorian] ________________ 718s 718s calendar = 'proleptic_gregorian', units_year = 2000 718s 718s @requires_cftime 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", _ALL_CALENDARS) 718s @pytest.mark.parametrize("units_year", [1500, 2000, 2500]) 718s def test_use_cftime_true(calendar, units_year) -> None: 718s import cftime 718s 718s x = [0, 1] 718s time = [0, 720] 718s units = f"days since {units_year}-01-01" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s decoded_x = cftime.num2date(x, units, calendar, only_use_cftime_datetimes=True) 718s decoded_time = cftime.num2date( 718s time, units, calendar, only_use_cftime_datetimes=True 718s ) 718s expected_x = DataArray(decoded_x, [("time", decoded_time)], name="x") 718s expected_time = DataArray(decoded_time, [("time", decoded_time)], name="time") 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with warnings.catch_warnings(record=True) as record: 718s decoder = CFDatetimeCoder(use_cftime=True) 718s > with open_dataset(tmp_file, decode_times=decoder) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5825: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _____________________ test_use_cftime_true[2000-standard] ______________________ 718s 718s calendar = 'standard', units_year = 2000 718s 718s @requires_cftime 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", _ALL_CALENDARS) 718s @pytest.mark.parametrize("units_year", [1500, 2000, 2500]) 718s def test_use_cftime_true(calendar, units_year) -> None: 718s import cftime 718s 718s x = [0, 1] 718s time = [0, 720] 718s units = f"days since {units_year}-01-01" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s decoded_x = cftime.num2date(x, units, calendar, only_use_cftime_datetimes=True) 718s decoded_time = cftime.num2date( 718s time, units, calendar, only_use_cftime_datetimes=True 718s ) 718s expected_x = DataArray(decoded_x, [("time", decoded_time)], name="x") 718s expected_time = DataArray(decoded_time, [("time", decoded_time)], name="time") 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with warnings.catch_warnings(record=True) as record: 718s decoder = CFDatetimeCoder(use_cftime=True) 718s > with open_dataset(tmp_file, decode_times=decoder) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5825: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ______________________ test_use_cftime_true[2500-360_day] ______________________ 718s 718s calendar = '360_day', units_year = 2500 718s 718s @requires_cftime 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", _ALL_CALENDARS) 718s @pytest.mark.parametrize("units_year", [1500, 2000, 2500]) 718s def test_use_cftime_true(calendar, units_year) -> None: 718s import cftime 718s 718s x = [0, 1] 718s time = [0, 720] 718s units = f"days since {units_year}-01-01" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s decoded_x = cftime.num2date(x, units, calendar, only_use_cftime_datetimes=True) 718s decoded_time = cftime.num2date( 718s time, units, calendar, only_use_cftime_datetimes=True 718s ) 718s expected_x = DataArray(decoded_x, [("time", decoded_time)], name="x") 718s expected_time = DataArray(decoded_time, [("time", decoded_time)], name="time") 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with warnings.catch_warnings(record=True) as record: 718s decoder = CFDatetimeCoder(use_cftime=True) 718s > with open_dataset(tmp_file, decode_times=decoder) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5825: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ______________________ test_use_cftime_true[2500-365_day] ______________________ 718s 718s calendar = '365_day', units_year = 2500 718s 718s @requires_cftime 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", _ALL_CALENDARS) 718s @pytest.mark.parametrize("units_year", [1500, 2000, 2500]) 718s def test_use_cftime_true(calendar, units_year) -> None: 718s import cftime 718s 718s x = [0, 1] 718s time = [0, 720] 718s units = f"days since {units_year}-01-01" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s decoded_x = cftime.num2date(x, units, calendar, only_use_cftime_datetimes=True) 718s decoded_time = cftime.num2date( 718s time, units, calendar, only_use_cftime_datetimes=True 718s ) 718s expected_x = DataArray(decoded_x, [("time", decoded_time)], name="x") 718s expected_time = DataArray(decoded_time, [("time", decoded_time)], name="time") 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with warnings.catch_warnings(record=True) as record: 718s decoder = CFDatetimeCoder(use_cftime=True) 718s > with open_dataset(tmp_file, decode_times=decoder) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5825: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ______________________ test_use_cftime_true[2500-366_day] ______________________ 718s 718s calendar = '366_day', units_year = 2500 718s 718s @requires_cftime 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", _ALL_CALENDARS) 718s @pytest.mark.parametrize("units_year", [1500, 2000, 2500]) 718s def test_use_cftime_true(calendar, units_year) -> None: 718s import cftime 718s 718s x = [0, 1] 718s time = [0, 720] 718s units = f"days since {units_year}-01-01" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s decoded_x = cftime.num2date(x, units, calendar, only_use_cftime_datetimes=True) 718s decoded_time = cftime.num2date( 718s time, units, calendar, only_use_cftime_datetimes=True 718s ) 718s expected_x = DataArray(decoded_x, [("time", decoded_time)], name="x") 718s expected_time = DataArray(decoded_time, [("time", decoded_time)], name="time") 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with warnings.catch_warnings(record=True) as record: 718s decoder = CFDatetimeCoder(use_cftime=True) 718s > with open_dataset(tmp_file, decode_times=decoder) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5825: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _____________________ test_use_cftime_true[2500-all_leap] ______________________ 718s 718s calendar = 'all_leap', units_year = 2500 718s 718s @requires_cftime 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", _ALL_CALENDARS) 718s @pytest.mark.parametrize("units_year", [1500, 2000, 2500]) 718s def test_use_cftime_true(calendar, units_year) -> None: 718s import cftime 718s 718s x = [0, 1] 718s time = [0, 720] 718s units = f"days since {units_year}-01-01" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s decoded_x = cftime.num2date(x, units, calendar, only_use_cftime_datetimes=True) 718s decoded_time = cftime.num2date( 718s time, units, calendar, only_use_cftime_datetimes=True 718s ) 718s expected_x = DataArray(decoded_x, [("time", decoded_time)], name="x") 718s expected_time = DataArray(decoded_time, [("time", decoded_time)], name="time") 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with warnings.catch_warnings(record=True) as record: 718s decoder = CFDatetimeCoder(use_cftime=True) 718s > with open_dataset(tmp_file, decode_times=decoder) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5825: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _____________________ test_use_cftime_true[2500-gregorian] _____________________ 718s 718s calendar = 'gregorian', units_year = 2500 718s 718s @requires_cftime 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", _ALL_CALENDARS) 718s @pytest.mark.parametrize("units_year", [1500, 2000, 2500]) 718s def test_use_cftime_true(calendar, units_year) -> None: 718s import cftime 718s 718s x = [0, 1] 718s time = [0, 720] 718s units = f"days since {units_year}-01-01" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s decoded_x = cftime.num2date(x, units, calendar, only_use_cftime_datetimes=True) 718s decoded_time = cftime.num2date( 718s time, units, calendar, only_use_cftime_datetimes=True 718s ) 718s expected_x = DataArray(decoded_x, [("time", decoded_time)], name="x") 718s expected_time = DataArray(decoded_time, [("time", decoded_time)], name="time") 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with warnings.catch_warnings(record=True) as record: 718s decoder = CFDatetimeCoder(use_cftime=True) 718s > with open_dataset(tmp_file, decode_times=decoder) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5825: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ______________________ test_use_cftime_true[2500-julian] _______________________ 718s 718s calendar = 'julian', units_year = 2500 718s 718s @requires_cftime 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", _ALL_CALENDARS) 718s @pytest.mark.parametrize("units_year", [1500, 2000, 2500]) 718s def test_use_cftime_true(calendar, units_year) -> None: 718s import cftime 718s 718s x = [0, 1] 718s time = [0, 720] 718s units = f"days since {units_year}-01-01" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s decoded_x = cftime.num2date(x, units, calendar, only_use_cftime_datetimes=True) 718s decoded_time = cftime.num2date( 718s time, units, calendar, only_use_cftime_datetimes=True 718s ) 718s expected_x = DataArray(decoded_x, [("time", decoded_time)], name="x") 718s expected_time = DataArray(decoded_time, [("time", decoded_time)], name="time") 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with warnings.catch_warnings(record=True) as record: 718s decoder = CFDatetimeCoder(use_cftime=True) 718s > with open_dataset(tmp_file, decode_times=decoder) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5825: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ______________________ test_use_cftime_true[2500-noleap] _______________________ 718s 718s calendar = 'noleap', units_year = 2500 718s 718s @requires_cftime 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", _ALL_CALENDARS) 718s @pytest.mark.parametrize("units_year", [1500, 2000, 2500]) 718s def test_use_cftime_true(calendar, units_year) -> None: 718s import cftime 718s 718s x = [0, 1] 718s time = [0, 720] 718s units = f"days since {units_year}-01-01" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s decoded_x = cftime.num2date(x, units, calendar, only_use_cftime_datetimes=True) 718s decoded_time = cftime.num2date( 718s time, units, calendar, only_use_cftime_datetimes=True 718s ) 718s expected_x = DataArray(decoded_x, [("time", decoded_time)], name="x") 718s expected_time = DataArray(decoded_time, [("time", decoded_time)], name="time") 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with warnings.catch_warnings(record=True) as record: 718s decoder = CFDatetimeCoder(use_cftime=True) 718s > with open_dataset(tmp_file, decode_times=decoder) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5825: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ________________ test_use_cftime_true[2500-proleptic_gregorian] ________________ 718s 718s calendar = 'proleptic_gregorian', units_year = 2500 718s 718s @requires_cftime 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", _ALL_CALENDARS) 718s @pytest.mark.parametrize("units_year", [1500, 2000, 2500]) 718s def test_use_cftime_true(calendar, units_year) -> None: 718s import cftime 718s 718s x = [0, 1] 718s time = [0, 720] 718s units = f"days since {units_year}-01-01" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s decoded_x = cftime.num2date(x, units, calendar, only_use_cftime_datetimes=True) 718s decoded_time = cftime.num2date( 718s time, units, calendar, only_use_cftime_datetimes=True 718s ) 718s expected_x = DataArray(decoded_x, [("time", decoded_time)], name="x") 718s expected_time = DataArray(decoded_time, [("time", decoded_time)], name="time") 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with warnings.catch_warnings(record=True) as record: 718s decoder = CFDatetimeCoder(use_cftime=True) 718s > with open_dataset(tmp_file, decode_times=decoder) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5825: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _____________________ test_use_cftime_true[2500-standard] ______________________ 718s 718s calendar = 'standard', units_year = 2500 718s 718s @requires_cftime 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", _ALL_CALENDARS) 718s @pytest.mark.parametrize("units_year", [1500, 2000, 2500]) 718s def test_use_cftime_true(calendar, units_year) -> None: 718s import cftime 718s 718s x = [0, 1] 718s time = [0, 720] 718s units = f"days since {units_year}-01-01" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s decoded_x = cftime.num2date(x, units, calendar, only_use_cftime_datetimes=True) 718s decoded_time = cftime.num2date( 718s time, units, calendar, only_use_cftime_datetimes=True 718s ) 718s expected_x = DataArray(decoded_x, [("time", decoded_time)], name="x") 718s expected_time = DataArray(decoded_time, [("time", decoded_time)], name="time") 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with warnings.catch_warnings(record=True) as record: 718s decoder = CFDatetimeCoder(use_cftime=True) 718s > with open_dataset(tmp_file, decode_times=decoder) as ds: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5825: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ________ test_use_cftime_false_standard_calendar_out_of_range[standard] ________ 718s 718s calendar = 'standard' 718s 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", ["standard", "gregorian"]) 718s def test_use_cftime_false_standard_calendar_out_of_range(calendar) -> None: 718s x = [0, 1] 718s time = [0, 720] 718s units = "days since 1582-01-01" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with pytest.raises((OutOfBoundsDatetime, ValueError)): 718s decoder = CFDatetimeCoder(use_cftime=False) 718s > open_dataset(tmp_file, decode_times=decoder) 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5877: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s _______ test_use_cftime_false_standard_calendar_out_of_range[gregorian] ________ 718s 718s calendar = 'gregorian' 718s 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", ["standard", "gregorian"]) 718s def test_use_cftime_false_standard_calendar_out_of_range(calendar) -> None: 718s x = [0, 1] 718s time = [0, 720] 718s units = "days since 1582-01-01" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with pytest.raises((OutOfBoundsDatetime, ValueError)): 718s decoder = CFDatetimeCoder(use_cftime=False) 718s > open_dataset(tmp_file, decode_times=decoder) 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5877: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ___________ test_use_cftime_false_nonstandard_calendar[1500-360_day] ___________ 718s 718s calendar = '360_day', units_year = 1500 718s 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", _NON_STANDARD_CALENDARS) 718s @pytest.mark.parametrize("units_year", [1500, 2000, 2500]) 718s def test_use_cftime_false_nonstandard_calendar(calendar, units_year) -> None: 718s x = [0, 1] 718s time = [0, 720] 718s units = f"days since {units_year}" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with pytest.raises((OutOfBoundsDatetime, ValueError)): 718s decoder = CFDatetimeCoder(use_cftime=False) 718s > open_dataset(tmp_file, decode_times=decoder) 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5896: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ___________ test_use_cftime_false_nonstandard_calendar[1500-365_day] ___________ 718s 718s calendar = '365_day', units_year = 1500 718s 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", _NON_STANDARD_CALENDARS) 718s @pytest.mark.parametrize("units_year", [1500, 2000, 2500]) 718s def test_use_cftime_false_nonstandard_calendar(calendar, units_year) -> None: 718s x = [0, 1] 718s time = [0, 720] 718s units = f"days since {units_year}" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with pytest.raises((OutOfBoundsDatetime, ValueError)): 718s decoder = CFDatetimeCoder(use_cftime=False) 718s > open_dataset(tmp_file, decode_times=decoder) 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5896: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ___________ test_use_cftime_false_nonstandard_calendar[1500-366_day] ___________ 718s 718s calendar = '366_day', units_year = 1500 718s 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", _NON_STANDARD_CALENDARS) 718s @pytest.mark.parametrize("units_year", [1500, 2000, 2500]) 718s def test_use_cftime_false_nonstandard_calendar(calendar, units_year) -> None: 718s x = [0, 1] 718s time = [0, 720] 718s units = f"days since {units_year}" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with pytest.raises((OutOfBoundsDatetime, ValueError)): 718s decoder = CFDatetimeCoder(use_cftime=False) 718s > open_dataset(tmp_file, decode_times=decoder) 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5896: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s __________ test_use_cftime_false_nonstandard_calendar[1500-all_leap] ___________ 718s 718s calendar = 'all_leap', units_year = 1500 718s 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", _NON_STANDARD_CALENDARS) 718s @pytest.mark.parametrize("units_year", [1500, 2000, 2500]) 718s def test_use_cftime_false_nonstandard_calendar(calendar, units_year) -> None: 718s x = [0, 1] 718s time = [0, 720] 718s units = f"days since {units_year}" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with pytest.raises((OutOfBoundsDatetime, ValueError)): 718s decoder = CFDatetimeCoder(use_cftime=False) 718s > open_dataset(tmp_file, decode_times=decoder) 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5896: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ___________ test_use_cftime_false_nonstandard_calendar[1500-julian] ____________ 718s 718s calendar = 'julian', units_year = 1500 718s 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", _NON_STANDARD_CALENDARS) 718s @pytest.mark.parametrize("units_year", [1500, 2000, 2500]) 718s def test_use_cftime_false_nonstandard_calendar(calendar, units_year) -> None: 718s x = [0, 1] 718s time = [0, 720] 718s units = f"days since {units_year}" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with pytest.raises((OutOfBoundsDatetime, ValueError)): 718s decoder = CFDatetimeCoder(use_cftime=False) 718s > open_dataset(tmp_file, decode_times=decoder) 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5896: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ___________ test_use_cftime_false_nonstandard_calendar[1500-noleap] ____________ 718s 718s calendar = 'noleap', units_year = 1500 718s 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", _NON_STANDARD_CALENDARS) 718s @pytest.mark.parametrize("units_year", [1500, 2000, 2500]) 718s def test_use_cftime_false_nonstandard_calendar(calendar, units_year) -> None: 718s x = [0, 1] 718s time = [0, 720] 718s units = f"days since {units_year}" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with pytest.raises((OutOfBoundsDatetime, ValueError)): 718s decoder = CFDatetimeCoder(use_cftime=False) 718s > open_dataset(tmp_file, decode_times=decoder) 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5896: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ___________ test_use_cftime_false_nonstandard_calendar[2000-360_day] ___________ 718s 718s calendar = '360_day', units_year = 2000 718s 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", _NON_STANDARD_CALENDARS) 718s @pytest.mark.parametrize("units_year", [1500, 2000, 2500]) 718s def test_use_cftime_false_nonstandard_calendar(calendar, units_year) -> None: 718s x = [0, 1] 718s time = [0, 720] 718s units = f"days since {units_year}" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with pytest.raises((OutOfBoundsDatetime, ValueError)): 718s decoder = CFDatetimeCoder(use_cftime=False) 718s > open_dataset(tmp_file, decode_times=decoder) 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5896: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ___________ test_use_cftime_false_nonstandard_calendar[2000-365_day] ___________ 718s 718s calendar = '365_day', units_year = 2000 718s 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", _NON_STANDARD_CALENDARS) 718s @pytest.mark.parametrize("units_year", [1500, 2000, 2500]) 718s def test_use_cftime_false_nonstandard_calendar(calendar, units_year) -> None: 718s x = [0, 1] 718s time = [0, 720] 718s units = f"days since {units_year}" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with pytest.raises((OutOfBoundsDatetime, ValueError)): 718s decoder = CFDatetimeCoder(use_cftime=False) 718s > open_dataset(tmp_file, decode_times=decoder) 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5896: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ___________ test_use_cftime_false_nonstandard_calendar[2000-366_day] ___________ 718s 718s calendar = '366_day', units_year = 2000 718s 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", _NON_STANDARD_CALENDARS) 718s @pytest.mark.parametrize("units_year", [1500, 2000, 2500]) 718s def test_use_cftime_false_nonstandard_calendar(calendar, units_year) -> None: 718s x = [0, 1] 718s time = [0, 720] 718s units = f"days since {units_year}" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with pytest.raises((OutOfBoundsDatetime, ValueError)): 718s decoder = CFDatetimeCoder(use_cftime=False) 718s > open_dataset(tmp_file, decode_times=decoder) 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5896: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s __________ test_use_cftime_false_nonstandard_calendar[2000-all_leap] ___________ 718s 718s calendar = 'all_leap', units_year = 2000 718s 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", _NON_STANDARD_CALENDARS) 718s @pytest.mark.parametrize("units_year", [1500, 2000, 2500]) 718s def test_use_cftime_false_nonstandard_calendar(calendar, units_year) -> None: 718s x = [0, 1] 718s time = [0, 720] 718s units = f"days since {units_year}" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with pytest.raises((OutOfBoundsDatetime, ValueError)): 718s decoder = CFDatetimeCoder(use_cftime=False) 718s > open_dataset(tmp_file, decode_times=decoder) 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5896: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ___________ test_use_cftime_false_nonstandard_calendar[2000-julian] ____________ 718s 718s calendar = 'julian', units_year = 2000 718s 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", _NON_STANDARD_CALENDARS) 718s @pytest.mark.parametrize("units_year", [1500, 2000, 2500]) 718s def test_use_cftime_false_nonstandard_calendar(calendar, units_year) -> None: 718s x = [0, 1] 718s time = [0, 720] 718s units = f"days since {units_year}" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with pytest.raises((OutOfBoundsDatetime, ValueError)): 718s decoder = CFDatetimeCoder(use_cftime=False) 718s > open_dataset(tmp_file, decode_times=decoder) 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5896: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ___________ test_use_cftime_false_nonstandard_calendar[2000-noleap] ____________ 718s 718s calendar = 'noleap', units_year = 2000 718s 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", _NON_STANDARD_CALENDARS) 718s @pytest.mark.parametrize("units_year", [1500, 2000, 2500]) 718s def test_use_cftime_false_nonstandard_calendar(calendar, units_year) -> None: 718s x = [0, 1] 718s time = [0, 720] 718s units = f"days since {units_year}" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with pytest.raises((OutOfBoundsDatetime, ValueError)): 718s decoder = CFDatetimeCoder(use_cftime=False) 718s > open_dataset(tmp_file, decode_times=decoder) 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5896: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ___________ test_use_cftime_false_nonstandard_calendar[2500-360_day] ___________ 718s 718s calendar = '360_day', units_year = 2500 718s 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", _NON_STANDARD_CALENDARS) 718s @pytest.mark.parametrize("units_year", [1500, 2000, 2500]) 718s def test_use_cftime_false_nonstandard_calendar(calendar, units_year) -> None: 718s x = [0, 1] 718s time = [0, 720] 718s units = f"days since {units_year}" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with pytest.raises((OutOfBoundsDatetime, ValueError)): 718s decoder = CFDatetimeCoder(use_cftime=False) 718s > open_dataset(tmp_file, decode_times=decoder) 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5896: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ___________ test_use_cftime_false_nonstandard_calendar[2500-365_day] ___________ 718s 718s calendar = '365_day', units_year = 2500 718s 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", _NON_STANDARD_CALENDARS) 718s @pytest.mark.parametrize("units_year", [1500, 2000, 2500]) 718s def test_use_cftime_false_nonstandard_calendar(calendar, units_year) -> None: 718s x = [0, 1] 718s time = [0, 720] 718s units = f"days since {units_year}" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with pytest.raises((OutOfBoundsDatetime, ValueError)): 718s decoder = CFDatetimeCoder(use_cftime=False) 718s > open_dataset(tmp_file, decode_times=decoder) 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5896: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ___________ test_use_cftime_false_nonstandard_calendar[2500-366_day] ___________ 718s 718s calendar = '366_day', units_year = 2500 718s 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", _NON_STANDARD_CALENDARS) 718s @pytest.mark.parametrize("units_year", [1500, 2000, 2500]) 718s def test_use_cftime_false_nonstandard_calendar(calendar, units_year) -> None: 718s x = [0, 1] 718s time = [0, 720] 718s units = f"days since {units_year}" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with pytest.raises((OutOfBoundsDatetime, ValueError)): 718s decoder = CFDatetimeCoder(use_cftime=False) 718s > open_dataset(tmp_file, decode_times=decoder) 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5896: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s __________ test_use_cftime_false_nonstandard_calendar[2500-all_leap] ___________ 718s 718s calendar = 'all_leap', units_year = 2500 718s 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", _NON_STANDARD_CALENDARS) 718s @pytest.mark.parametrize("units_year", [1500, 2000, 2500]) 718s def test_use_cftime_false_nonstandard_calendar(calendar, units_year) -> None: 718s x = [0, 1] 718s time = [0, 720] 718s units = f"days since {units_year}" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with pytest.raises((OutOfBoundsDatetime, ValueError)): 718s decoder = CFDatetimeCoder(use_cftime=False) 718s > open_dataset(tmp_file, decode_times=decoder) 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5896: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ___________ test_use_cftime_false_nonstandard_calendar[2500-julian] ____________ 718s 718s calendar = 'julian', units_year = 2500 718s 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", _NON_STANDARD_CALENDARS) 718s @pytest.mark.parametrize("units_year", [1500, 2000, 2500]) 718s def test_use_cftime_false_nonstandard_calendar(calendar, units_year) -> None: 718s x = [0, 1] 718s time = [0, 720] 718s units = f"days since {units_year}" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with pytest.raises((OutOfBoundsDatetime, ValueError)): 718s decoder = CFDatetimeCoder(use_cftime=False) 718s > open_dataset(tmp_file, decode_times=decoder) 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5896: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ___________ test_use_cftime_false_nonstandard_calendar[2500-noleap] ____________ 718s 718s calendar = 'noleap', units_year = 2500 718s 718s @requires_scipy_or_netCDF4 718s @pytest.mark.parametrize("calendar", _NON_STANDARD_CALENDARS) 718s @pytest.mark.parametrize("units_year", [1500, 2000, 2500]) 718s def test_use_cftime_false_nonstandard_calendar(calendar, units_year) -> None: 718s x = [0, 1] 718s time = [0, 720] 718s units = f"days since {units_year}" 718s original = DataArray(x, [("time", time)], name="x").to_dataset() 718s for v in ["x", "time"]: 718s original[v].attrs["units"] = units 718s original[v].attrs["calendar"] = calendar 718s 718s with create_tmp_file() as tmp_file: 718s original.to_netcdf(tmp_file) 718s with pytest.raises((OutOfBoundsDatetime, ValueError)): 718s decoder = CFDatetimeCoder(use_cftime=False) 718s > open_dataset(tmp_file, decode_times=decoder) 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:5896: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ____________________ test_open_dataset_chunking_zarr[auto] _____________________ 718s 718s chunks = 'auto' 718s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_open_dataset_chunking_zar0') 718s 718s @requires_zarr 718s @requires_dask 718s @pytest.mark.parametrize( 718s "chunks", ["auto", -1, {}, {"x": "auto"}, {"x": -1}, {"x": "auto", "y": -1}] 718s ) 718s def test_open_dataset_chunking_zarr(chunks, tmp_path: Path) -> None: 718s encoded_chunks = 100 718s dask_arr = da.from_array( 718s np.ones((500, 500), dtype="float64"), chunks=encoded_chunks 718s ) 718s ds = xr.Dataset( 718s { 718s "test": xr.DataArray( 718s dask_arr, 718s dims=("x", "y"), 718s ) 718s } 718s ) 718s ds["test"].encoding["chunks"] = encoded_chunks 718s ds.to_zarr(tmp_path / "test.zarr") 718s 718s with dask.config.set({"array.chunk-size": "1MiB"}): 718s expected = ds.chunk(chunks) 718s > with open_dataset( 718s tmp_path / "test.zarr", engine="zarr", chunks=chunks 718s ) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6043: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 718s ds = store_entrypoint.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 718s vars, attrs = filename_or_obj.load() 718s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 718s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 718s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 718s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 718s return Frozen(dict(*args, **kwargs)) 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 718s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = , name = 'test' 718s 718s def open_store_variable(self, name): 718s zarr_array = self.members[name] 718s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 718s try_nczarr = self._mode == "r" 718s dimensions, attributes = _get_zarr_dims_and_attrs( 718s zarr_array, DIMENSION_KEY, try_nczarr 718s ) 718s attributes = dict(attributes) 718s 718s encoding = { 718s "chunks": zarr_array.chunks, 718s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 718s } 718s 718s if _zarr_v3(): 718s encoding.update( 718s { 718s "compressors": zarr_array.compressors, 718s "filters": zarr_array.filters, 718s "shards": zarr_array.shards, 718s } 718s ) 718s if self.zarr_group.metadata.zarr_format == 3: 718s encoding.update({"serializer": zarr_array.serializer}) 718s else: 718s encoding.update( 718s { 718s "compressor": zarr_array.compressor, 718s "filters": zarr_array.filters, 718s } 718s ) 718s 718s if self._use_zarr_fill_value_as_mask: 718s # Setting this attribute triggers CF decoding for missing values 718s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 718s if zarr_array.fill_value is not None: 718s attributes["_FillValue"] = zarr_array.fill_value 718s elif "_FillValue" in attributes: 718s original_zarr_dtype = zarr_array.metadata.data_type 718s attributes["_FillValue"] = FillValueCoder.decode( 718s > attributes["_FillValue"], original_zarr_dtype.value 718s ) 718s E AttributeError: 'Float64' object has no attribute 'value' 718s 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 718s _____________________ test_open_dataset_chunking_zarr[-1] ______________________ 718s 718s chunks = -1 718s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_open_dataset_chunking_zar1') 718s 718s @requires_zarr 718s @requires_dask 718s @pytest.mark.parametrize( 718s "chunks", ["auto", -1, {}, {"x": "auto"}, {"x": -1}, {"x": "auto", "y": -1}] 718s ) 718s def test_open_dataset_chunking_zarr(chunks, tmp_path: Path) -> None: 718s encoded_chunks = 100 718s dask_arr = da.from_array( 718s np.ones((500, 500), dtype="float64"), chunks=encoded_chunks 718s ) 718s ds = xr.Dataset( 718s { 718s "test": xr.DataArray( 718s dask_arr, 718s dims=("x", "y"), 718s ) 718s } 718s ) 718s ds["test"].encoding["chunks"] = encoded_chunks 718s ds.to_zarr(tmp_path / "test.zarr") 718s 718s with dask.config.set({"array.chunk-size": "1MiB"}): 718s expected = ds.chunk(chunks) 718s > with open_dataset( 718s tmp_path / "test.zarr", engine="zarr", chunks=chunks 718s ) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6043: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 718s ds = store_entrypoint.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 718s vars, attrs = filename_or_obj.load() 718s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 718s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 718s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 718s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 718s return Frozen(dict(*args, **kwargs)) 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 718s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = , name = 'test' 718s 718s def open_store_variable(self, name): 718s zarr_array = self.members[name] 718s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 718s try_nczarr = self._mode == "r" 718s dimensions, attributes = _get_zarr_dims_and_attrs( 718s zarr_array, DIMENSION_KEY, try_nczarr 718s ) 718s attributes = dict(attributes) 718s 718s encoding = { 718s "chunks": zarr_array.chunks, 718s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 718s } 718s 718s if _zarr_v3(): 718s encoding.update( 718s { 718s "compressors": zarr_array.compressors, 718s "filters": zarr_array.filters, 718s "shards": zarr_array.shards, 718s } 718s ) 718s if self.zarr_group.metadata.zarr_format == 3: 718s encoding.update({"serializer": zarr_array.serializer}) 718s else: 718s encoding.update( 718s { 718s "compressor": zarr_array.compressor, 718s "filters": zarr_array.filters, 718s } 718s ) 718s 718s if self._use_zarr_fill_value_as_mask: 718s # Setting this attribute triggers CF decoding for missing values 718s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 718s if zarr_array.fill_value is not None: 718s attributes["_FillValue"] = zarr_array.fill_value 718s elif "_FillValue" in attributes: 718s original_zarr_dtype = zarr_array.metadata.data_type 718s attributes["_FillValue"] = FillValueCoder.decode( 718s > attributes["_FillValue"], original_zarr_dtype.value 718s ) 718s E AttributeError: 'Float64' object has no attribute 'value' 718s 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 718s ___________________ test_open_dataset_chunking_zarr[chunks2] ___________________ 718s 718s chunks = {} 718s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_open_dataset_chunking_zar2') 718s 718s @requires_zarr 718s @requires_dask 718s @pytest.mark.parametrize( 718s "chunks", ["auto", -1, {}, {"x": "auto"}, {"x": -1}, {"x": "auto", "y": -1}] 718s ) 718s def test_open_dataset_chunking_zarr(chunks, tmp_path: Path) -> None: 718s encoded_chunks = 100 718s dask_arr = da.from_array( 718s np.ones((500, 500), dtype="float64"), chunks=encoded_chunks 718s ) 718s ds = xr.Dataset( 718s { 718s "test": xr.DataArray( 718s dask_arr, 718s dims=("x", "y"), 718s ) 718s } 718s ) 718s ds["test"].encoding["chunks"] = encoded_chunks 718s ds.to_zarr(tmp_path / "test.zarr") 718s 718s with dask.config.set({"array.chunk-size": "1MiB"}): 718s expected = ds.chunk(chunks) 718s > with open_dataset( 718s tmp_path / "test.zarr", engine="zarr", chunks=chunks 718s ) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6043: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 718s ds = store_entrypoint.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 718s vars, attrs = filename_or_obj.load() 718s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 718s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 718s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 718s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 718s return Frozen(dict(*args, **kwargs)) 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 718s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = , name = 'test' 718s 718s def open_store_variable(self, name): 718s zarr_array = self.members[name] 718s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 718s try_nczarr = self._mode == "r" 718s dimensions, attributes = _get_zarr_dims_and_attrs( 718s zarr_array, DIMENSION_KEY, try_nczarr 718s ) 718s attributes = dict(attributes) 718s 718s encoding = { 718s "chunks": zarr_array.chunks, 718s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 718s } 718s 718s if _zarr_v3(): 718s encoding.update( 718s { 718s "compressors": zarr_array.compressors, 718s "filters": zarr_array.filters, 718s "shards": zarr_array.shards, 718s } 718s ) 718s if self.zarr_group.metadata.zarr_format == 3: 718s encoding.update({"serializer": zarr_array.serializer}) 718s else: 718s encoding.update( 718s { 718s "compressor": zarr_array.compressor, 718s "filters": zarr_array.filters, 718s } 718s ) 718s 718s if self._use_zarr_fill_value_as_mask: 718s # Setting this attribute triggers CF decoding for missing values 718s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 718s if zarr_array.fill_value is not None: 718s attributes["_FillValue"] = zarr_array.fill_value 718s elif "_FillValue" in attributes: 718s original_zarr_dtype = zarr_array.metadata.data_type 718s attributes["_FillValue"] = FillValueCoder.decode( 718s > attributes["_FillValue"], original_zarr_dtype.value 718s ) 718s E AttributeError: 'Float64' object has no attribute 'value' 718s 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 718s ___________________ test_open_dataset_chunking_zarr[chunks3] ___________________ 718s 718s chunks = {'x': 'auto'} 718s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_open_dataset_chunking_zar3') 718s 718s @requires_zarr 718s @requires_dask 718s @pytest.mark.parametrize( 718s "chunks", ["auto", -1, {}, {"x": "auto"}, {"x": -1}, {"x": "auto", "y": -1}] 718s ) 718s def test_open_dataset_chunking_zarr(chunks, tmp_path: Path) -> None: 718s encoded_chunks = 100 718s dask_arr = da.from_array( 718s np.ones((500, 500), dtype="float64"), chunks=encoded_chunks 718s ) 718s ds = xr.Dataset( 718s { 718s "test": xr.DataArray( 718s dask_arr, 718s dims=("x", "y"), 718s ) 718s } 718s ) 718s ds["test"].encoding["chunks"] = encoded_chunks 718s ds.to_zarr(tmp_path / "test.zarr") 718s 718s with dask.config.set({"array.chunk-size": "1MiB"}): 718s expected = ds.chunk(chunks) 718s > with open_dataset( 718s tmp_path / "test.zarr", engine="zarr", chunks=chunks 718s ) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6043: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 718s ds = store_entrypoint.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 718s vars, attrs = filename_or_obj.load() 718s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 718s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 718s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 718s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 718s return Frozen(dict(*args, **kwargs)) 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 718s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = , name = 'test' 718s 718s def open_store_variable(self, name): 718s zarr_array = self.members[name] 718s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 718s try_nczarr = self._mode == "r" 718s dimensions, attributes = _get_zarr_dims_and_attrs( 718s zarr_array, DIMENSION_KEY, try_nczarr 718s ) 718s attributes = dict(attributes) 718s 718s encoding = { 718s "chunks": zarr_array.chunks, 718s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 718s } 718s 718s if _zarr_v3(): 718s encoding.update( 718s { 718s "compressors": zarr_array.compressors, 718s "filters": zarr_array.filters, 718s "shards": zarr_array.shards, 718s } 718s ) 718s if self.zarr_group.metadata.zarr_format == 3: 718s encoding.update({"serializer": zarr_array.serializer}) 718s else: 718s encoding.update( 718s { 718s "compressor": zarr_array.compressor, 718s "filters": zarr_array.filters, 718s } 718s ) 718s 718s if self._use_zarr_fill_value_as_mask: 718s # Setting this attribute triggers CF decoding for missing values 718s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 718s if zarr_array.fill_value is not None: 718s attributes["_FillValue"] = zarr_array.fill_value 718s elif "_FillValue" in attributes: 718s original_zarr_dtype = zarr_array.metadata.data_type 718s attributes["_FillValue"] = FillValueCoder.decode( 718s > attributes["_FillValue"], original_zarr_dtype.value 718s ) 718s E AttributeError: 'Float64' object has no attribute 'value' 718s 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 718s ___________________ test_open_dataset_chunking_zarr[chunks4] ___________________ 718s 718s chunks = {'x': -1} 718s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_open_dataset_chunking_zar4') 718s 718s @requires_zarr 718s @requires_dask 718s @pytest.mark.parametrize( 718s "chunks", ["auto", -1, {}, {"x": "auto"}, {"x": -1}, {"x": "auto", "y": -1}] 718s ) 718s def test_open_dataset_chunking_zarr(chunks, tmp_path: Path) -> None: 718s encoded_chunks = 100 718s dask_arr = da.from_array( 718s np.ones((500, 500), dtype="float64"), chunks=encoded_chunks 718s ) 718s ds = xr.Dataset( 718s { 718s "test": xr.DataArray( 718s dask_arr, 718s dims=("x", "y"), 718s ) 718s } 718s ) 718s ds["test"].encoding["chunks"] = encoded_chunks 718s ds.to_zarr(tmp_path / "test.zarr") 718s 718s with dask.config.set({"array.chunk-size": "1MiB"}): 718s expected = ds.chunk(chunks) 718s > with open_dataset( 718s tmp_path / "test.zarr", engine="zarr", chunks=chunks 718s ) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6043: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 718s ds = store_entrypoint.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 718s vars, attrs = filename_or_obj.load() 718s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 718s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 718s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 718s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 718s return Frozen(dict(*args, **kwargs)) 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 718s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = , name = 'test' 718s 718s def open_store_variable(self, name): 718s zarr_array = self.members[name] 718s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 718s try_nczarr = self._mode == "r" 718s dimensions, attributes = _get_zarr_dims_and_attrs( 718s zarr_array, DIMENSION_KEY, try_nczarr 718s ) 718s attributes = dict(attributes) 718s 718s encoding = { 718s "chunks": zarr_array.chunks, 718s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 718s } 718s 718s if _zarr_v3(): 718s encoding.update( 718s { 718s "compressors": zarr_array.compressors, 718s "filters": zarr_array.filters, 718s "shards": zarr_array.shards, 718s } 718s ) 718s if self.zarr_group.metadata.zarr_format == 3: 718s encoding.update({"serializer": zarr_array.serializer}) 718s else: 718s encoding.update( 718s { 718s "compressor": zarr_array.compressor, 718s "filters": zarr_array.filters, 718s } 718s ) 718s 718s if self._use_zarr_fill_value_as_mask: 718s # Setting this attribute triggers CF decoding for missing values 718s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 718s if zarr_array.fill_value is not None: 718s attributes["_FillValue"] = zarr_array.fill_value 718s elif "_FillValue" in attributes: 718s original_zarr_dtype = zarr_array.metadata.data_type 718s attributes["_FillValue"] = FillValueCoder.decode( 718s > attributes["_FillValue"], original_zarr_dtype.value 718s ) 718s E AttributeError: 'Float64' object has no attribute 'value' 718s 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 718s ___________________ test_open_dataset_chunking_zarr[chunks5] ___________________ 718s 718s chunks = {'x': 'auto', 'y': -1} 718s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_open_dataset_chunking_zar5') 718s 718s @requires_zarr 718s @requires_dask 718s @pytest.mark.parametrize( 718s "chunks", ["auto", -1, {}, {"x": "auto"}, {"x": -1}, {"x": "auto", "y": -1}] 718s ) 718s def test_open_dataset_chunking_zarr(chunks, tmp_path: Path) -> None: 718s encoded_chunks = 100 718s dask_arr = da.from_array( 718s np.ones((500, 500), dtype="float64"), chunks=encoded_chunks 718s ) 718s ds = xr.Dataset( 718s { 718s "test": xr.DataArray( 718s dask_arr, 718s dims=("x", "y"), 718s ) 718s } 718s ) 718s ds["test"].encoding["chunks"] = encoded_chunks 718s ds.to_zarr(tmp_path / "test.zarr") 718s 718s with dask.config.set({"array.chunk-size": "1MiB"}): 718s expected = ds.chunk(chunks) 718s > with open_dataset( 718s tmp_path / "test.zarr", engine="zarr", chunks=chunks 718s ) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6043: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 718s ds = store_entrypoint.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 718s vars, attrs = filename_or_obj.load() 718s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 718s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 718s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 718s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 718s return Frozen(dict(*args, **kwargs)) 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 718s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = , name = 'test' 718s 718s def open_store_variable(self, name): 718s zarr_array = self.members[name] 718s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 718s try_nczarr = self._mode == "r" 718s dimensions, attributes = _get_zarr_dims_and_attrs( 718s zarr_array, DIMENSION_KEY, try_nczarr 718s ) 718s attributes = dict(attributes) 718s 718s encoding = { 718s "chunks": zarr_array.chunks, 718s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 718s } 718s 718s if _zarr_v3(): 718s encoding.update( 718s { 718s "compressors": zarr_array.compressors, 718s "filters": zarr_array.filters, 718s "shards": zarr_array.shards, 718s } 718s ) 718s if self.zarr_group.metadata.zarr_format == 3: 718s encoding.update({"serializer": zarr_array.serializer}) 718s else: 718s encoding.update( 718s { 718s "compressor": zarr_array.compressor, 718s "filters": zarr_array.filters, 718s } 718s ) 718s 718s if self._use_zarr_fill_value_as_mask: 718s # Setting this attribute triggers CF decoding for missing values 718s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 718s if zarr_array.fill_value is not None: 718s attributes["_FillValue"] = zarr_array.fill_value 718s elif "_FillValue" in attributes: 718s original_zarr_dtype = zarr_array.metadata.data_type 718s attributes["_FillValue"] = FillValueCoder.decode( 718s > attributes["_FillValue"], original_zarr_dtype.value 718s ) 718s E AttributeError: 'Float64' object has no attribute 'value' 718s 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 718s _______________________ test_chunking_consintency[auto] ________________________ 718s 718s chunks = 'auto' 718s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_chunking_consintency_auto0') 718s 718s @requires_zarr 718s @requires_dask 718s @pytest.mark.parametrize( 718s "chunks", ["auto", -1, {}, {"x": "auto"}, {"x": -1}, {"x": "auto", "y": -1}] 718s ) 718s @pytest.mark.filterwarnings("ignore:The specified chunks separate") 718s def test_chunking_consintency(chunks, tmp_path: Path) -> None: 718s encoded_chunks: dict[str, Any] = {} 718s dask_arr = da.from_array( 718s np.ones((500, 500), dtype="float64"), chunks=encoded_chunks 718s ) 718s ds = xr.Dataset( 718s { 718s "test": xr.DataArray( 718s dask_arr, 718s dims=("x", "y"), 718s ) 718s } 718s ) 718s ds["test"].encoding["chunks"] = encoded_chunks 718s ds.to_zarr(tmp_path / "test.zarr") 718s ds.to_netcdf(tmp_path / "test.nc") 718s 718s with dask.config.set({"array.chunk-size": "1MiB"}): 718s expected = ds.chunk(chunks) 718s > with xr.open_dataset( 718s tmp_path / "test.zarr", engine="zarr", chunks=chunks 718s ) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6074: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 718s ds = store_entrypoint.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 718s vars, attrs = filename_or_obj.load() 718s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 718s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 718s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 718s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 718s return Frozen(dict(*args, **kwargs)) 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 718s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = , name = 'test' 718s 718s def open_store_variable(self, name): 718s zarr_array = self.members[name] 718s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 718s try_nczarr = self._mode == "r" 718s dimensions, attributes = _get_zarr_dims_and_attrs( 718s zarr_array, DIMENSION_KEY, try_nczarr 718s ) 718s attributes = dict(attributes) 718s 718s encoding = { 718s "chunks": zarr_array.chunks, 718s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 718s } 718s 718s if _zarr_v3(): 718s encoding.update( 718s { 718s "compressors": zarr_array.compressors, 718s "filters": zarr_array.filters, 718s "shards": zarr_array.shards, 718s } 718s ) 718s if self.zarr_group.metadata.zarr_format == 3: 718s encoding.update({"serializer": zarr_array.serializer}) 718s else: 718s encoding.update( 718s { 718s "compressor": zarr_array.compressor, 718s "filters": zarr_array.filters, 718s } 718s ) 718s 718s if self._use_zarr_fill_value_as_mask: 718s # Setting this attribute triggers CF decoding for missing values 718s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 718s if zarr_array.fill_value is not None: 718s attributes["_FillValue"] = zarr_array.fill_value 718s elif "_FillValue" in attributes: 718s original_zarr_dtype = zarr_array.metadata.data_type 718s attributes["_FillValue"] = FillValueCoder.decode( 718s > attributes["_FillValue"], original_zarr_dtype.value 718s ) 718s E AttributeError: 'Float64' object has no attribute 'value' 718s 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 718s ________________________ test_chunking_consintency[-1] _________________________ 718s 718s chunks = -1 718s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_chunking_consintency__1_0') 718s 718s @requires_zarr 718s @requires_dask 718s @pytest.mark.parametrize( 718s "chunks", ["auto", -1, {}, {"x": "auto"}, {"x": -1}, {"x": "auto", "y": -1}] 718s ) 718s @pytest.mark.filterwarnings("ignore:The specified chunks separate") 718s def test_chunking_consintency(chunks, tmp_path: Path) -> None: 718s encoded_chunks: dict[str, Any] = {} 718s dask_arr = da.from_array( 718s np.ones((500, 500), dtype="float64"), chunks=encoded_chunks 718s ) 718s ds = xr.Dataset( 718s { 718s "test": xr.DataArray( 718s dask_arr, 718s dims=("x", "y"), 718s ) 718s } 718s ) 718s ds["test"].encoding["chunks"] = encoded_chunks 718s ds.to_zarr(tmp_path / "test.zarr") 718s ds.to_netcdf(tmp_path / "test.nc") 718s 718s with dask.config.set({"array.chunk-size": "1MiB"}): 718s expected = ds.chunk(chunks) 718s > with xr.open_dataset( 718s tmp_path / "test.zarr", engine="zarr", chunks=chunks 718s ) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6074: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 718s ds = store_entrypoint.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 718s vars, attrs = filename_or_obj.load() 718s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 718s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 718s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 718s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 718s return Frozen(dict(*args, **kwargs)) 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 718s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = , name = 'test' 718s 718s def open_store_variable(self, name): 718s zarr_array = self.members[name] 718s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 718s try_nczarr = self._mode == "r" 718s dimensions, attributes = _get_zarr_dims_and_attrs( 718s zarr_array, DIMENSION_KEY, try_nczarr 718s ) 718s attributes = dict(attributes) 718s 718s encoding = { 718s "chunks": zarr_array.chunks, 718s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 718s } 718s 718s if _zarr_v3(): 718s encoding.update( 718s { 718s "compressors": zarr_array.compressors, 718s "filters": zarr_array.filters, 718s "shards": zarr_array.shards, 718s } 718s ) 718s if self.zarr_group.metadata.zarr_format == 3: 718s encoding.update({"serializer": zarr_array.serializer}) 718s else: 718s encoding.update( 718s { 718s "compressor": zarr_array.compressor, 718s "filters": zarr_array.filters, 718s } 718s ) 718s 718s if self._use_zarr_fill_value_as_mask: 718s # Setting this attribute triggers CF decoding for missing values 718s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 718s if zarr_array.fill_value is not None: 718s attributes["_FillValue"] = zarr_array.fill_value 718s elif "_FillValue" in attributes: 718s original_zarr_dtype = zarr_array.metadata.data_type 718s attributes["_FillValue"] = FillValueCoder.decode( 718s > attributes["_FillValue"], original_zarr_dtype.value 718s ) 718s E AttributeError: 'Float64' object has no attribute 'value' 718s 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 718s ______________________ test_chunking_consintency[chunks2] ______________________ 718s 718s chunks = {} 718s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_chunking_consintency_chun0') 718s 718s @requires_zarr 718s @requires_dask 718s @pytest.mark.parametrize( 718s "chunks", ["auto", -1, {}, {"x": "auto"}, {"x": -1}, {"x": "auto", "y": -1}] 718s ) 718s @pytest.mark.filterwarnings("ignore:The specified chunks separate") 718s def test_chunking_consintency(chunks, tmp_path: Path) -> None: 718s encoded_chunks: dict[str, Any] = {} 718s dask_arr = da.from_array( 718s np.ones((500, 500), dtype="float64"), chunks=encoded_chunks 718s ) 718s ds = xr.Dataset( 718s { 718s "test": xr.DataArray( 718s dask_arr, 718s dims=("x", "y"), 718s ) 718s } 718s ) 718s ds["test"].encoding["chunks"] = encoded_chunks 718s ds.to_zarr(tmp_path / "test.zarr") 718s ds.to_netcdf(tmp_path / "test.nc") 718s 718s with dask.config.set({"array.chunk-size": "1MiB"}): 718s expected = ds.chunk(chunks) 718s > with xr.open_dataset( 718s tmp_path / "test.zarr", engine="zarr", chunks=chunks 718s ) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6074: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 718s ds = store_entrypoint.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 718s vars, attrs = filename_or_obj.load() 718s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 718s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 718s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 718s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 718s return Frozen(dict(*args, **kwargs)) 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 718s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = , name = 'test' 718s 718s def open_store_variable(self, name): 718s zarr_array = self.members[name] 718s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 718s try_nczarr = self._mode == "r" 718s dimensions, attributes = _get_zarr_dims_and_attrs( 718s zarr_array, DIMENSION_KEY, try_nczarr 718s ) 718s attributes = dict(attributes) 718s 718s encoding = { 718s "chunks": zarr_array.chunks, 718s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 718s } 718s 718s if _zarr_v3(): 718s encoding.update( 718s { 718s "compressors": zarr_array.compressors, 718s "filters": zarr_array.filters, 718s "shards": zarr_array.shards, 718s } 718s ) 718s if self.zarr_group.metadata.zarr_format == 3: 718s encoding.update({"serializer": zarr_array.serializer}) 718s else: 718s encoding.update( 718s { 718s "compressor": zarr_array.compressor, 718s "filters": zarr_array.filters, 718s } 718s ) 718s 718s if self._use_zarr_fill_value_as_mask: 718s # Setting this attribute triggers CF decoding for missing values 718s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 718s if zarr_array.fill_value is not None: 718s attributes["_FillValue"] = zarr_array.fill_value 718s elif "_FillValue" in attributes: 718s original_zarr_dtype = zarr_array.metadata.data_type 718s attributes["_FillValue"] = FillValueCoder.decode( 718s > attributes["_FillValue"], original_zarr_dtype.value 718s ) 718s E AttributeError: 'Float64' object has no attribute 'value' 718s 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 718s ______________________ test_chunking_consintency[chunks3] ______________________ 718s 718s chunks = {'x': 'auto'} 718s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_chunking_consintency_chun1') 718s 718s @requires_zarr 718s @requires_dask 718s @pytest.mark.parametrize( 718s "chunks", ["auto", -1, {}, {"x": "auto"}, {"x": -1}, {"x": "auto", "y": -1}] 718s ) 718s @pytest.mark.filterwarnings("ignore:The specified chunks separate") 718s def test_chunking_consintency(chunks, tmp_path: Path) -> None: 718s encoded_chunks: dict[str, Any] = {} 718s dask_arr = da.from_array( 718s np.ones((500, 500), dtype="float64"), chunks=encoded_chunks 718s ) 718s ds = xr.Dataset( 718s { 718s "test": xr.DataArray( 718s dask_arr, 718s dims=("x", "y"), 718s ) 718s } 718s ) 718s ds["test"].encoding["chunks"] = encoded_chunks 718s ds.to_zarr(tmp_path / "test.zarr") 718s ds.to_netcdf(tmp_path / "test.nc") 718s 718s with dask.config.set({"array.chunk-size": "1MiB"}): 718s expected = ds.chunk(chunks) 718s > with xr.open_dataset( 718s tmp_path / "test.zarr", engine="zarr", chunks=chunks 718s ) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6074: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 718s ds = store_entrypoint.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 718s vars, attrs = filename_or_obj.load() 718s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 718s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 718s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 718s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 718s return Frozen(dict(*args, **kwargs)) 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 718s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = , name = 'test' 718s 718s def open_store_variable(self, name): 718s zarr_array = self.members[name] 718s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 718s try_nczarr = self._mode == "r" 718s dimensions, attributes = _get_zarr_dims_and_attrs( 718s zarr_array, DIMENSION_KEY, try_nczarr 718s ) 718s attributes = dict(attributes) 718s 718s encoding = { 718s "chunks": zarr_array.chunks, 718s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 718s } 718s 718s if _zarr_v3(): 718s encoding.update( 718s { 718s "compressors": zarr_array.compressors, 718s "filters": zarr_array.filters, 718s "shards": zarr_array.shards, 718s } 718s ) 718s if self.zarr_group.metadata.zarr_format == 3: 718s encoding.update({"serializer": zarr_array.serializer}) 718s else: 718s encoding.update( 718s { 718s "compressor": zarr_array.compressor, 718s "filters": zarr_array.filters, 718s } 718s ) 718s 718s if self._use_zarr_fill_value_as_mask: 718s # Setting this attribute triggers CF decoding for missing values 718s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 718s if zarr_array.fill_value is not None: 718s attributes["_FillValue"] = zarr_array.fill_value 718s elif "_FillValue" in attributes: 718s original_zarr_dtype = zarr_array.metadata.data_type 718s attributes["_FillValue"] = FillValueCoder.decode( 718s > attributes["_FillValue"], original_zarr_dtype.value 718s ) 718s E AttributeError: 'Float64' object has no attribute 'value' 718s 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 718s ______________________ test_chunking_consintency[chunks4] ______________________ 718s 718s chunks = {'x': -1} 718s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_chunking_consintency_chun2') 718s 718s @requires_zarr 718s @requires_dask 718s @pytest.mark.parametrize( 718s "chunks", ["auto", -1, {}, {"x": "auto"}, {"x": -1}, {"x": "auto", "y": -1}] 718s ) 718s @pytest.mark.filterwarnings("ignore:The specified chunks separate") 718s def test_chunking_consintency(chunks, tmp_path: Path) -> None: 718s encoded_chunks: dict[str, Any] = {} 718s dask_arr = da.from_array( 718s np.ones((500, 500), dtype="float64"), chunks=encoded_chunks 718s ) 718s ds = xr.Dataset( 718s { 718s "test": xr.DataArray( 718s dask_arr, 718s dims=("x", "y"), 718s ) 718s } 718s ) 718s ds["test"].encoding["chunks"] = encoded_chunks 718s ds.to_zarr(tmp_path / "test.zarr") 718s ds.to_netcdf(tmp_path / "test.nc") 718s 718s with dask.config.set({"array.chunk-size": "1MiB"}): 718s expected = ds.chunk(chunks) 718s > with xr.open_dataset( 718s tmp_path / "test.zarr", engine="zarr", chunks=chunks 718s ) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6074: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 718s ds = store_entrypoint.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 718s vars, attrs = filename_or_obj.load() 718s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 718s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 718s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 718s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 718s return Frozen(dict(*args, **kwargs)) 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 718s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = , name = 'test' 718s 718s def open_store_variable(self, name): 718s zarr_array = self.members[name] 718s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 718s try_nczarr = self._mode == "r" 718s dimensions, attributes = _get_zarr_dims_and_attrs( 718s zarr_array, DIMENSION_KEY, try_nczarr 718s ) 718s attributes = dict(attributes) 718s 718s encoding = { 718s "chunks": zarr_array.chunks, 718s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 718s } 718s 718s if _zarr_v3(): 718s encoding.update( 718s { 718s "compressors": zarr_array.compressors, 718s "filters": zarr_array.filters, 718s "shards": zarr_array.shards, 718s } 718s ) 718s if self.zarr_group.metadata.zarr_format == 3: 718s encoding.update({"serializer": zarr_array.serializer}) 718s else: 718s encoding.update( 718s { 718s "compressor": zarr_array.compressor, 718s "filters": zarr_array.filters, 718s } 718s ) 718s 718s if self._use_zarr_fill_value_as_mask: 718s # Setting this attribute triggers CF decoding for missing values 718s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 718s if zarr_array.fill_value is not None: 718s attributes["_FillValue"] = zarr_array.fill_value 718s elif "_FillValue" in attributes: 718s original_zarr_dtype = zarr_array.metadata.data_type 718s attributes["_FillValue"] = FillValueCoder.decode( 718s > attributes["_FillValue"], original_zarr_dtype.value 718s ) 718s E AttributeError: 'Float64' object has no attribute 'value' 718s 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 718s ______________________ test_chunking_consintency[chunks5] ______________________ 718s 718s chunks = {'x': 'auto', 'y': -1} 718s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_chunking_consintency_chun3') 718s 718s @requires_zarr 718s @requires_dask 718s @pytest.mark.parametrize( 718s "chunks", ["auto", -1, {}, {"x": "auto"}, {"x": -1}, {"x": "auto", "y": -1}] 718s ) 718s @pytest.mark.filterwarnings("ignore:The specified chunks separate") 718s def test_chunking_consintency(chunks, tmp_path: Path) -> None: 718s encoded_chunks: dict[str, Any] = {} 718s dask_arr = da.from_array( 718s np.ones((500, 500), dtype="float64"), chunks=encoded_chunks 718s ) 718s ds = xr.Dataset( 718s { 718s "test": xr.DataArray( 718s dask_arr, 718s dims=("x", "y"), 718s ) 718s } 718s ) 718s ds["test"].encoding["chunks"] = encoded_chunks 718s ds.to_zarr(tmp_path / "test.zarr") 718s ds.to_netcdf(tmp_path / "test.nc") 718s 718s with dask.config.set({"array.chunk-size": "1MiB"}): 718s expected = ds.chunk(chunks) 718s > with xr.open_dataset( 718s tmp_path / "test.zarr", engine="zarr", chunks=chunks 718s ) as actual: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6074: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 718s ds = store_entrypoint.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 718s vars, attrs = filename_or_obj.load() 718s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 718s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 718s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 718s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 718s return Frozen(dict(*args, **kwargs)) 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 718s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = , name = 'test' 718s 718s def open_store_variable(self, name): 718s zarr_array = self.members[name] 718s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 718s try_nczarr = self._mode == "r" 718s dimensions, attributes = _get_zarr_dims_and_attrs( 718s zarr_array, DIMENSION_KEY, try_nczarr 718s ) 718s attributes = dict(attributes) 718s 718s encoding = { 718s "chunks": zarr_array.chunks, 718s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 718s } 718s 718s if _zarr_v3(): 718s encoding.update( 718s { 718s "compressors": zarr_array.compressors, 718s "filters": zarr_array.filters, 718s "shards": zarr_array.shards, 718s } 718s ) 718s if self.zarr_group.metadata.zarr_format == 3: 718s encoding.update({"serializer": zarr_array.serializer}) 718s else: 718s encoding.update( 718s { 718s "compressor": zarr_array.compressor, 718s "filters": zarr_array.filters, 718s } 718s ) 718s 718s if self._use_zarr_fill_value_as_mask: 718s # Setting this attribute triggers CF decoding for missing values 718s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 718s if zarr_array.fill_value is not None: 718s attributes["_FillValue"] = zarr_array.fill_value 718s elif "_FillValue" in attributes: 718s original_zarr_dtype = zarr_array.metadata.data_type 718s attributes["_FillValue"] = FillValueCoder.decode( 718s > attributes["_FillValue"], original_zarr_dtype.value 718s ) 718s E AttributeError: 'Float64' object has no attribute 'value' 718s 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 718s ________________ TestZarrDatatreeIO.test_to_zarr[zarr_format=3] ________________ 718s 718s self = 718s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_to_zarr_zarr_format_3_0') 718s simple_datatree = 718s Group: / 718s │ Dimensions: (y: 3, x: 2) 718s │ Dimensions without coordinates: y, x 718s │ Data variables: 718s ... a (x) int64 16B 2 3 718s │ │ b (x) float64 16B 0.1 0.2 718s │ └── Group: /set2/set1 718s └── Group: /set3 718s zarr_format = 3 718s 718s def test_to_zarr(self, tmpdir, simple_datatree, zarr_format): 718s filepath = str(tmpdir / "test.zarr") 718s original_dt = simple_datatree 718s original_dt.to_zarr(filepath, zarr_format=zarr_format) 718s 718s > with open_datatree(filepath, engine="zarr") as roundtrip_dt: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends_datatree.py:459: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1132: in open_datatree 718s backend_tree = backend.open_datatree( 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1658: in open_datatree 718s groups_dict = self.open_groups_as_dict( 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1725: in open_groups_as_dict 718s group_ds = store_entrypoint.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 718s vars, attrs = filename_or_obj.load() 718s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 718s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 718s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 718s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 718s return Frozen(dict(*args, **kwargs)) 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 718s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = , name = 'b' 718s 718s def open_store_variable(self, name): 718s zarr_array = self.members[name] 718s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 718s try_nczarr = self._mode == "r" 718s dimensions, attributes = _get_zarr_dims_and_attrs( 718s zarr_array, DIMENSION_KEY, try_nczarr 718s ) 718s attributes = dict(attributes) 718s 718s encoding = { 718s "chunks": zarr_array.chunks, 718s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 718s } 718s 718s if _zarr_v3(): 718s encoding.update( 718s { 718s "compressors": zarr_array.compressors, 718s "filters": zarr_array.filters, 718s "shards": zarr_array.shards, 718s } 718s ) 718s if self.zarr_group.metadata.zarr_format == 3: 718s encoding.update({"serializer": zarr_array.serializer}) 718s else: 718s encoding.update( 718s { 718s "compressor": zarr_array.compressor, 718s "filters": zarr_array.filters, 718s } 718s ) 718s 718s if self._use_zarr_fill_value_as_mask: 718s # Setting this attribute triggers CF decoding for missing values 718s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 718s if zarr_array.fill_value is not None: 718s attributes["_FillValue"] = zarr_array.fill_value 718s elif "_FillValue" in attributes: 718s original_zarr_dtype = zarr_array.metadata.data_type 718s attributes["_FillValue"] = FillValueCoder.decode( 718s > attributes["_FillValue"], original_zarr_dtype.value 718s ) 718s E AttributeError: 'Float64' object has no attribute 'value' 718s 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 718s _____________ TestZarrDatatreeIO.test_zarr_encoding[zarr_format=3] _____________ 718s 718s self = 718s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_zarr_encoding_zarr_format1') 718s simple_datatree = 718s Group: / 718s │ Dimensions: (y: 3, x: 2) 718s │ Dimensions without coordinates: y, x 718s │ Data variables: 718s ... a (x) int64 16B 2 3 718s │ │ b (x) float64 16B 0.1 0.2 718s │ └── Group: /set2/set1 718s └── Group: /set3 718s zarr_format = 3 718s 718s def test_zarr_encoding(self, tmpdir, simple_datatree, zarr_format): 718s filepath = str(tmpdir / "test.zarr") 718s original_dt = simple_datatree 718s 718s if zarr_format == 2: 718s from numcodecs.blosc import Blosc 718s 718s codec = Blosc(cname="zstd", clevel=3, shuffle=2) 718s comp = {"compressors": (codec,)} if has_zarr_v3 else {"compressor": codec} 718s elif zarr_format == 3: 718s # specifying codecs in zarr_format=3 requires importing from zarr 3 namespace 718s import numcodecs.zarr3 718s 718s comp = {"compressors": (numcodecs.zarr3.Blosc(cname="zstd", clevel=3),)} 718s 718s enc = {"/set2": {var: comp for var in original_dt["/set2"].dataset.data_vars}} 718s original_dt.to_zarr(filepath, encoding=enc, zarr_format=zarr_format) 718s 718s > with open_datatree(filepath, engine="zarr") as roundtrip_dt: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends_datatree.py:480: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1132: in open_datatree 718s backend_tree = backend.open_datatree( 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1658: in open_datatree 718s groups_dict = self.open_groups_as_dict( 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1725: in open_groups_as_dict 718s group_ds = store_entrypoint.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 718s vars, attrs = filename_or_obj.load() 718s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 718s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 718s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 718s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 718s return Frozen(dict(*args, **kwargs)) 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 718s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = , name = 'b' 718s 718s def open_store_variable(self, name): 718s zarr_array = self.members[name] 718s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 718s try_nczarr = self._mode == "r" 718s dimensions, attributes = _get_zarr_dims_and_attrs( 718s zarr_array, DIMENSION_KEY, try_nczarr 718s ) 718s attributes = dict(attributes) 718s 718s encoding = { 718s "chunks": zarr_array.chunks, 718s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 718s } 718s 718s if _zarr_v3(): 718s encoding.update( 718s { 718s "compressors": zarr_array.compressors, 718s "filters": zarr_array.filters, 718s "shards": zarr_array.shards, 718s } 718s ) 718s if self.zarr_group.metadata.zarr_format == 3: 718s encoding.update({"serializer": zarr_array.serializer}) 718s else: 718s encoding.update( 718s { 718s "compressor": zarr_array.compressor, 718s "filters": zarr_array.filters, 718s } 718s ) 718s 718s if self._use_zarr_fill_value_as_mask: 718s # Setting this attribute triggers CF decoding for missing values 718s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 718s if zarr_array.fill_value is not None: 718s attributes["_FillValue"] = zarr_array.fill_value 718s elif "_FillValue" in attributes: 718s original_zarr_dtype = zarr_array.metadata.data_type 718s attributes["_FillValue"] = FillValueCoder.decode( 718s > attributes["_FillValue"], original_zarr_dtype.value 718s ) 718s E AttributeError: 'Float64' object has no attribute 'value' 718s 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 718s ___________ TestZarrDatatreeIO.test_to_zarr_zip_store[zarr_format=2] ___________ 718s 718s cls = 718s store = ZipStore('zip:///tmp/pytest-of-ubuntu/pytest-0/test_to_zarr_zip_store_zarr_fo0/test.zarr.zip') 718s path = '', mode = 'r' 718s 718s @classmethod 718s async def open(cls, store: Store, path: str, mode: AccessModeLiteral | None = None) -> Self: 718s """ 718s Open StorePath based on the provided mode. 718s 718s * If the mode is None, return an opened version of the store with no changes. 718s * If the mode is 'r+', 'w-', 'w', or 'a' and the store is read-only, raise a ValueError. 718s * If the mode is 'r' and the store is not read-only, return a copy of the store with read_only set to True. 718s * If the mode is 'w-' and the store is not read-only and the StorePath contains keys, raise a FileExistsError. 718s * If the mode is 'w' and the store is not read-only, delete all keys nested within the StorePath. 718s 718s Parameters 718s ---------- 718s mode : AccessModeLiteral 718s The mode to use when initializing the store path. 718s 718s The accepted values are: 718s 718s - ``'r'``: read only (must exist) 718s - ``'r+'``: read/write (must exist) 718s - ``'a'``: read/write (create if doesn't exist) 718s - ``'w'``: read/write (overwrite if exists) 718s - ``'w-'``: read/write (create if doesn't exist). 718s 718s Raises 718s ------ 718s FileExistsError 718s If the mode is 'w-' and the store path already exists. 718s ValueError 718s If the mode is not "r" and the store is read-only, or 718s """ 718s 718s # fastpath if mode is None 718s if mode is None: 718s return await cls._create_open_instance(store, path) 718s 718s if mode not in ANY_ACCESS_MODE: 718s raise ValueError(f"Invalid mode: {mode}, expected one of {ANY_ACCESS_MODE}") 718s 718s if store.read_only: 718s # Don't allow write operations on a read-only store 718s if mode != "r": 718s raise ValueError( 718s f"Store is read-only but mode is {mode!r}. Create a writable store or use 'r' mode." 718s ) 718s self = await cls._create_open_instance(store, path) 718s elif mode == "r": 718s # Create read-only copy for read mode on writable store 718s try: 718s > read_only_store = store.with_read_only(True) 718s 718s /usr/lib/python3/dist-packages/zarr/storage/_common.py:123: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = ZipStore('zip:///tmp/pytest-of-ubuntu/pytest-0/test_to_zarr_zip_store_zarr_fo0/test.zarr.zip') 718s read_only = True 718s 718s def with_read_only(self, read_only: bool = False) -> Store: 718s """ 718s Return a new store with a new read_only setting. 718s 718s The new store points to the same location with the specified new read_only state. 718s The returned Store is not automatically opened, and this store is 718s not automatically closed. 718s 718s Parameters 718s ---------- 718s read_only 718s If True, the store will be created in read-only mode. Defaults to False. 718s 718s Returns 718s ------- 718s A new store of the same type with the new read only attribute. 718s """ 718s > raise NotImplementedError( 718s f"with_read_only is not implemented for the {type(self)} store type." 718s ) 718s E NotImplementedError: with_read_only is not implemented for the store type. 718s 718s /usr/lib/python3/dist-packages/zarr/abc/store.py:98: NotImplementedError 718s 718s The above exception was the direct cause of the following exception: 718s 718s self = 718s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_to_zarr_zip_store_zarr_fo0') 718s simple_datatree = 718s Group: / 718s │ Dimensions: (y: 3, x: 2) 718s │ Dimensions without coordinates: y, x 718s │ Data variables: 718s ... a (x) int64 16B 2 3 718s │ │ b (x) float64 16B 0.1 0.2 718s │ └── Group: /set2/set1 718s └── Group: /set3 718s zarr_format = 2 718s 718s def test_to_zarr_zip_store(self, tmpdir, simple_datatree, zarr_format): 718s from zarr.storage import ZipStore 718s 718s filepath = str(tmpdir / "test.zarr.zip") 718s original_dt = simple_datatree 718s store = ZipStore(filepath, mode="w") 718s original_dt.to_zarr(store, zarr_format=zarr_format) 718s 718s > with open_datatree(store, engine="zarr") as roundtrip_dt: # type: ignore[arg-type, unused-ignore] 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends_datatree.py:500: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1132: in open_datatree 718s backend_tree = backend.open_datatree( 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1658: in open_datatree 718s groups_dict = self.open_groups_as_dict( 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1707: in open_groups_as_dict 718s stores = ZarrStore.open_store( 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:665: in open_store 718s ) = _get_open_params( 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1815: in _get_open_params 718s zarr_root_group = zarr.open_group(store, **open_kwargs) 718s /usr/lib/python3/dist-packages/zarr/api/synchronous.py:540: in open_group 718s sync( 718s /usr/lib/python3/dist-packages/zarr/core/sync.py:163: in sync 718s raise return_result 718s /usr/lib/python3/dist-packages/zarr/core/sync.py:119: in _runner 718s return await coro 718s /usr/lib/python3/dist-packages/zarr/api/asynchronous.py:851: in open_group 718s store_path = await make_store_path(store, mode=mode, storage_options=storage_options, path=path) 718s /usr/lib/python3/dist-packages/zarr/storage/_common.py:419: in make_store_path 718s return await StorePath.open(store, path=path_normalized, mode=mode) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s cls = 718s store = ZipStore('zip:///tmp/pytest-of-ubuntu/pytest-0/test_to_zarr_zip_store_zarr_fo0/test.zarr.zip') 718s path = '', mode = 'r' 718s 718s @classmethod 718s async def open(cls, store: Store, path: str, mode: AccessModeLiteral | None = None) -> Self: 718s """ 718s Open StorePath based on the provided mode. 718s 718s * If the mode is None, return an opened version of the store with no changes. 718s * If the mode is 'r+', 'w-', 'w', or 'a' and the store is read-only, raise a ValueError. 718s * If the mode is 'r' and the store is not read-only, return a copy of the store with read_only set to True. 718s * If the mode is 'w-' and the store is not read-only and the StorePath contains keys, raise a FileExistsError. 718s * If the mode is 'w' and the store is not read-only, delete all keys nested within the StorePath. 718s 718s Parameters 718s ---------- 718s mode : AccessModeLiteral 718s The mode to use when initializing the store path. 718s 718s The accepted values are: 718s 718s - ``'r'``: read only (must exist) 718s - ``'r+'``: read/write (must exist) 718s - ``'a'``: read/write (create if doesn't exist) 718s - ``'w'``: read/write (overwrite if exists) 718s - ``'w-'``: read/write (create if doesn't exist). 718s 718s Raises 718s ------ 718s FileExistsError 718s If the mode is 'w-' and the store path already exists. 718s ValueError 718s If the mode is not "r" and the store is read-only, or 718s """ 718s 718s # fastpath if mode is None 718s if mode is None: 718s return await cls._create_open_instance(store, path) 718s 718s if mode not in ANY_ACCESS_MODE: 718s raise ValueError(f"Invalid mode: {mode}, expected one of {ANY_ACCESS_MODE}") 718s 718s if store.read_only: 718s # Don't allow write operations on a read-only store 718s if mode != "r": 718s raise ValueError( 718s f"Store is read-only but mode is {mode!r}. Create a writable store or use 'r' mode." 718s ) 718s self = await cls._create_open_instance(store, path) 718s elif mode == "r": 718s # Create read-only copy for read mode on writable store 718s try: 718s read_only_store = store.with_read_only(True) 718s except NotImplementedError as e: 718s > raise ValueError( 718s "Store is not read-only but mode is 'r'. Unable to create a read-only copy of the store. " 718s "Please use a read-only store or a storage class that implements .with_read_only()." 718s ) from e 718s E ValueError: Store is not read-only but mode is 'r'. Unable to create a read-only copy of the store. Please use a read-only store or a storage class that implements .with_read_only(). 718s 718s /usr/lib/python3/dist-packages/zarr/storage/_common.py:125: ValueError 718s ___________ TestZarrDatatreeIO.test_to_zarr_zip_store[zarr_format=3] ___________ 718s 718s cls = 718s store = ZipStore('zip:///tmp/pytest-of-ubuntu/pytest-0/test_to_zarr_zip_store_zarr_fo1/test.zarr.zip') 718s path = '', mode = 'r' 718s 718s @classmethod 718s async def open(cls, store: Store, path: str, mode: AccessModeLiteral | None = None) -> Self: 718s """ 718s Open StorePath based on the provided mode. 718s 718s * If the mode is None, return an opened version of the store with no changes. 718s * If the mode is 'r+', 'w-', 'w', or 'a' and the store is read-only, raise a ValueError. 718s * If the mode is 'r' and the store is not read-only, return a copy of the store with read_only set to True. 718s * If the mode is 'w-' and the store is not read-only and the StorePath contains keys, raise a FileExistsError. 718s * If the mode is 'w' and the store is not read-only, delete all keys nested within the StorePath. 718s 718s Parameters 718s ---------- 718s mode : AccessModeLiteral 718s The mode to use when initializing the store path. 718s 718s The accepted values are: 718s 718s - ``'r'``: read only (must exist) 718s - ``'r+'``: read/write (must exist) 718s - ``'a'``: read/write (create if doesn't exist) 718s - ``'w'``: read/write (overwrite if exists) 718s - ``'w-'``: read/write (create if doesn't exist). 718s 718s Raises 718s ------ 718s FileExistsError 718s If the mode is 'w-' and the store path already exists. 718s ValueError 718s If the mode is not "r" and the store is read-only, or 718s """ 718s 718s # fastpath if mode is None 718s if mode is None: 718s return await cls._create_open_instance(store, path) 718s 718s if mode not in ANY_ACCESS_MODE: 718s raise ValueError(f"Invalid mode: {mode}, expected one of {ANY_ACCESS_MODE}") 718s 718s if store.read_only: 718s # Don't allow write operations on a read-only store 718s if mode != "r": 718s raise ValueError( 718s f"Store is read-only but mode is {mode!r}. Create a writable store or use 'r' mode." 718s ) 718s self = await cls._create_open_instance(store, path) 718s elif mode == "r": 718s # Create read-only copy for read mode on writable store 718s try: 718s > read_only_store = store.with_read_only(True) 718s 718s /usr/lib/python3/dist-packages/zarr/storage/_common.py:123: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = ZipStore('zip:///tmp/pytest-of-ubuntu/pytest-0/test_to_zarr_zip_store_zarr_fo1/test.zarr.zip') 718s read_only = True 718s 718s def with_read_only(self, read_only: bool = False) -> Store: 718s """ 718s Return a new store with a new read_only setting. 718s 718s The new store points to the same location with the specified new read_only state. 718s The returned Store is not automatically opened, and this store is 718s not automatically closed. 718s 718s Parameters 718s ---------- 718s read_only 718s If True, the store will be created in read-only mode. Defaults to False. 718s 718s Returns 718s ------- 718s A new store of the same type with the new read only attribute. 718s """ 718s > raise NotImplementedError( 718s f"with_read_only is not implemented for the {type(self)} store type." 718s ) 718s E NotImplementedError: with_read_only is not implemented for the store type. 718s 718s /usr/lib/python3/dist-packages/zarr/abc/store.py:98: NotImplementedError 718s 718s The above exception was the direct cause of the following exception: 718s 718s self = 718s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_to_zarr_zip_store_zarr_fo1') 718s simple_datatree = 718s Group: / 718s │ Dimensions: (y: 3, x: 2) 718s │ Dimensions without coordinates: y, x 718s │ Data variables: 718s ... a (x) int64 16B 2 3 718s │ │ b (x) float64 16B 0.1 0.2 718s │ └── Group: /set2/set1 718s └── Group: /set3 718s zarr_format = 3 718s 718s def test_to_zarr_zip_store(self, tmpdir, simple_datatree, zarr_format): 718s from zarr.storage import ZipStore 718s 718s filepath = str(tmpdir / "test.zarr.zip") 718s original_dt = simple_datatree 718s store = ZipStore(filepath, mode="w") 718s original_dt.to_zarr(store, zarr_format=zarr_format) 718s 718s > with open_datatree(store, engine="zarr") as roundtrip_dt: # type: ignore[arg-type, unused-ignore] 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends_datatree.py:500: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1132: in open_datatree 718s backend_tree = backend.open_datatree( 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1658: in open_datatree 718s groups_dict = self.open_groups_as_dict( 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1707: in open_groups_as_dict 718s stores = ZarrStore.open_store( 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:665: in open_store 718s ) = _get_open_params( 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1815: in _get_open_params 718s zarr_root_group = zarr.open_group(store, **open_kwargs) 718s /usr/lib/python3/dist-packages/zarr/api/synchronous.py:540: in open_group 718s sync( 718s /usr/lib/python3/dist-packages/zarr/core/sync.py:163: in sync 718s raise return_result 718s /usr/lib/python3/dist-packages/zarr/core/sync.py:119: in _runner 718s return await coro 718s /usr/lib/python3/dist-packages/zarr/api/asynchronous.py:851: in open_group 718s store_path = await make_store_path(store, mode=mode, storage_options=storage_options, path=path) 718s /usr/lib/python3/dist-packages/zarr/storage/_common.py:419: in make_store_path 718s return await StorePath.open(store, path=path_normalized, mode=mode) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s cls = 718s store = ZipStore('zip:///tmp/pytest-of-ubuntu/pytest-0/test_to_zarr_zip_store_zarr_fo1/test.zarr.zip') 718s path = '', mode = 'r' 718s 718s @classmethod 718s async def open(cls, store: Store, path: str, mode: AccessModeLiteral | None = None) -> Self: 718s """ 718s Open StorePath based on the provided mode. 718s 718s * If the mode is None, return an opened version of the store with no changes. 718s * If the mode is 'r+', 'w-', 'w', or 'a' and the store is read-only, raise a ValueError. 718s * If the mode is 'r' and the store is not read-only, return a copy of the store with read_only set to True. 718s * If the mode is 'w-' and the store is not read-only and the StorePath contains keys, raise a FileExistsError. 718s * If the mode is 'w' and the store is not read-only, delete all keys nested within the StorePath. 718s 718s Parameters 718s ---------- 718s mode : AccessModeLiteral 718s The mode to use when initializing the store path. 718s 718s The accepted values are: 718s 718s - ``'r'``: read only (must exist) 718s - ``'r+'``: read/write (must exist) 718s - ``'a'``: read/write (create if doesn't exist) 718s - ``'w'``: read/write (overwrite if exists) 718s - ``'w-'``: read/write (create if doesn't exist). 718s 718s Raises 718s ------ 718s FileExistsError 718s If the mode is 'w-' and the store path already exists. 718s ValueError 718s If the mode is not "r" and the store is read-only, or 718s """ 718s 718s # fastpath if mode is None 718s if mode is None: 718s return await cls._create_open_instance(store, path) 718s 718s if mode not in ANY_ACCESS_MODE: 718s raise ValueError(f"Invalid mode: {mode}, expected one of {ANY_ACCESS_MODE}") 718s 718s if store.read_only: 718s # Don't allow write operations on a read-only store 718s if mode != "r": 718s raise ValueError( 718s f"Store is read-only but mode is {mode!r}. Create a writable store or use 'r' mode." 718s ) 718s self = await cls._create_open_instance(store, path) 718s elif mode == "r": 718s # Create read-only copy for read mode on writable store 718s try: 718s read_only_store = store.with_read_only(True) 718s except NotImplementedError as e: 718s > raise ValueError( 718s "Store is not read-only but mode is 'r'. Unable to create a read-only copy of the store. " 718s "Please use a read-only store or a storage class that implements .with_read_only()." 718s ) from e 718s E ValueError: Store is not read-only but mode is 'r'. Unable to create a read-only copy of the store. Please use a read-only store or a storage class that implements .with_read_only(). 718s 718s /usr/lib/python3/dist-packages/zarr/storage/_common.py:125: ValueError 718s _______ TestZarrDatatreeIO.test_to_zarr_not_consolidated[zarr_format=3] ________ 718s 718s self = 718s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_to_zarr_not_consolidated_1') 718s simple_datatree = 718s Group: / 718s │ Dimensions: (y: 3, x: 2) 718s │ Dimensions without coordinates: y, x 718s │ Data variables: 718s ... a (x) int64 16B 2 3 718s │ │ b (x) float64 16B 0.1 0.2 718s │ └── Group: /set2/set1 718s └── Group: /set3 718s zarr_format = 3 718s 718s def test_to_zarr_not_consolidated(self, tmpdir, simple_datatree, zarr_format): 718s filepath = tmpdir / "test.zarr" 718s zmetadata = filepath / ".zmetadata" 718s s1zmetadata = filepath / "set1" / ".zmetadata" 718s filepath = str(filepath) # casting to str avoids a pathlib bug in xarray 718s original_dt = simple_datatree 718s original_dt.to_zarr(filepath, consolidated=False, zarr_format=zarr_format) 718s assert not zmetadata.exists() 718s assert not s1zmetadata.exists() 718s 718s with pytest.warns(RuntimeWarning, match="consolidated"): 718s > with open_datatree(filepath, engine="zarr") as roundtrip_dt: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends_datatree.py:514: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1132: in open_datatree 718s backend_tree = backend.open_datatree( 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1658: in open_datatree 718s groups_dict = self.open_groups_as_dict( 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1725: in open_groups_as_dict 718s group_ds = store_entrypoint.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 718s vars, attrs = filename_or_obj.load() 718s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 718s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 718s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 718s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 718s return Frozen(dict(*args, **kwargs)) 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 718s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = , name = 'b' 718s 718s def open_store_variable(self, name): 718s zarr_array = self.members[name] 718s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 718s try_nczarr = self._mode == "r" 718s dimensions, attributes = _get_zarr_dims_and_attrs( 718s zarr_array, DIMENSION_KEY, try_nczarr 718s ) 718s attributes = dict(attributes) 718s 718s encoding = { 718s "chunks": zarr_array.chunks, 718s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 718s } 718s 718s if _zarr_v3(): 718s encoding.update( 718s { 718s "compressors": zarr_array.compressors, 718s "filters": zarr_array.filters, 718s "shards": zarr_array.shards, 718s } 718s ) 718s if self.zarr_group.metadata.zarr_format == 3: 718s encoding.update({"serializer": zarr_array.serializer}) 718s else: 718s encoding.update( 718s { 718s "compressor": zarr_array.compressor, 718s "filters": zarr_array.filters, 718s } 718s ) 718s 718s if self._use_zarr_fill_value_as_mask: 718s # Setting this attribute triggers CF decoding for missing values 718s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 718s if zarr_array.fill_value is not None: 718s attributes["_FillValue"] = zarr_array.fill_value 718s elif "_FillValue" in attributes: 718s original_zarr_dtype = zarr_array.metadata.data_type 718s attributes["_FillValue"] = FillValueCoder.decode( 718s > attributes["_FillValue"], original_zarr_dtype.value 718s ) 718s E AttributeError: 'Float64' object has no attribute 'value' 718s 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 718s ________ TestZarrDatatreeIO.test_open_groups_round_trip[zarr_format=3] _________ 718s 718s self = 718s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_open_groups_round_trip_za1') 718s simple_datatree = 718s Group: / 718s │ Dimensions: (y: 3, x: 2) 718s │ Dimensions without coordinates: y, x 718s │ Data variables: 718s ... a (x) int64 16B 2 3 718s │ │ b (x) float64 16B 0.1 0.2 718s │ └── Group: /set2/set1 718s └── Group: /set3 718s zarr_format = 3 718s 718s def test_open_groups_round_trip(self, tmpdir, simple_datatree, zarr_format) -> None: 718s """Test `open_groups` opens a zarr store with the `simple_datatree` structure.""" 718s filepath = str(tmpdir / "test.zarr") 718s original_dt = simple_datatree 718s original_dt.to_zarr(filepath, zarr_format=zarr_format) 718s 718s > roundtrip_dict = open_groups(filepath, engine="zarr") 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends_datatree.py:631: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1364: in open_groups 718s backend_groups = backend.open_groups_as_dict( 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1725: in open_groups_as_dict 718s group_ds = store_entrypoint.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 718s vars, attrs = filename_or_obj.load() 718s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 718s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 718s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 718s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 718s return Frozen(dict(*args, **kwargs)) 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 718s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = , name = 'b' 718s 718s def open_store_variable(self, name): 718s zarr_array = self.members[name] 718s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 718s try_nczarr = self._mode == "r" 718s dimensions, attributes = _get_zarr_dims_and_attrs( 718s zarr_array, DIMENSION_KEY, try_nczarr 718s ) 718s attributes = dict(attributes) 718s 718s encoding = { 718s "chunks": zarr_array.chunks, 718s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 718s } 718s 718s if _zarr_v3(): 718s encoding.update( 718s { 718s "compressors": zarr_array.compressors, 718s "filters": zarr_array.filters, 718s "shards": zarr_array.shards, 718s } 718s ) 718s if self.zarr_group.metadata.zarr_format == 3: 718s encoding.update({"serializer": zarr_array.serializer}) 718s else: 718s encoding.update( 718s { 718s "compressor": zarr_array.compressor, 718s "filters": zarr_array.filters, 718s } 718s ) 718s 718s if self._use_zarr_fill_value_as_mask: 718s # Setting this attribute triggers CF decoding for missing values 718s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 718s if zarr_array.fill_value is not None: 718s attributes["_FillValue"] = zarr_array.fill_value 718s elif "_FillValue" in attributes: 718s original_zarr_dtype = zarr_array.metadata.data_type 718s attributes["_FillValue"] = FillValueCoder.decode( 718s > attributes["_FillValue"], original_zarr_dtype.value 718s ) 718s E AttributeError: 'Float64' object has no attribute 'value' 718s 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 718s _____________ TestZarrDatatreeIO.test_open_datatree[zarr_format=3] _____________ 718s 718s self = 718s unaligned_datatree_zarr_factory = ._unaligned_datatree_zarr at 0x7885a83ceda0> 718s zarr_format = 3 718s 718s @pytest.mark.filterwarnings( 718s "ignore:Failed to open Zarr store with consolidated metadata:RuntimeWarning" 718s ) 718s def test_open_datatree(self, unaligned_datatree_zarr_factory, zarr_format) -> None: 718s """Test if `open_datatree` fails to open a zarr store with an unaligned group hierarchy.""" 718s storepath = unaligned_datatree_zarr_factory(zarr_format=zarr_format) 718s 718s with pytest.raises( 718s ValueError, 718s match=( 718s re.escape("group '/Group2' is not aligned with its parents:") + ".*" 718s ), 718s ): 718s > open_datatree(storepath, engine="zarr") 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends_datatree.py:653: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1132: in open_datatree 718s backend_tree = backend.open_datatree( 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1658: in open_datatree 718s groups_dict = self.open_groups_as_dict( 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1725: in open_groups_as_dict 718s group_ds = store_entrypoint.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 718s vars, attrs = filename_or_obj.load() 718s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 718s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 718s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 718s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 718s return Frozen(dict(*args, **kwargs)) 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 718s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = , name = 'b' 718s 718s def open_store_variable(self, name): 718s zarr_array = self.members[name] 718s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 718s try_nczarr = self._mode == "r" 718s dimensions, attributes = _get_zarr_dims_and_attrs( 718s zarr_array, DIMENSION_KEY, try_nczarr 718s ) 718s attributes = dict(attributes) 718s 718s encoding = { 718s "chunks": zarr_array.chunks, 718s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 718s } 718s 718s if _zarr_v3(): 718s encoding.update( 718s { 718s "compressors": zarr_array.compressors, 718s "filters": zarr_array.filters, 718s "shards": zarr_array.shards, 718s } 718s ) 718s if self.zarr_group.metadata.zarr_format == 3: 718s encoding.update({"serializer": zarr_array.serializer}) 718s else: 718s encoding.update( 718s { 718s "compressor": zarr_array.compressor, 718s "filters": zarr_array.filters, 718s } 718s ) 718s 718s if self._use_zarr_fill_value_as_mask: 718s # Setting this attribute triggers CF decoding for missing values 718s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 718s if zarr_array.fill_value is not None: 718s attributes["_FillValue"] = zarr_array.fill_value 718s elif "_FillValue" in attributes: 718s original_zarr_dtype = zarr_array.metadata.data_type 718s attributes["_FillValue"] = FillValueCoder.decode( 718s > attributes["_FillValue"], original_zarr_dtype.value 718s ) 718s E AttributeError: 'Float64' object has no attribute 'value' 718s 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 718s _________ TestZarrDatatreeIO.test_open_datatree_chunks[zarr_format=3] __________ 718s 718s self = 718s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_open_datatree_chunks_zarr1') 718s zarr_format = 3 718s 718s @requires_dask 718s def test_open_datatree_chunks(self, tmpdir, zarr_format) -> None: 718s filepath = str(tmpdir / "test.zarr") 718s 718s chunks = {"x": 2, "y": 1} 718s 718s root_data = xr.Dataset({"a": ("y", [6, 7, 8]), "set0": ("x", [9, 10])}) 718s set1_data = xr.Dataset({"a": ("y", [-1, 0, 1]), "b": ("x", [-10, 6])}) 718s set2_data = xr.Dataset({"a": ("y", [1, 2, 3]), "b": ("x", [0.1, 0.2])}) 718s original_tree = DataTree.from_dict( 718s { 718s "/": root_data.chunk(chunks), 718s "/group1": set1_data.chunk(chunks), 718s "/group2": set2_data.chunk(chunks), 718s } 718s ) 718s original_tree.to_zarr(filepath, zarr_format=zarr_format) 718s 718s > with open_datatree(filepath, engine="zarr", chunks=chunks) as tree: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends_datatree.py:673: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1132: in open_datatree 718s backend_tree = backend.open_datatree( 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1658: in open_datatree 718s groups_dict = self.open_groups_as_dict( 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1725: in open_groups_as_dict 718s group_ds = store_entrypoint.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 718s vars, attrs = filename_or_obj.load() 718s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 718s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 718s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 718s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 718s return Frozen(dict(*args, **kwargs)) 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 718s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = , name = 'b' 718s 718s def open_store_variable(self, name): 718s zarr_array = self.members[name] 718s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 718s try_nczarr = self._mode == "r" 718s dimensions, attributes = _get_zarr_dims_and_attrs( 718s zarr_array, DIMENSION_KEY, try_nczarr 718s ) 718s attributes = dict(attributes) 718s 718s encoding = { 718s "chunks": zarr_array.chunks, 718s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 718s } 718s 718s if _zarr_v3(): 718s encoding.update( 718s { 718s "compressors": zarr_array.compressors, 718s "filters": zarr_array.filters, 718s "shards": zarr_array.shards, 718s } 718s ) 718s if self.zarr_group.metadata.zarr_format == 3: 718s encoding.update({"serializer": zarr_array.serializer}) 718s else: 718s encoding.update( 718s { 718s "compressor": zarr_array.compressor, 718s "filters": zarr_array.filters, 718s } 718s ) 718s 718s if self._use_zarr_fill_value_as_mask: 718s # Setting this attribute triggers CF decoding for missing values 718s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 718s if zarr_array.fill_value is not None: 718s attributes["_FillValue"] = zarr_array.fill_value 718s elif "_FillValue" in attributes: 718s original_zarr_dtype = zarr_array.metadata.data_type 718s attributes["_FillValue"] = FillValueCoder.decode( 718s > attributes["_FillValue"], original_zarr_dtype.value 718s ) 718s E AttributeError: 'Float64' object has no attribute 'value' 718s 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 718s ______________ TestZarrDatatreeIO.test_open_groups[zarr_format=3] ______________ 718s 718s self = 718s unaligned_datatree_zarr_factory = ._unaligned_datatree_zarr at 0x7885a83ceda0> 718s zarr_format = 3 718s 718s @pytest.mark.filterwarnings( 718s "ignore:Failed to open Zarr store with consolidated metadata:RuntimeWarning" 718s ) 718s def test_open_groups(self, unaligned_datatree_zarr_factory, zarr_format) -> None: 718s """Test `open_groups` with a zarr store of an unaligned group hierarchy.""" 718s 718s storepath = unaligned_datatree_zarr_factory(zarr_format=zarr_format) 718s > unaligned_dict_of_datasets = open_groups(storepath, engine="zarr") 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends_datatree.py:689: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1364: in open_groups 718s backend_groups = backend.open_groups_as_dict( 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1725: in open_groups_as_dict 718s group_ds = store_entrypoint.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 718s vars, attrs = filename_or_obj.load() 718s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 718s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 718s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 718s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 718s return Frozen(dict(*args, **kwargs)) 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 718s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = , name = 'b' 718s 718s def open_store_variable(self, name): 718s zarr_array = self.members[name] 718s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 718s try_nczarr = self._mode == "r" 718s dimensions, attributes = _get_zarr_dims_and_attrs( 718s zarr_array, DIMENSION_KEY, try_nczarr 718s ) 718s attributes = dict(attributes) 718s 718s encoding = { 718s "chunks": zarr_array.chunks, 718s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 718s } 718s 718s if _zarr_v3(): 718s encoding.update( 718s { 718s "compressors": zarr_array.compressors, 718s "filters": zarr_array.filters, 718s "shards": zarr_array.shards, 718s } 718s ) 718s if self.zarr_group.metadata.zarr_format == 3: 718s encoding.update({"serializer": zarr_array.serializer}) 718s else: 718s encoding.update( 718s { 718s "compressor": zarr_array.compressor, 718s "filters": zarr_array.filters, 718s } 718s ) 718s 718s if self._use_zarr_fill_value_as_mask: 718s # Setting this attribute triggers CF decoding for missing values 718s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 718s if zarr_array.fill_value is not None: 718s attributes["_FillValue"] = zarr_array.fill_value 718s elif "_FillValue" in attributes: 718s original_zarr_dtype = zarr_array.metadata.data_type 718s attributes["_FillValue"] = FillValueCoder.decode( 718s > attributes["_FillValue"], original_zarr_dtype.value 718s ) 718s E AttributeError: 'Float64' object has no attribute 'value' 718s 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 718s ___ TestZarrDatatreeIO.test_open_datatree_specific_group[True-zarr_format=3] ___ 718s 718s self = 718s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_open_datatree_specific_gr1') 718s simple_datatree = 718s Group: / 718s │ Dimensions: (y: 3, x: 2) 718s │ Dimensions without coordinates: y, x 718s │ Data variables: 718s ... a (x) int64 16B 2 3 718s │ │ b (x) float64 16B 0.1 0.2 718s │ └── Group: /set2/set1 718s └── Group: /set3 718s write_consolidated_metadata = True, zarr_format = 3 718s 718s @pytest.mark.filterwarnings( 718s "ignore:Failed to open Zarr store with consolidated metadata:RuntimeWarning" 718s ) 718s @pytest.mark.parametrize("write_consolidated_metadata", [True, False, None]) 718s def test_open_datatree_specific_group( 718s self, 718s tmpdir, 718s simple_datatree, 718s write_consolidated_metadata, 718s zarr_format, 718s ) -> None: 718s """Test opening a specific group within a Zarr store using `open_datatree`.""" 718s filepath = str(tmpdir / "test.zarr") 718s group = "/set2" 718s original_dt = simple_datatree 718s original_dt.to_zarr( 718s filepath, consolidated=write_consolidated_metadata, zarr_format=zarr_format 718s ) 718s expected_subtree = original_dt[group].copy() 718s expected_subtree.orphan() 718s > with open_datatree(filepath, group=group, engine=self.engine) as subgroup_tree: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends_datatree.py:730: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1132: in open_datatree 718s backend_tree = backend.open_datatree( 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1658: in open_datatree 718s groups_dict = self.open_groups_as_dict( 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1725: in open_groups_as_dict 718s group_ds = store_entrypoint.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 718s vars, attrs = filename_or_obj.load() 718s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 718s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 718s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 718s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 718s return Frozen(dict(*args, **kwargs)) 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 718s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = , name = 'b' 718s 718s def open_store_variable(self, name): 718s zarr_array = self.members[name] 718s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 718s try_nczarr = self._mode == "r" 718s dimensions, attributes = _get_zarr_dims_and_attrs( 718s zarr_array, DIMENSION_KEY, try_nczarr 718s ) 718s attributes = dict(attributes) 718s 718s encoding = { 718s "chunks": zarr_array.chunks, 718s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 718s } 718s 718s if _zarr_v3(): 718s encoding.update( 718s { 718s "compressors": zarr_array.compressors, 718s "filters": zarr_array.filters, 718s "shards": zarr_array.shards, 718s } 718s ) 718s if self.zarr_group.metadata.zarr_format == 3: 718s encoding.update({"serializer": zarr_array.serializer}) 718s else: 718s encoding.update( 718s { 718s "compressor": zarr_array.compressor, 718s "filters": zarr_array.filters, 718s } 718s ) 718s 718s if self._use_zarr_fill_value_as_mask: 718s # Setting this attribute triggers CF decoding for missing values 718s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 718s if zarr_array.fill_value is not None: 718s attributes["_FillValue"] = zarr_array.fill_value 718s elif "_FillValue" in attributes: 718s original_zarr_dtype = zarr_array.metadata.data_type 718s attributes["_FillValue"] = FillValueCoder.decode( 718s > attributes["_FillValue"], original_zarr_dtype.value 718s ) 718s E AttributeError: 'Float64' object has no attribute 'value' 718s 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 718s __ TestZarrDatatreeIO.test_open_datatree_specific_group[False-zarr_format=3] ___ 718s 718s self = 718s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_open_datatree_specific_gr3') 718s simple_datatree = 718s Group: / 718s │ Dimensions: (y: 3, x: 2) 718s │ Dimensions without coordinates: y, x 718s │ Data variables: 718s ... a (x) int64 16B 2 3 718s │ │ b (x) float64 16B 0.1 0.2 718s │ └── Group: /set2/set1 718s └── Group: /set3 718s write_consolidated_metadata = False, zarr_format = 3 718s 718s @pytest.mark.filterwarnings( 718s "ignore:Failed to open Zarr store with consolidated metadata:RuntimeWarning" 718s ) 718s @pytest.mark.parametrize("write_consolidated_metadata", [True, False, None]) 718s def test_open_datatree_specific_group( 718s self, 718s tmpdir, 718s simple_datatree, 718s write_consolidated_metadata, 718s zarr_format, 718s ) -> None: 718s """Test opening a specific group within a Zarr store using `open_datatree`.""" 718s filepath = str(tmpdir / "test.zarr") 718s group = "/set2" 718s original_dt = simple_datatree 718s original_dt.to_zarr( 718s filepath, consolidated=write_consolidated_metadata, zarr_format=zarr_format 718s ) 718s expected_subtree = original_dt[group].copy() 718s expected_subtree.orphan() 718s > with open_datatree(filepath, group=group, engine=self.engine) as subgroup_tree: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends_datatree.py:730: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1132: in open_datatree 718s backend_tree = backend.open_datatree( 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1658: in open_datatree 718s groups_dict = self.open_groups_as_dict( 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1725: in open_groups_as_dict 718s group_ds = store_entrypoint.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 718s vars, attrs = filename_or_obj.load() 718s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 718s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 718s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 718s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 718s return Frozen(dict(*args, **kwargs)) 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 718s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = , name = 'b' 718s 718s def open_store_variable(self, name): 718s zarr_array = self.members[name] 718s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 718s try_nczarr = self._mode == "r" 718s dimensions, attributes = _get_zarr_dims_and_attrs( 718s zarr_array, DIMENSION_KEY, try_nczarr 718s ) 718s attributes = dict(attributes) 718s 718s encoding = { 718s "chunks": zarr_array.chunks, 718s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 718s } 718s 718s if _zarr_v3(): 718s encoding.update( 718s { 718s "compressors": zarr_array.compressors, 718s "filters": zarr_array.filters, 718s "shards": zarr_array.shards, 718s } 718s ) 718s if self.zarr_group.metadata.zarr_format == 3: 718s encoding.update({"serializer": zarr_array.serializer}) 718s else: 718s encoding.update( 718s { 718s "compressor": zarr_array.compressor, 718s "filters": zarr_array.filters, 718s } 718s ) 718s 718s if self._use_zarr_fill_value_as_mask: 718s # Setting this attribute triggers CF decoding for missing values 718s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 718s if zarr_array.fill_value is not None: 718s attributes["_FillValue"] = zarr_array.fill_value 718s elif "_FillValue" in attributes: 718s original_zarr_dtype = zarr_array.metadata.data_type 718s attributes["_FillValue"] = FillValueCoder.decode( 718s > attributes["_FillValue"], original_zarr_dtype.value 718s ) 718s E AttributeError: 'Float64' object has no attribute 'value' 718s 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 718s ___ TestZarrDatatreeIO.test_open_datatree_specific_group[None-zarr_format=3] ___ 718s 718s self = 718s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_open_datatree_specific_gr5') 718s simple_datatree = 718s Group: / 718s │ Dimensions: (y: 3, x: 2) 718s │ Dimensions without coordinates: y, x 718s │ Data variables: 718s ... a (x) int64 16B 2 3 718s │ │ b (x) float64 16B 0.1 0.2 718s │ └── Group: /set2/set1 718s └── Group: /set3 718s write_consolidated_metadata = None, zarr_format = 3 718s 718s @pytest.mark.filterwarnings( 718s "ignore:Failed to open Zarr store with consolidated metadata:RuntimeWarning" 718s ) 718s @pytest.mark.parametrize("write_consolidated_metadata", [True, False, None]) 718s def test_open_datatree_specific_group( 718s self, 718s tmpdir, 718s simple_datatree, 718s write_consolidated_metadata, 718s zarr_format, 718s ) -> None: 718s """Test opening a specific group within a Zarr store using `open_datatree`.""" 718s filepath = str(tmpdir / "test.zarr") 718s group = "/set2" 718s original_dt = simple_datatree 718s original_dt.to_zarr( 718s filepath, consolidated=write_consolidated_metadata, zarr_format=zarr_format 718s ) 718s expected_subtree = original_dt[group].copy() 718s expected_subtree.orphan() 718s > with open_datatree(filepath, group=group, engine=self.engine) as subgroup_tree: 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends_datatree.py:730: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1132: in open_datatree 718s backend_tree = backend.open_datatree( 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1658: in open_datatree 718s groups_dict = self.open_groups_as_dict( 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1725: in open_groups_as_dict 718s group_ds = store_entrypoint.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 718s vars, attrs = filename_or_obj.load() 718s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 718s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 718s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 718s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 718s return Frozen(dict(*args, **kwargs)) 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 718s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = , name = 'b' 718s 718s def open_store_variable(self, name): 718s zarr_array = self.members[name] 718s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 718s try_nczarr = self._mode == "r" 718s dimensions, attributes = _get_zarr_dims_and_attrs( 718s zarr_array, DIMENSION_KEY, try_nczarr 718s ) 718s attributes = dict(attributes) 718s 718s encoding = { 718s "chunks": zarr_array.chunks, 718s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 718s } 718s 718s if _zarr_v3(): 718s encoding.update( 718s { 718s "compressors": zarr_array.compressors, 718s "filters": zarr_array.filters, 718s "shards": zarr_array.shards, 718s } 718s ) 718s if self.zarr_group.metadata.zarr_format == 3: 718s encoding.update({"serializer": zarr_array.serializer}) 718s else: 718s encoding.update( 718s { 718s "compressor": zarr_array.compressor, 718s "filters": zarr_array.filters, 718s } 718s ) 718s 718s if self._use_zarr_fill_value_as_mask: 718s # Setting this attribute triggers CF decoding for missing values 718s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 718s if zarr_array.fill_value is not None: 718s attributes["_FillValue"] = zarr_array.fill_value 718s elif "_FillValue" in attributes: 718s original_zarr_dtype = zarr_array.metadata.data_type 718s attributes["_FillValue"] = FillValueCoder.decode( 718s > attributes["_FillValue"], original_zarr_dtype.value 718s ) 718s E AttributeError: 'Float64' object has no attribute 'value' 718s 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 718s __________ TestZarrDatatreeIO.test_open_groups_chunks[zarr_format=3] ___________ 718s 718s self = 718s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_open_groups_chunks_zarr_f1') 718s zarr_format = 3 718s 718s @requires_dask 718s def test_open_groups_chunks(self, tmpdir, zarr_format) -> None: 718s """Test `open_groups` with chunks on a zarr store.""" 718s 718s chunks = {"x": 2, "y": 1} 718s filepath = str(tmpdir / "test.zarr") 718s root_data = xr.Dataset({"a": ("y", [6, 7, 8]), "set0": ("x", [9, 10])}) 718s set1_data = xr.Dataset({"a": ("y", [-1, 0, 1]), "b": ("x", [-10, 6])}) 718s set2_data = xr.Dataset({"a": ("y", [1, 2, 3]), "b": ("x", [0.1, 0.2])}) 718s original_tree = DataTree.from_dict( 718s { 718s "/": root_data.chunk(chunks), 718s "/group1": set1_data.chunk(chunks), 718s "/group2": set2_data.chunk(chunks), 718s } 718s ) 718s original_tree.to_zarr(filepath, mode="w", zarr_format=zarr_format) 718s 718s > dict_of_datasets = open_groups(filepath, engine="zarr", chunks=chunks) 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_backends_datatree.py:752: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:1364: in open_groups 718s backend_groups = backend.open_groups_as_dict( 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1725: in open_groups_as_dict 718s group_ds = store_entrypoint.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 718s vars, attrs = filename_or_obj.load() 718s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 718s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 718s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 718s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 718s return Frozen(dict(*args, **kwargs)) 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 718s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = , name = 'b' 718s 718s def open_store_variable(self, name): 718s zarr_array = self.members[name] 718s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 718s try_nczarr = self._mode == "r" 718s dimensions, attributes = _get_zarr_dims_and_attrs( 718s zarr_array, DIMENSION_KEY, try_nczarr 718s ) 718s attributes = dict(attributes) 718s 718s encoding = { 718s "chunks": zarr_array.chunks, 718s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 718s } 718s 718s if _zarr_v3(): 718s encoding.update( 718s { 718s "compressors": zarr_array.compressors, 718s "filters": zarr_array.filters, 718s "shards": zarr_array.shards, 718s } 718s ) 718s if self.zarr_group.metadata.zarr_format == 3: 718s encoding.update({"serializer": zarr_array.serializer}) 718s else: 718s encoding.update( 718s { 718s "compressor": zarr_array.compressor, 718s "filters": zarr_array.filters, 718s } 718s ) 718s 718s if self._use_zarr_fill_value_as_mask: 718s # Setting this attribute triggers CF decoding for missing values 718s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 718s if zarr_array.fill_value is not None: 718s attributes["_FillValue"] = zarr_array.fill_value 718s elif "_FillValue" in attributes: 718s original_zarr_dtype = zarr_array.metadata.data_type 718s attributes["_FillValue"] = FillValueCoder.decode( 718s > attributes["_FillValue"], original_zarr_dtype.value 718s ) 718s E AttributeError: 'Float64' object has no attribute 'value' 718s 718s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 718s ______________________ test_normalize_token_with_backend _______________________ 718s 718s map_ds = Size: 9kB 718s Dimensions: (x: 10, y: 20, z: 4) 718s Coordinates: 718s * x (x) int64 80B 0 1 2 3 4 5 6 7 8...2B 1 1 1 1 718s e (x, y) int64 2kB 100 101 102 103 104 105 ... 124 125 126 127 128 718s Attributes: 718s test: test 718s 718s @requires_scipy_or_netCDF4 718s def test_normalize_token_with_backend(map_ds): 718s with create_tmp_file(allow_cleanup_failure=ON_WINDOWS) as tmp_file: 718s map_ds.to_netcdf(tmp_file) 718s > read = xr.open_dataset(tmp_file) 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_dask.py:1648: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 718s backend_ds = backend.open_dataset( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:666: in open_dataset 718s store = NetCDF4DataStore.open( 718s /usr/lib/python3/dist-packages/xarray/backends/netCDF4_.py:414: in open 718s import netCDF4 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s # init for netCDF4. package 718s # Docstring comes from extension module _netCDF4. 718s > from ._netCDF4 import * 718s E ModuleNotFoundError: No module named 'netCDF4._netCDF4' 718s 718s /usr/lib/python3/dist-packages/netCDF4/__init__.py:3: ModuleNotFoundError 718s ______________________________ test_list_engines _______________________________ 718s 718s def test_list_engines() -> None: 718s from xarray.backends import list_engines 718s 718s engines = list_engines() 718s assert list_engines.cache_info().currsize == 1 718s 718s assert ("scipy" in engines) == has_scipy 718s > assert ("h5netcdf" in engines) == has_h5netcdf 718s E AssertionError: assert ('h5netcdf' in {'cfgrib': \n Open GRIB files (.grib, .grib2, .grb and .grb2) in Xarray\n Learn more at https://github....in Xarray\n Learn more at https://docs.xarray.dev/en/stable/generated/xarray.backends.ScipyBackendEntrypoint.html, ...}) == False 718s 718s /usr/lib/python3/dist-packages/xarray/tests/test_plugins.py:272: AssertionError 718s =============================== warnings summary =============================== 718s ../../../../usr/lib/python3/dist-packages/pyparsing/core.py:5637 718s /usr/lib/python3/dist-packages/pyparsing/core.py:5637: SyntaxWarning: 'return' in a 'finally' block 718s return f"{type(self).__name__}: {retString}" 718s 718s tests/test_backends.py: 539 warnings 718s tests/test_backends_datatree.py: 15 warnings 718s /usr/lib/python3/dist-packages/zarr/api/asynchronous.py:244: ZarrUserWarning: Consolidated metadata is currently not part in the Zarr format 3 specification. It may not be supported by other zarr implementations and may change in the future. 718s warnings.warn( 718s 718s tests/test_backends.py: 117 warnings 718s /usr/lib/python3/dist-packages/zarr/core/dtype/npy/string.py:248: UnstableSpecificationWarning: The data type (FixedLengthUTF32(length=1, endianness='little')) does not have a Zarr V3 specification. That means that the representation of arrays saved with this data type may change without warning in a future version of Zarr Python. Arrays stored with this data type may be unreadable by other Zarr libraries. Use this data type at your own risk! Check https://github.com/zarr-developers/zarr-extensions/tree/main/data-types for the status of data type specifications for Zarr V3. 718s v3_unstable_dtype_warning(self) 718s 718s tests/test_backends.py::TestZarrDictStore::test_zero_dimensional_variable[3] 718s tests/test_backends.py::TestZarrDirectoryStore::test_zero_dimensional_variable[3] 718s tests/test_backends.py::TestZarrWriteEmpty::test_zero_dimensional_variable[3] 718s /usr/lib/python3/dist-packages/zarr/core/dtype/npy/bytes.py:383: UnstableSpecificationWarning: The data type (NullTerminatedBytes(length=6)) does not have a Zarr V3 specification. That means that the representation of arrays saved with this data type may change without warning in a future version of Zarr Python. Arrays stored with this data type may be unreadable by other Zarr libraries. Use this data type at your own risk! Check https://github.com/zarr-developers/zarr-extensions/tree/main/data-types for the status of data type specifications for Zarr V3. 718s v3_unstable_dtype_warning(self) 718s 718s tests/test_backends.py::TestZarrDictStore::test_zero_dimensional_variable[3] 718s tests/test_backends.py::TestZarrDirectoryStore::test_zero_dimensional_variable[3] 718s tests/test_backends.py::TestZarrWriteEmpty::test_zero_dimensional_variable[3] 718s /usr/lib/python3/dist-packages/zarr/core/dtype/npy/string.py:248: UnstableSpecificationWarning: The data type (FixedLengthUTF32(length=6, endianness='little')) does not have a Zarr V3 specification. That means that the representation of arrays saved with this data type may change without warning in a future version of Zarr Python. Arrays stored with this data type may be unreadable by other Zarr libraries. Use this data type at your own risk! Check https://github.com/zarr-developers/zarr-extensions/tree/main/data-types for the status of data type specifications for Zarr V3. 718s v3_unstable_dtype_warning(self) 718s 718s tests/test_backends.py: 12 warnings 718s /usr/lib/python3/dist-packages/zarr/core/dtype/npy/bytes.py:383: UnstableSpecificationWarning: The data type (NullTerminatedBytes(length=4)) does not have a Zarr V3 specification. That means that the representation of arrays saved with this data type may change without warning in a future version of Zarr Python. Arrays stored with this data type may be unreadable by other Zarr libraries. Use this data type at your own risk! Check https://github.com/zarr-developers/zarr-extensions/tree/main/data-types for the status of data type specifications for Zarr V3. 718s v3_unstable_dtype_warning(self) 718s 718s tests/test_backends.py::TestZarrDictStore::test_roundtrip_string_data[3] 718s tests/test_backends.py::TestZarrDirectoryStore::test_roundtrip_string_data[3] 718s tests/test_backends.py::TestZarrWriteEmpty::test_roundtrip_string_data[3] 718s /usr/lib/python3/dist-packages/zarr/core/dtype/npy/string.py:248: UnstableSpecificationWarning: The data type (FixedLengthUTF32(length=4, endianness='little')) does not have a Zarr V3 specification. That means that the representation of arrays saved with this data type may change without warning in a future version of Zarr Python. Arrays stored with this data type may be unreadable by other Zarr libraries. Use this data type at your own risk! Check https://github.com/zarr-developers/zarr-extensions/tree/main/data-types for the status of data type specifications for Zarr V3. 718s v3_unstable_dtype_warning(self) 718s 718s tests/test_backends.py: 33 warnings 718s /usr/lib/python3/dist-packages/zarr/core/dtype/npy/string.py:248: UnstableSpecificationWarning: The data type (FixedLengthUTF32(length=2, endianness='little')) does not have a Zarr V3 specification. That means that the representation of arrays saved with this data type may change without warning in a future version of Zarr Python. Arrays stored with this data type may be unreadable by other Zarr libraries. Use this data type at your own risk! Check https://github.com/zarr-developers/zarr-extensions/tree/main/data-types for the status of data type specifications for Zarr V3. 718s v3_unstable_dtype_warning(self) 718s 718s tests/test_backends.py: 33 warnings 718s /usr/lib/python3/dist-packages/zarr/core/dtype/npy/bytes.py:383: UnstableSpecificationWarning: The data type (NullTerminatedBytes(length=2)) does not have a Zarr V3 specification. That means that the representation of arrays saved with this data type may change without warning in a future version of Zarr Python. Arrays stored with this data type may be unreadable by other Zarr libraries. Use this data type at your own risk! Check https://github.com/zarr-developers/zarr-extensions/tree/main/data-types for the status of data type specifications for Zarr V3. 718s v3_unstable_dtype_warning(self) 718s 718s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_zarr_encoding[zarr_format=3] 718s /usr/lib/python3/dist-packages/numcodecs/zarr3.py:164: UserWarning: Numcodecs codecs are not in the Zarr version 3 specification and may not be supported by other zarr implementations. 718s super().__init__(**codec_config) 718s 718s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_zarr_encoding[zarr_format=3] 718s /usr/lib/python3/dist-packages/zarr/codecs/numcodecs/_codecs.py:139: ZarrUserWarning: Numcodecs codecs are not in the Zarr version 3 specification and may not be supported by other zarr implementations. 718s super().__init__(**codec_config) 718s 718s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 718s /usr/lib/python3.14/zipfile/__init__.py:1739: UserWarning: Duplicate name: '.zgroup' 718s return self._open_to_write(zinfo, force_zip64=force_zip64) 718s 718s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 718s /usr/lib/python3.14/zipfile/__init__.py:1739: UserWarning: Duplicate name: '.zattrs' 718s return self._open_to_write(zinfo, force_zip64=force_zip64) 718s 718s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 718s /usr/lib/python3.14/zipfile/__init__.py:1739: UserWarning: Duplicate name: 'set0/.zarray' 718s return self._open_to_write(zinfo, force_zip64=force_zip64) 718s 718s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 718s /usr/lib/python3.14/zipfile/__init__.py:1739: UserWarning: Duplicate name: 'set0/.zattrs' 718s return self._open_to_write(zinfo, force_zip64=force_zip64) 718s 718s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 718s /usr/lib/python3.14/zipfile/__init__.py:1739: UserWarning: Duplicate name: 'a/.zarray' 718s return self._open_to_write(zinfo, force_zip64=force_zip64) 718s 718s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 718s /usr/lib/python3.14/zipfile/__init__.py:1739: UserWarning: Duplicate name: 'a/.zattrs' 718s return self._open_to_write(zinfo, force_zip64=force_zip64) 718s 718s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 718s /usr/lib/python3.14/zipfile/__init__.py:1739: UserWarning: Duplicate name: 'set1/.zgroup' 718s return self._open_to_write(zinfo, force_zip64=force_zip64) 718s 718s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 718s /usr/lib/python3.14/zipfile/__init__.py:1739: UserWarning: Duplicate name: 'set1/.zattrs' 718s return self._open_to_write(zinfo, force_zip64=force_zip64) 718s 718s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 718s /usr/lib/python3.14/zipfile/__init__.py:1739: UserWarning: Duplicate name: 'set1/b/.zarray' 718s return self._open_to_write(zinfo, force_zip64=force_zip64) 718s 718s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 718s /usr/lib/python3.14/zipfile/__init__.py:1739: UserWarning: Duplicate name: 'set1/b/.zattrs' 718s return self._open_to_write(zinfo, force_zip64=force_zip64) 718s 718s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 718s /usr/lib/python3.14/zipfile/__init__.py:1739: UserWarning: Duplicate name: 'set1/a/.zarray' 718s return self._open_to_write(zinfo, force_zip64=force_zip64) 718s 718s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 718s /usr/lib/python3.14/zipfile/__init__.py:1739: UserWarning: Duplicate name: 'set1/a/.zattrs' 718s return self._open_to_write(zinfo, force_zip64=force_zip64) 718s 718s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 718s /usr/lib/python3.14/zipfile/__init__.py:1739: UserWarning: Duplicate name: 'set2/.zgroup' 718s return self._open_to_write(zinfo, force_zip64=force_zip64) 718s 718s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 718s /usr/lib/python3.14/zipfile/__init__.py:1739: UserWarning: Duplicate name: 'set2/.zattrs' 718s return self._open_to_write(zinfo, force_zip64=force_zip64) 718s 718s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 718s /usr/lib/python3.14/zipfile/__init__.py:1739: UserWarning: Duplicate name: 'set2/b/.zarray' 718s return self._open_to_write(zinfo, force_zip64=force_zip64) 718s 718s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 718s /usr/lib/python3.14/zipfile/__init__.py:1739: UserWarning: Duplicate name: 'set2/b/.zattrs' 718s return self._open_to_write(zinfo, force_zip64=force_zip64) 718s 718s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 718s /usr/lib/python3.14/zipfile/__init__.py:1739: UserWarning: Duplicate name: 'set2/a/.zarray' 718s return self._open_to_write(zinfo, force_zip64=force_zip64) 718s 718s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 718s /usr/lib/python3.14/zipfile/__init__.py:1739: UserWarning: Duplicate name: 'set2/a/.zattrs' 718s return self._open_to_write(zinfo, force_zip64=force_zip64) 718s 718s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 718s /usr/lib/python3.14/zipfile/__init__.py:1739: UserWarning: Duplicate name: 'set3/.zgroup' 718s return self._open_to_write(zinfo, force_zip64=force_zip64) 718s 718s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 718s /usr/lib/python3.14/zipfile/__init__.py:1739: UserWarning: Duplicate name: 'set3/.zattrs' 718s return self._open_to_write(zinfo, force_zip64=force_zip64) 718s 718s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 718s /usr/lib/python3.14/zipfile/__init__.py:1739: UserWarning: Duplicate name: 'set1/set1/.zgroup' 718s return self._open_to_write(zinfo, force_zip64=force_zip64) 718s 718s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 718s /usr/lib/python3.14/zipfile/__init__.py:1739: UserWarning: Duplicate name: 'set1/set1/.zattrs' 718s return self._open_to_write(zinfo, force_zip64=force_zip64) 718s 718s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 718s /usr/lib/python3.14/zipfile/__init__.py:1739: UserWarning: Duplicate name: 'set1/set2/.zgroup' 718s return self._open_to_write(zinfo, force_zip64=force_zip64) 718s 718s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 718s /usr/lib/python3.14/zipfile/__init__.py:1739: UserWarning: Duplicate name: 'set1/set2/.zattrs' 718s return self._open_to_write(zinfo, force_zip64=force_zip64) 718s 718s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 718s /usr/lib/python3.14/zipfile/__init__.py:1739: UserWarning: Duplicate name: 'set2/set1/.zgroup' 718s return self._open_to_write(zinfo, force_zip64=force_zip64) 718s 718s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 718s /usr/lib/python3.14/zipfile/__init__.py:1739: UserWarning: Duplicate name: 'set2/set1/.zattrs' 718s return self._open_to_write(zinfo, force_zip64=force_zip64) 718s 718s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=3] 718s /usr/lib/python3.14/zipfile/__init__.py:1739: UserWarning: Duplicate name: 'zarr.json' 718s return self._open_to_write(zinfo, force_zip64=force_zip64) 718s 718s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=3] 718s /usr/lib/python3.14/zipfile/__init__.py:1739: UserWarning: Duplicate name: 'set0/zarr.json' 718s return self._open_to_write(zinfo, force_zip64=force_zip64) 718s 718s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=3] 718s /usr/lib/python3.14/zipfile/__init__.py:1739: UserWarning: Duplicate name: 'a/zarr.json' 718s return self._open_to_write(zinfo, force_zip64=force_zip64) 718s 718s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=3] 718s /usr/lib/python3.14/zipfile/__init__.py:1739: UserWarning: Duplicate name: 'set1/zarr.json' 718s return self._open_to_write(zinfo, force_zip64=force_zip64) 718s 718s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=3] 718s /usr/lib/python3.14/zipfile/__init__.py:1739: UserWarning: Duplicate name: 'set1/b/zarr.json' 718s return self._open_to_write(zinfo, force_zip64=force_zip64) 718s 718s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=3] 718s /usr/lib/python3.14/zipfile/__init__.py:1739: UserWarning: Duplicate name: 'set1/a/zarr.json' 718s return self._open_to_write(zinfo, force_zip64=force_zip64) 718s 718s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=3] 718s /usr/lib/python3.14/zipfile/__init__.py:1739: UserWarning: Duplicate name: 'set2/zarr.json' 718s return self._open_to_write(zinfo, force_zip64=force_zip64) 718s 718s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=3] 718s /usr/lib/python3.14/zipfile/__init__.py:1739: UserWarning: Duplicate name: 'set2/b/zarr.json' 718s return self._open_to_write(zinfo, force_zip64=force_zip64) 718s 718s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=3] 718s /usr/lib/python3.14/zipfile/__init__.py:1739: UserWarning: Duplicate name: 'set2/a/zarr.json' 718s return self._open_to_write(zinfo, force_zip64=force_zip64) 718s 718s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=3] 718s /usr/lib/python3.14/zipfile/__init__.py:1739: UserWarning: Duplicate name: 'set3/zarr.json' 718s return self._open_to_write(zinfo, force_zip64=force_zip64) 718s 718s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=3] 718s /usr/lib/python3.14/zipfile/__init__.py:1739: UserWarning: Duplicate name: 'set1/set1/zarr.json' 718s return self._open_to_write(zinfo, force_zip64=force_zip64) 718s 718s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=3] 718s /usr/lib/python3.14/zipfile/__init__.py:1739: UserWarning: Duplicate name: 'set1/set2/zarr.json' 718s return self._open_to_write(zinfo, force_zip64=force_zip64) 718s 718s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=3] 718s /usr/lib/python3.14/zipfile/__init__.py:1739: UserWarning: Duplicate name: 'set2/set1/zarr.json' 718s return self._open_to_write(zinfo, force_zip64=force_zip64) 718s 718s tests/test_conventions.py: 1 warning 718s tests/test_rolling.py: 36 warnings 718s /usr/lib/python3/dist-packages/xarray/core/duck_array_ops.py:237: RuntimeWarning: invalid value encountered in cast 718s return data.astype(dtype, **kwargs) 718s 718s tests/test_dask.py: 12 warnings 718s tests/test_units.py: 10 warnings 718s /usr/lib/python3/dist-packages/numpy/_core/numeric.py:476: RuntimeWarning: invalid value encountered in cast 718s multiarray.copyto(res, fill_value, casting='unsafe') 718s 718s tests/test_duck_array_ops.py: 16 warnings 718s /usr/lib/python3/dist-packages/dask/array/core.py:5083: RuntimeWarning: overflow encountered in scalar add 718s result = function(*args, **kwargs) 718s 718s tests/test_duck_array_ops.py::test_cftime_datetime_mean[True] 718s /usr/lib/python3/dist-packages/dask/array/core.py:5083: DeprecationWarning: Bitwise inversion '~' on bool is deprecated and will be removed in Python 3.16. This returns the bitwise inversion of the underlying int object and is usually not what you expect from negating a bool. Use the 'not' operator for boolean negation or ~int(x) if you really want the bitwise inversion of the underlying int. 718s result = function(*args, **kwargs) 718s 718s tests/test_duck_array_wrapping.py::TestDataArrayMethods::test_astype[pint] 718s /usr/lib/python3/dist-packages/pint/facets/numpy/quantity.py:88: RuntimeWarning: invalid value encountered in cast 718s value = func(*args, **kwargs) 718s 718s tests/test_strategies.py: 18 warnings 718s /usr/lib/python3/dist-packages/numpy/_core/fromnumeric.py:86: RuntimeWarning: invalid value encountered in reduce 718s return ufunc.reduce(obj, axis, dtype, out, **passkwargs) 718s 718s tests/test_units.py::TestDataArray::test_numpy_methods_with_args[float64-compatible_unit-function_clip] 718s tests/test_units.py::TestDataArray::test_numpy_methods_with_args[float64-identical_unit-function_clip] 718s tests/test_units.py::TestDataArray::test_numpy_methods_with_args[int64-compatible_unit-function_clip] 718s tests/test_units.py::TestDataArray::test_numpy_methods_with_args[int64-identical_unit-function_clip] 718s /usr/lib/python3/dist-packages/numpy/_core/fromnumeric.py:48: DeprecationWarning: __array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0) 718s return conv.wrap(result, to_scalar=False) 718s 718s tests/test_units.py::TestDataArray::test_missing_value_filling[int64-method_ffill] 718s tests/test_units.py::TestDataArray::test_missing_value_filling[int64-method_bfill] 718s /usr/lib/python3/dist-packages/xarray/tests/test_units.py:2766: RuntimeWarning: invalid value encountered in cast 718s np.array([1.4, np.nan, 2.3, np.nan, np.nan, 9.1]).astype(dtype) 718s 718s tests/test_units.py: 15 warnings 718s /usr/lib/python3/dist-packages/xarray/tests/test_units.py:2803: RuntimeWarning: invalid value encountered in cast 718s np.array([1.4, np.nan, 2.3, np.nan, np.nan, 9.1]).astype(dtype) 718s 718s tests/test_units.py::TestDataArray::test_dropna[int64] 718s /usr/lib/python3/dist-packages/xarray/tests/test_units.py:2831: RuntimeWarning: invalid value encountered in cast 718s np.array([1.4, np.nan, 2.3, np.nan, np.nan, 9.1]).astype(dtype) 718s 718s tests/test_units.py::TestDataArray::test_isin[int64-no_unit] 718s tests/test_units.py::TestDataArray::test_isin[int64-dimensionless] 718s tests/test_units.py::TestDataArray::test_isin[int64-incompatible_unit] 718s tests/test_units.py::TestDataArray::test_isin[int64-compatible_unit] 718s tests/test_units.py::TestDataArray::test_isin[int64-identical_unit] 718s /usr/lib/python3/dist-packages/xarray/tests/test_units.py:2856: RuntimeWarning: invalid value encountered in cast 718s np.array([1.4, np.nan, 2.3, np.nan, np.nan, 9.1]).astype(dtype) 718s 718s tests/test_units.py::TestDataArray::test_isin[int64-no_unit] 718s tests/test_units.py::TestDataArray::test_isin[int64-dimensionless] 718s tests/test_units.py::TestDataArray::test_isin[int64-incompatible_unit] 718s tests/test_units.py::TestDataArray::test_isin[int64-compatible_unit] 718s tests/test_units.py::TestDataArray::test_isin[int64-identical_unit] 718s /usr/lib/python3/dist-packages/xarray/tests/test_units.py:2861: RuntimeWarning: invalid value encountered in cast 718s raw_values = np.array([1.4, np.nan, 2.3]).astype(dtype) 718s 718s tests/test_units.py::TestDataset::test_missing_value_filling[int64-method_ffill] 718s tests/test_units.py::TestDataset::test_missing_value_filling[int64-method_bfill] 718s /usr/lib/python3/dist-packages/xarray/tests/test_units.py:4252: RuntimeWarning: invalid value encountered in cast 718s np.array([1.4, np.nan, 2.3, np.nan, np.nan, 9.1]).astype(dtype) 718s 718s tests/test_units.py::TestDataset::test_missing_value_filling[int64-method_ffill] 718s tests/test_units.py::TestDataset::test_missing_value_filling[int64-method_bfill] 718s /usr/lib/python3/dist-packages/xarray/tests/test_units.py:4256: RuntimeWarning: invalid value encountered in cast 718s np.array([4.3, 9.8, 7.5, np.nan, 8.2, np.nan]).astype(dtype) 718s 718s tests/test_units.py: 15 warnings 718s /usr/lib/python3/dist-packages/xarray/tests/test_units.py:4295: RuntimeWarning: invalid value encountered in cast 718s np.array([1.4, np.nan, 2.3, np.nan, np.nan, 9.1]).astype(dtype) 718s 718s tests/test_units.py: 15 warnings 718s /usr/lib/python3/dist-packages/xarray/tests/test_units.py:4299: RuntimeWarning: invalid value encountered in cast 718s np.array([4.3, 9.8, 7.5, np.nan, 8.2, np.nan]).astype(dtype) 718s 718s tests/test_units.py::TestDataset::test_dropna[int64] 718s /usr/lib/python3/dist-packages/xarray/tests/test_units.py:4325: RuntimeWarning: invalid value encountered in cast 718s np.array([1.4, np.nan, 2.3, np.nan, np.nan, 9.1]).astype(dtype) 718s 718s tests/test_units.py::TestDataset::test_dropna[int64] 718s /usr/lib/python3/dist-packages/xarray/tests/test_units.py:4329: RuntimeWarning: invalid value encountered in cast 718s np.array([4.3, 9.8, 7.5, np.nan, 8.2, np.nan]).astype(dtype) 718s 718s tests/test_units.py::TestDataset::test_isin[int64-no_unit] 718s tests/test_units.py::TestDataset::test_isin[int64-dimensionless] 718s tests/test_units.py::TestDataset::test_isin[int64-incompatible_unit] 718s tests/test_units.py::TestDataset::test_isin[int64-compatible_unit] 718s tests/test_units.py::TestDataset::test_isin[int64-same_unit] 718s /usr/lib/python3/dist-packages/xarray/tests/test_units.py:4353: RuntimeWarning: invalid value encountered in cast 718s np.array([1.4, np.nan, 2.3, np.nan, np.nan, 9.1]).astype(dtype) 718s 718s tests/test_units.py::TestDataset::test_isin[int64-no_unit] 718s tests/test_units.py::TestDataset::test_isin[int64-dimensionless] 718s tests/test_units.py::TestDataset::test_isin[int64-incompatible_unit] 718s tests/test_units.py::TestDataset::test_isin[int64-compatible_unit] 718s tests/test_units.py::TestDataset::test_isin[int64-same_unit] 718s /usr/lib/python3/dist-packages/xarray/tests/test_units.py:4357: RuntimeWarning: invalid value encountered in cast 718s np.array([4.3, 9.8, 7.5, np.nan, 8.2, np.nan]).astype(dtype) 718s 718s tests/test_units.py::TestDataset::test_isin[int64-no_unit] 718s tests/test_units.py::TestDataset::test_isin[int64-dimensionless] 718s tests/test_units.py::TestDataset::test_isin[int64-incompatible_unit] 718s tests/test_units.py::TestDataset::test_isin[int64-compatible_unit] 718s tests/test_units.py::TestDataset::test_isin[int64-same_unit] 718s /usr/lib/python3/dist-packages/xarray/tests/test_units.py:4362: RuntimeWarning: invalid value encountered in cast 718s raw_values = np.array([1.4, np.nan, 2.3]).astype(dtype) 718s 718s tests/test_units.py::TestDataset::test_interpolate_na[int64] 718s /usr/lib/python3/dist-packages/xarray/tests/test_units.py:4438: RuntimeWarning: invalid value encountered in cast 718s np.array([1.4, np.nan, 2.3, np.nan, np.nan, 9.1]).astype(dtype) 718s 718s tests/test_units.py::TestDataset::test_interpolate_na[int64] 718s /usr/lib/python3/dist-packages/xarray/tests/test_units.py:4442: RuntimeWarning: invalid value encountered in cast 718s np.array([4.3, 9.8, 7.5, np.nan, 8.2, np.nan]).astype(dtype) 718s 718s tests/test_units.py::TestDataset::test_combine_first[int64-data-no_unit] 718s tests/test_units.py::TestDataset::test_combine_first[int64-data-dimensionless] 718s tests/test_units.py::TestDataset::test_combine_first[int64-data-incompatible_unit] 718s tests/test_units.py::TestDataset::test_combine_first[int64-data-compatible_unit] 718s tests/test_units.py::TestDataset::test_combine_first[int64-data-same_unit] 718s /usr/lib/python3/dist-packages/xarray/tests/test_units.py:4487: RuntimeWarning: invalid value encountered in cast 718s np.array([1.4, np.nan, 2.3, np.nan, np.nan, 9.1]).astype(dtype) * data_unit 718s 718s tests/test_units.py::TestDataset::test_combine_first[int64-data-no_unit] 718s tests/test_units.py::TestDataset::test_combine_first[int64-data-dimensionless] 718s tests/test_units.py::TestDataset::test_combine_first[int64-data-incompatible_unit] 718s tests/test_units.py::TestDataset::test_combine_first[int64-data-compatible_unit] 718s tests/test_units.py::TestDataset::test_combine_first[int64-data-same_unit] 718s /usr/lib/python3/dist-packages/xarray/tests/test_units.py:4490: RuntimeWarning: invalid value encountered in cast 718s np.array([4.3, 9.8, 7.5, np.nan, 8.2, np.nan]).astype(dtype) * data_unit 718s 718s tests/test_variable.py::TestIndexVariable::test_to_index_multiindex_level 718s /usr/lib/python3/dist-packages/xarray/tests/test_variable.py:2447: FutureWarning: the `pandas.MultiIndex` object(s) passed as 'x' coordinate(s) or data variable(s) will no longer be implicitly promoted and wrapped into multiple indexed coordinates in the future (i.e., one coordinate for each multi-index level + one dimension coordinate). If you want to keep this behavior, you need to first wrap it explicitly using `mindex_coords = xarray.Coordinates.from_pandas_multiindex(mindex_obj, 'dim')` and pass it as coordinates, e.g., `xarray.Dataset(coords=mindex_coords)`, `dataset.assign_coords(mindex_coords)` or `dataarray.assign_coords(mindex_coords)`. 718s ds = Dataset(coords={"x": midx}) 718s 718s tests/test_weighted.py::test_weighted_quantile_3D[None-True-q1-a] 718s tests/test_weighted.py::test_weighted_quantile_3D[True-True-0.5-a] 718s /usr/lib/python3/dist-packages/numpy/lib/_nanfunctions_impl.py:1617: RuntimeWarning: All-NaN slice encountered 718s return fnb._ureduce(a, 718s 718s -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html 718s =========================== short test summary info ============================ 718s FAILED tests/test_backends.py::TestZarrDictStore::test_non_existent_store[2] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_non_existent_store[2] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_non_existent_store[2] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_empty[2-True-True] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_empty[2-True-False] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_empty[2-True-None] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_zero_dimensional_variable[3] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_write_store[3] - Attri... 718s FAILED tests/test_backends.py::TestZarrDictStore::test_roundtrip_test_data[3] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_load[3] - AttributeErr... 718s FAILED tests/test_backends.py::TestZarrDictStore::test_dataset_compute[3] - A... 718s FAILED tests/test_backends.py::TestZarrDictStore::test_roundtrip_object_dtype[3] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_roundtrip_float64_data[3] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_orthogonal_indexing[3] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_vectorized_indexing[3] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_vectorized_indexing_negative_step[3] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_outer_indexing_reversed[3] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_isel_dataarray[3] - At... 718s FAILED tests/test_backends.py::TestZarrDictStore::test_array_type_after_indexing[3] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_dropna[3] - AttributeE... 718s FAILED tests/test_backends.py::TestZarrDictStore::test_ondisk_after_print[3] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_roundtrip_bytes_with_fill_value[3] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_roundtrip_unsigned[3-fill_value0-False] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_roundtrip_unsigned[3-fill_value1-True] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_roundtrip_unsigned[3--1-False] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_roundtrip_unsigned[3-255-True] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_grid_mapping_and_bounds_are_not_coordinates_in_file[3] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_coordinate_variables_after_dataset_roundtrip[3] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_grid_mapping_and_bounds_are_coordinates_after_dataarray_roundtrip[3] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_encoding_kwarg[3] - At... 718s FAILED tests/test_backends.py::TestZarrDictStore::test_default_fill_value[3] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_explicitly_omit_fill_value_in_coord[3] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_explicitly_omit_fill_value_in_coord_via_encoding_kwarg[3] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_encoding_same_dtype[3] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_append_overwrite_values[3] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_roundtrip_consolidated[3-False] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_roundtrip_consolidated[3-True] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_roundtrip_consolidated[3-None] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_read_non_consolidated_warning[3] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_non_existent_store[3] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_auto_chunk[3] - Attrib... 718s FAILED tests/test_backends.py::TestZarrDictStore::test_manual_chunk[3] - Attr... 718s FAILED tests/test_backends.py::TestZarrDictStore::test_warning_on_bad_chunks[3] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_write_uneven_dask_chunks[3] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_chunk_encoding[3] - At... 718s FAILED tests/test_backends.py::TestZarrDictStore::test_shard_encoding[3] - At... 718s FAILED tests/test_backends.py::TestZarrDictStore::test_write_persistence_modes[3-None] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_write_persistence_modes[3-group1] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_compressor_encoding[3] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_group[3] - AttributeEr... 718s FAILED tests/test_backends.py::TestZarrDictStore::test_append_write[3] - Attr... 718s FAILED tests/test_backends.py::TestZarrDictStore::test_append_with_append_dim_not_set_raises[3] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_append_string_length_mismatch_works[3-U] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_append_string_length_mismatch_works[3-S] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_check_encoding_is_consistent_after_append[3] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_append_with_new_variable[3] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_append_with_append_dim_no_overwrite[3] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_to_zarr_compute_false_roundtrip[3] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_to_zarr_append_compute_false_roundtrip[3] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_save_emptydim[3-False] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_save_emptydim[3-True] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_no_warning_from_open_emptydim_with_chunks[3] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-False-False-False-False] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-False-False-False-True] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-False-False-False-None] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-False-False-True-False] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-False-False-True-True] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-False-False-True-None] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-False-True-False-False] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-False-True-False-True] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-False-True-False-None] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-False-True-True-False] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-False-True-True-True] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-False-True-True-None] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-True-False-False-False] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-True-False-False-True] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-True-False-False-None] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-True-False-True-False] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-True-False-True-True] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-True-False-True-None] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-True-True-False-False] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-True-True-False-True] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-True-True-False-None] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-True-True-True-False] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-True-True-True-True] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-True-True-True-None] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-None-False-False-False] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-None-False-False-True] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-None-False-False-None] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-None-False-True-False] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-None-False-True-True] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-None-False-True-None] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-None-True-False-False] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-None-True-False-True] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-None-True-False-None] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-None-True-True-False] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-None-True-True-True] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-None-True-True-None] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region_mode[3-None] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region_mode[3-r+] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region_mode[3-a] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_write_preexisting_override_metadata[3] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_encoding_chunksizes[3] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_chunk_encoding_with_partial_dask_chunks[3] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_open_zarr_use_cftime[3] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_write_read_select_write[3] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_attributes[3-obj1] - A... 718s FAILED tests/test_backends.py::TestZarrDictStore::test_chunked_datetime64_or_timedelta64[3-datetime64[ns]] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_chunked_datetime64_or_timedelta64[3-timedelta64[ns]] 718s FAILED tests/test_backends.py::TestZarrDictStore::test_zarr_fill_value_setting[3-float] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_zero_dimensional_variable[3] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_store[3] - ... 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_roundtrip_test_data[3] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_load[3] - Attribu... 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_dataset_compute[3] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_roundtrip_object_dtype[3] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_roundtrip_float64_data[3] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_orthogonal_indexing[3] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_vectorized_indexing[3] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_vectorized_indexing_negative_step[3] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_outer_indexing_reversed[3] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_isel_dataarray[3] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_array_type_after_indexing[3] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_dropna[3] - Attri... 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_ondisk_after_print[3] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_roundtrip_bytes_with_fill_value[3] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_roundtrip_unsigned[3-fill_value0-False] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_roundtrip_unsigned[3-fill_value1-True] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_roundtrip_unsigned[3--1-False] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_roundtrip_unsigned[3-255-True] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_grid_mapping_and_bounds_are_not_coordinates_in_file[3] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_coordinate_variables_after_dataset_roundtrip[3] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_grid_mapping_and_bounds_are_coordinates_after_dataarray_roundtrip[3] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_encoding_kwarg[3] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_default_fill_value[3] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_explicitly_omit_fill_value_in_coord[3] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_explicitly_omit_fill_value_in_coord_via_encoding_kwarg[3] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_encoding_same_dtype[3] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_append_overwrite_values[3] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_roundtrip_consolidated[3-False] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_roundtrip_consolidated[3-True] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_roundtrip_consolidated[3-None] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_read_non_consolidated_warning[3] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_non_existent_store[3] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_auto_chunk[3] - A... 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_manual_chunk[3] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_warning_on_bad_chunks[3] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_uneven_dask_chunks[3] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_chunk_encoding[3] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_shard_encoding[3] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_persistence_modes[3-None] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_persistence_modes[3-group1] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_compressor_encoding[3] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_group[3] - Attrib... 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_append_write[3] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_append_with_append_dim_not_set_raises[3] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_append_string_length_mismatch_works[3-U] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_append_string_length_mismatch_works[3-S] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_check_encoding_is_consistent_after_append[3] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_append_with_new_variable[3] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_append_with_append_dim_no_overwrite[3] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_to_zarr_compute_false_roundtrip[3] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_to_zarr_append_compute_false_roundtrip[3] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_save_emptydim[3-False] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_save_emptydim[3-True] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_no_warning_from_open_emptydim_with_chunks[3] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-False-False-False-False] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-False-False-False-True] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-False-False-False-None] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-False-False-True-False] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-False-False-True-True] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-False-False-True-None] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-False-True-False-False] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-False-True-False-True] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-False-True-False-None] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-False-True-True-False] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-False-True-True-True] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-False-True-True-None] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-True-False-False-False] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-True-False-False-True] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-True-False-False-None] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-True-False-True-False] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-True-False-True-True] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-True-False-True-None] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-True-True-False-False] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-True-True-False-True] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-True-True-False-None] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-True-True-True-False] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-True-True-True-True] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-True-True-True-None] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-None-False-False-False] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-None-False-False-True] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-None-False-False-None] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-None-False-True-False] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-None-False-True-True] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-None-False-True-None] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-None-True-False-False] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-None-True-False-True] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-None-True-False-None] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-None-True-True-False] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-None-True-True-True] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-None-True-True-None] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region_mode[3-None] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region_mode[3-r+] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region_mode[3-a] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_preexisting_override_metadata[3] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_encoding_chunksizes[3] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_chunk_encoding_with_partial_dask_chunks[3] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_open_zarr_use_cftime[3] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_read_select_write[3] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_attributes[3-obj1] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_chunked_datetime64_or_timedelta64[3-datetime64[ns]] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_chunked_datetime64_or_timedelta64[3-timedelta64[ns]] 718s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_zarr_fill_value_setting[3-float] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_zero_dimensional_variable[3] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_store[3] - Attr... 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_roundtrip_test_data[3] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_load[3] - AttributeEr... 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_dataset_compute[3] - ... 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_roundtrip_object_dtype[3] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_roundtrip_float64_data[3] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_orthogonal_indexing[3] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_vectorized_indexing[3] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_vectorized_indexing_negative_step[3] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_outer_indexing_reversed[3] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_isel_dataarray[3] - A... 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_array_type_after_indexing[3] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_dropna[3] - Attribute... 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_ondisk_after_print[3] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_roundtrip_bytes_with_fill_value[3] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_roundtrip_unsigned[3-fill_value0-False] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_roundtrip_unsigned[3-fill_value1-True] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_roundtrip_unsigned[3--1-False] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_roundtrip_unsigned[3-255-True] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_grid_mapping_and_bounds_are_not_coordinates_in_file[3] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_coordinate_variables_after_dataset_roundtrip[3] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_grid_mapping_and_bounds_are_coordinates_after_dataarray_roundtrip[3] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_encoding_kwarg[3] - A... 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_default_fill_value[3] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_explicitly_omit_fill_value_in_coord[3] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_explicitly_omit_fill_value_in_coord_via_encoding_kwarg[3] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_encoding_same_dtype[3] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_append_overwrite_values[3] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_roundtrip_consolidated[3-False] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_roundtrip_consolidated[3-True] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_roundtrip_consolidated[3-None] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_read_non_consolidated_warning[3] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_non_existent_store[3] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_auto_chunk[3] - Attri... 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_manual_chunk[3] - Att... 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_warning_on_bad_chunks[3] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_uneven_dask_chunks[3] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_chunk_encoding[3] - A... 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_shard_encoding[3] - A... 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_persistence_modes[3-None] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_persistence_modes[3-group1] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_compressor_encoding[3] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_group[3] - AttributeE... 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_append_write[3] - Att... 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_append_with_append_dim_not_set_raises[3] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_append_string_length_mismatch_works[3-U] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_append_string_length_mismatch_works[3-S] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_check_encoding_is_consistent_after_append[3] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_append_with_new_variable[3] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_append_with_append_dim_no_overwrite[3] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_to_zarr_compute_false_roundtrip[3] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_to_zarr_append_compute_false_roundtrip[3] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_save_emptydim[3-False] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_save_emptydim[3-True] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_no_warning_from_open_emptydim_with_chunks[3] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-False-False-False-False] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-False-False-False-True] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-False-False-False-None] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-False-False-True-False] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-False-False-True-True] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-False-False-True-None] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-False-True-False-False] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-False-True-False-True] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-False-True-False-None] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-False-True-True-False] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-False-True-True-True] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-False-True-True-None] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-True-False-False-False] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-True-False-False-True] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-True-False-False-None] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-True-False-True-False] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-True-False-True-True] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-True-False-True-None] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-True-True-False-False] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-True-True-False-True] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-True-True-False-None] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-True-True-True-False] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-True-True-True-True] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-True-True-True-None] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-None-False-False-False] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-None-False-False-True] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-None-False-False-None] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-None-False-True-False] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-None-False-True-True] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-None-False-True-None] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-None-True-False-False] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-None-True-False-True] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-None-True-False-None] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-None-True-True-False] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-None-True-True-True] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-None-True-True-None] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region_mode[3-None] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region_mode[3-r+] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region_mode[3-a] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_preexisting_override_metadata[3] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_encoding_chunksizes[3] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_chunk_encoding_with_partial_dask_chunks[3] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_open_zarr_use_cftime[3] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_read_select_write[3] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_attributes[3-obj1] - ... 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_chunked_datetime64_or_timedelta64[3-datetime64[ns]] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_chunked_datetime64_or_timedelta64[3-timedelta64[ns]] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_zarr_fill_value_setting[3-float] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_empty[3-True-True] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_empty[3-True-False] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_empty[3-True-None] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_empty[3-False-True] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_empty[3-False-False] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_empty[3-False-None] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_empty[3-None-True] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_empty[3-None-False] 718s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_empty[3-None-None] 718s FAILED tests/test_backends.py::TestZarrRegionAuto::test_zarr_region_auto[3-full-auto] 718s FAILED tests/test_backends.py::TestZarrRegionAuto::test_zarr_region_auto[3-mixed-auto] 718s FAILED tests/test_backends.py::TestZarrRegionAuto::test_zarr_region_index_write[3] 718s FAILED tests/test_backends.py::TestZarrRegionAuto::test_zarr_region[3] - Attr... 718s FAILED tests/test_backends.py::TestZarrRegionAuto::test_zarr_append_chunk_partial[3] 718s FAILED tests/test_backends.py::TestZarrRegionAuto::test_zarr_region_chunk_partial_offset[3] 718s FAILED tests/test_backends.py::TestZarrRegionAuto::test_zarr_safe_chunk_append_dim[3] 718s FAILED tests/test_backends.py::TestZarrRegionAuto::test_zarr_safe_chunk_region[3-r+] 718s FAILED tests/test_backends.py::TestZarrRegionAuto::test_zarr_safe_chunk_region[3-a] 718s FAILED tests/test_backends.py::TestScipyFilePath::test_roundtrip_example_1_netcdf_gz 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_zero_dimensional_variable 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_roundtrip_test_data 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_load - ModuleNotFo... 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_dataset_compute - ... 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_pickle - ModuleNot... 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_pickle_dataarray 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_dataset_caching - ... 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_roundtrip_None_variable 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_roundtrip_object_dtype 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_roundtrip_string_data 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_roundtrip_string_encoded_characters 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_roundtrip_numpy_datetime_data 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_roundtrip_cftime_datetime_data 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_roundtrip_timedelta_data 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_roundtrip_float64_data 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_roundtrip_coordinates 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_roundtrip_global_coordinates 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_roundtrip_coordinates_with_space 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_roundtrip_boolean_dtype 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_orthogonal_indexing 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_vectorized_indexing 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_vectorized_indexing_negative_step 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_outer_indexing_reversed 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_isel_dataarray - M... 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_array_type_after_indexing 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_dropna - ModuleNot... 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_ondisk_after_print 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_roundtrip_bytes_with_fill_value 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_roundtrip_empty_vlen_string_array 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_roundtrip_unsigned[fill_value0-False] 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_roundtrip_unsigned[fill_value1-True] 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_roundtrip_unsigned[-1-False] 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_roundtrip_unsigned[255-True] 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_grid_mapping_and_bounds_are_not_coordinates_in_file 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_coordinate_variables_after_dataset_roundtrip 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_grid_mapping_and_bounds_are_coordinates_after_dataarray_roundtrip 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_coordinates_encoding 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_encoding_kwarg - M... 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_encoding_kwarg_dates 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_encoding_kwarg_fixed_width_string 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_default_fill_value 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_explicitly_omit_fill_value 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_explicitly_omit_fill_value_via_encoding_kwarg 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_explicitly_omit_fill_value_in_coord 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_explicitly_omit_fill_value_in_coord_via_encoding_kwarg 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_encoding_same_dtype 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_append_write - Mod... 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_append_overwrite_values 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_multiindex_not_implemented 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_string_object_warning 718s FAILED tests/test_backends.py::TestGenericNetCDFData::test_encoding_unlimited_dims 718s FAILED tests/test_backends.py::TestOpenMFDatasetWithDataVarsAndCoordsKw::test_open_mfdataset_does_same_as_concat[outer-all-nested-t] 718s FAILED tests/test_backends.py::TestOpenMFDatasetWithDataVarsAndCoordsKw::test_open_mfdataset_does_same_as_concat[outer-all-by_coords-None] 718s FAILED tests/test_backends.py::TestOpenMFDatasetWithDataVarsAndCoordsKw::test_open_mfdataset_does_same_as_concat[outer-minimal-nested-t] 718s FAILED tests/test_backends.py::TestOpenMFDatasetWithDataVarsAndCoordsKw::test_open_mfdataset_does_same_as_concat[outer-minimal-by_coords-None] 718s FAILED tests/test_backends.py::TestOpenMFDatasetWithDataVarsAndCoordsKw::test_open_mfdataset_does_same_as_concat[outer-different-nested-t] 718s FAILED tests/test_backends.py::TestOpenMFDatasetWithDataVarsAndCoordsKw::test_open_mfdataset_does_same_as_concat[outer-different-by_coords-None] 718s FAILED tests/test_backends.py::TestOpenMFDatasetWithDataVarsAndCoordsKw::test_open_mfdataset_does_same_as_concat[inner-all-nested-t] 718s FAILED tests/test_backends.py::TestOpenMFDatasetWithDataVarsAndCoordsKw::test_open_mfdataset_does_same_as_concat[inner-all-by_coords-None] 718s FAILED tests/test_backends.py::TestOpenMFDatasetWithDataVarsAndCoordsKw::test_open_mfdataset_does_same_as_concat[inner-minimal-nested-t] 718s FAILED tests/test_backends.py::TestOpenMFDatasetWithDataVarsAndCoordsKw::test_open_mfdataset_does_same_as_concat[inner-minimal-by_coords-None] 718s FAILED tests/test_backends.py::TestOpenMFDatasetWithDataVarsAndCoordsKw::test_open_mfdataset_does_same_as_concat[inner-different-nested-t] 718s FAILED tests/test_backends.py::TestOpenMFDatasetWithDataVarsAndCoordsKw::test_open_mfdataset_does_same_as_concat[inner-different-by_coords-None] 718s FAILED tests/test_backends.py::TestOpenMFDatasetWithDataVarsAndCoordsKw::test_open_mfdataset_does_same_as_concat[left-all-nested-t] 718s FAILED tests/test_backends.py::TestOpenMFDatasetWithDataVarsAndCoordsKw::test_open_mfdataset_does_same_as_concat[left-all-by_coords-None] 718s FAILED tests/test_backends.py::TestOpenMFDatasetWithDataVarsAndCoordsKw::test_open_mfdataset_does_same_as_concat[left-minimal-nested-t] 718s FAILED tests/test_backends.py::TestOpenMFDatasetWithDataVarsAndCoordsKw::test_open_mfdataset_does_same_as_concat[left-minimal-by_coords-None] 718s FAILED tests/test_backends.py::TestOpenMFDatasetWithDataVarsAndCoordsKw::test_open_mfdataset_does_same_as_concat[left-different-nested-t] 718s FAILED tests/test_backends.py::TestOpenMFDatasetWithDataVarsAndCoordsKw::test_open_mfdataset_does_same_as_concat[left-different-by_coords-None] 718s FAILED tests/test_backends.py::TestOpenMFDatasetWithDataVarsAndCoordsKw::test_open_mfdataset_does_same_as_concat[right-all-nested-t] 718s FAILED tests/test_backends.py::TestOpenMFDatasetWithDataVarsAndCoordsKw::test_open_mfdataset_does_same_as_concat[right-all-by_coords-None] 718s FAILED tests/test_backends.py::TestOpenMFDatasetWithDataVarsAndCoordsKw::test_open_mfdataset_does_same_as_concat[right-minimal-nested-t] 718s FAILED tests/test_backends.py::TestOpenMFDatasetWithDataVarsAndCoordsKw::test_open_mfdataset_does_same_as_concat[right-minimal-by_coords-None] 718s FAILED tests/test_backends.py::TestOpenMFDatasetWithDataVarsAndCoordsKw::test_open_mfdataset_does_same_as_concat[right-different-nested-t] 718s FAILED tests/test_backends.py::TestOpenMFDatasetWithDataVarsAndCoordsKw::test_open_mfdataset_does_same_as_concat[right-different-by_coords-None] 718s FAILED tests/test_backends.py::TestOpenMFDatasetWithDataVarsAndCoordsKw::test_open_mfdataset_dataset_combine_attrs[drop] 718s FAILED tests/test_backends.py::TestOpenMFDatasetWithDataVarsAndCoordsKw::test_open_mfdataset_dataset_combine_attrs[override] 718s FAILED tests/test_backends.py::TestOpenMFDatasetWithDataVarsAndCoordsKw::test_open_mfdataset_dataset_combine_attrs[no_conflicts] 718s FAILED tests/test_backends.py::TestOpenMFDatasetWithDataVarsAndCoordsKw::test_open_mfdataset_dataset_combine_attrs[identical] 718s FAILED tests/test_backends.py::TestOpenMFDatasetWithDataVarsAndCoordsKw::test_open_mfdataset_dataset_combine_attrs[drop_conflicts] 718s FAILED tests/test_backends.py::TestOpenMFDatasetWithDataVarsAndCoordsKw::test_open_mfdataset_dataset_attr_by_coords 718s FAILED tests/test_backends.py::TestOpenMFDatasetWithDataVarsAndCoordsKw::test_open_mfdataset_dataarray_attr_by_coords 718s FAILED tests/test_backends.py::TestOpenMFDatasetWithDataVarsAndCoordsKw::test_open_mfdataset_exact_join_raises_error[all-nested-t] 718s FAILED tests/test_backends.py::TestOpenMFDatasetWithDataVarsAndCoordsKw::test_open_mfdataset_exact_join_raises_error[all-by_coords-None] 718s FAILED tests/test_backends.py::TestOpenMFDatasetWithDataVarsAndCoordsKw::test_open_mfdataset_exact_join_raises_error[minimal-nested-t] 718s FAILED tests/test_backends.py::TestOpenMFDatasetWithDataVarsAndCoordsKw::test_open_mfdataset_exact_join_raises_error[minimal-by_coords-None] 718s FAILED tests/test_backends.py::TestOpenMFDatasetWithDataVarsAndCoordsKw::test_open_mfdataset_exact_join_raises_error[different-nested-t] 718s FAILED tests/test_backends.py::TestOpenMFDatasetWithDataVarsAndCoordsKw::test_open_mfdataset_exact_join_raises_error[different-by_coords-None] 718s FAILED tests/test_backends.py::TestOpenMFDatasetWithDataVarsAndCoordsKw::test_common_coord_when_datavars_all 718s FAILED tests/test_backends.py::TestOpenMFDatasetWithDataVarsAndCoordsKw::test_common_coord_when_datavars_minimal 718s FAILED tests/test_backends.py::TestOpenMFDatasetWithDataVarsAndCoordsKw::test_invalid_data_vars_value_should_fail 718s FAILED tests/test_backends.py::TestDataArrayToNetCDF::test_dataarray_to_netcdf_no_name 718s FAILED tests/test_backends.py::TestDataArrayToNetCDF::test_dataarray_to_netcdf_with_name 718s FAILED tests/test_backends.py::TestDataArrayToNetCDF::test_dataarray_to_netcdf_coord_name_clash 718s FAILED tests/test_backends.py::TestDataArrayToNetCDF::test_open_dataarray_options 718s FAILED tests/test_backends.py::TestDataArrayToNetCDF::test_dataarray_to_netcdf_no_name_pathlib 718s FAILED tests/test_backends.py::test_source_encoding_always_present - ModuleNo... 718s FAILED tests/test_backends.py::test_source_encoding_always_present_with_pathlib 718s FAILED tests/test_backends.py::test_use_cftime_standard_calendar_default_in_range[gregorian] 718s FAILED tests/test_backends.py::test_use_cftime_standard_calendar_default_in_range[proleptic_gregorian] 718s FAILED tests/test_backends.py::test_use_cftime_standard_calendar_default_in_range[standard] 718s FAILED tests/test_backends.py::test_use_cftime_standard_calendar_default_out_of_range[standard] 718s FAILED tests/test_backends.py::test_use_cftime_standard_calendar_default_out_of_range[gregorian] 718s FAILED tests/test_backends.py::test_use_cftime_true[1500-360_day] - ModuleNot... 718s FAILED tests/test_backends.py::test_use_cftime_true[1500-365_day] - ModuleNot... 718s FAILED tests/test_backends.py::test_use_cftime_true[1500-366_day] - ModuleNot... 718s FAILED tests/test_backends.py::test_use_cftime_true[1500-all_leap] - ModuleNo... 718s FAILED tests/test_backends.py::test_use_cftime_true[1500-gregorian] - ModuleN... 718s FAILED tests/test_backends.py::test_use_cftime_true[1500-julian] - ModuleNotF... 718s FAILED tests/test_backends.py::test_use_cftime_true[1500-noleap] - ModuleNotF... 718s FAILED tests/test_backends.py::test_use_cftime_true[1500-proleptic_gregorian] 718s FAILED tests/test_backends.py::test_use_cftime_true[1500-standard] - ModuleNo... 718s FAILED tests/test_backends.py::test_use_cftime_true[2000-360_day] - ModuleNot... 718s FAILED tests/test_backends.py::test_use_cftime_true[2000-365_day] - ModuleNot... 718s FAILED tests/test_backends.py::test_use_cftime_true[2000-366_day] - ModuleNot... 718s FAILED tests/test_backends.py::test_use_cftime_true[2000-all_leap] - ModuleNo... 718s FAILED tests/test_backends.py::test_use_cftime_true[2000-gregorian] - ModuleN... 718s FAILED tests/test_backends.py::test_use_cftime_true[2000-julian] - ModuleNotF... 718s FAILED tests/test_backends.py::test_use_cftime_true[2000-noleap] - ModuleNotF... 718s FAILED tests/test_backends.py::test_use_cftime_true[2000-proleptic_gregorian] 718s FAILED tests/test_backends.py::test_use_cftime_true[2000-standard] - ModuleNo... 718s FAILED tests/test_backends.py::test_use_cftime_true[2500-360_day] - ModuleNot... 718s FAILED tests/test_backends.py::test_use_cftime_true[2500-365_day] - ModuleNot... 718s FAILED tests/test_backends.py::test_use_cftime_true[2500-366_day] - ModuleNot... 718s FAILED tests/test_backends.py::test_use_cftime_true[2500-all_leap] - ModuleNo... 718s FAILED tests/test_backends.py::test_use_cftime_true[2500-gregorian] - ModuleN... 718s FAILED tests/test_backends.py::test_use_cftime_true[2500-julian] - ModuleNotF... 718s FAILED tests/test_backends.py::test_use_cftime_true[2500-noleap] - ModuleNotF... 718s FAILED tests/test_backends.py::test_use_cftime_true[2500-proleptic_gregorian] 718s FAILED tests/test_backends.py::test_use_cftime_true[2500-standard] - ModuleNo... 718s FAILED tests/test_backends.py::test_use_cftime_false_standard_calendar_out_of_range[standard] 718s FAILED tests/test_backends.py::test_use_cftime_false_standard_calendar_out_of_range[gregorian] 718s FAILED tests/test_backends.py::test_use_cftime_false_nonstandard_calendar[1500-360_day] 718s FAILED tests/test_backends.py::test_use_cftime_false_nonstandard_calendar[1500-365_day] 718s FAILED tests/test_backends.py::test_use_cftime_false_nonstandard_calendar[1500-366_day] 718s FAILED tests/test_backends.py::test_use_cftime_false_nonstandard_calendar[1500-all_leap] 718s FAILED tests/test_backends.py::test_use_cftime_false_nonstandard_calendar[1500-julian] 718s FAILED tests/test_backends.py::test_use_cftime_false_nonstandard_calendar[1500-noleap] 718s FAILED tests/test_backends.py::test_use_cftime_false_nonstandard_calendar[2000-360_day] 718s FAILED tests/test_backends.py::test_use_cftime_false_nonstandard_calendar[2000-365_day] 718s FAILED tests/test_backends.py::test_use_cftime_false_nonstandard_calendar[2000-366_day] 718s FAILED tests/test_backends.py::test_use_cftime_false_nonstandard_calendar[2000-all_leap] 718s FAILED tests/test_backends.py::test_use_cftime_false_nonstandard_calendar[2000-julian] 718s FAILED tests/test_backends.py::test_use_cftime_false_nonstandard_calendar[2000-noleap] 718s FAILED tests/test_backends.py::test_use_cftime_false_nonstandard_calendar[2500-360_day] 718s FAILED tests/test_backends.py::test_use_cftime_false_nonstandard_calendar[2500-365_day] 718s FAILED tests/test_backends.py::test_use_cftime_false_nonstandard_calendar[2500-366_day] 718s FAILED tests/test_backends.py::test_use_cftime_false_nonstandard_calendar[2500-all_leap] 718s FAILED tests/test_backends.py::test_use_cftime_false_nonstandard_calendar[2500-julian] 718s FAILED tests/test_backends.py::test_use_cftime_false_nonstandard_calendar[2500-noleap] 718s FAILED tests/test_backends.py::test_open_dataset_chunking_zarr[auto] - Attrib... 718s FAILED tests/test_backends.py::test_open_dataset_chunking_zarr[-1] - Attribut... 718s FAILED tests/test_backends.py::test_open_dataset_chunking_zarr[chunks2] - Att... 718s FAILED tests/test_backends.py::test_open_dataset_chunking_zarr[chunks3] - Att... 718s FAILED tests/test_backends.py::test_open_dataset_chunking_zarr[chunks4] - Att... 718s FAILED tests/test_backends.py::test_open_dataset_chunking_zarr[chunks5] - Att... 718s FAILED tests/test_backends.py::test_chunking_consintency[auto] - AttributeErr... 718s FAILED tests/test_backends.py::test_chunking_consintency[-1] - AttributeError... 718s FAILED tests/test_backends.py::test_chunking_consintency[chunks2] - Attribute... 718s FAILED tests/test_backends.py::test_chunking_consintency[chunks3] - Attribute... 718s FAILED tests/test_backends.py::test_chunking_consintency[chunks4] - Attribute... 718s FAILED tests/test_backends.py::test_chunking_consintency[chunks5] - Attribute... 718s FAILED tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr[zarr_format=3] 718s FAILED tests/test_backends_datatree.py::TestZarrDatatreeIO::test_zarr_encoding[zarr_format=3] 718s FAILED tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 718s FAILED tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=3] 718s FAILED tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_not_consolidated[zarr_format=3] 718s FAILED tests/test_backends_datatree.py::TestZarrDatatreeIO::test_open_groups_round_trip[zarr_format=3] 718s FAILED tests/test_backends_datatree.py::TestZarrDatatreeIO::test_open_datatree[zarr_format=3] 718s FAILED tests/test_backends_datatree.py::TestZarrDatatreeIO::test_open_datatree_chunks[zarr_format=3] 718s FAILED tests/test_backends_datatree.py::TestZarrDatatreeIO::test_open_groups[zarr_format=3] 718s FAILED tests/test_backends_datatree.py::TestZarrDatatreeIO::test_open_datatree_specific_group[True-zarr_format=3] 718s FAILED tests/test_backends_datatree.py::TestZarrDatatreeIO::test_open_datatree_specific_group[False-zarr_format=3] 718s FAILED tests/test_backends_datatree.py::TestZarrDatatreeIO::test_open_datatree_specific_group[None-zarr_format=3] 718s FAILED tests/test_backends_datatree.py::TestZarrDatatreeIO::test_open_groups_chunks[zarr_format=3] 718s FAILED tests/test_dask.py::test_normalize_token_with_backend - ModuleNotFound... 718s FAILED tests/test_plugins.py::test_list_engines - AssertionError: assert ('h5... 718s = 514 failed, 18358 passed, 2690 skipped, 51 deselected, 234 xfailed, 45 xpassed, 993 warnings in 529.40s (0:08:49) = 722s E: pybuild pybuild:389: test: plugin pyproject failed with: exit code=1: cd /tmp/autopkgtest.cdpOi4/autopkgtest_tmp/build; python3.14 -m pytest --deselect=tests/test_weighted.py::test_weighted_operations_keep_attr --deselect=tests/test_variable.py::TestVariable::test_reduce_keepdims --deselect=tests/test_backends.py::test_zarr_region_chunk_partial_offset --deselect=tests/test_backends.py::test_chunk_encoding_with_dask --pyargs xarray 722s I: pybuild base:311: cd /tmp/autopkgtest.cdpOi4/autopkgtest_tmp/build; python3.13 -m pytest --deselect=tests/test_weighted.py::test_weighted_operations_keep_attr --deselect=tests/test_variable.py::TestVariable::test_reduce_keepdims --deselect=tests/test_backends.py::test_zarr_region_chunk_partial_offset --deselect=tests/test_backends.py::test_chunk_encoding_with_dask --pyargs xarray 731s ============================= test session starts ============================== 731s platform linux -- Python 3.13.9, pytest-8.3.5, pluggy-1.6.0 731s rootdir: /tmp/autopkgtest.cdpOi4/autopkgtest_tmp/build 731s configfile: pyproject.toml 731s plugins: zarr-3.1.3, xdist-3.8.0, mypy-plugins-3.2.0, hypothesis-6.130.5, typeguard-4.4.2 731s collected 21888 items / 51 deselected / 4 skipped / 21837 selected 731s 731s tests/test_accessor_dt.py .............................................. [ 0%] 732s ........................................................................ [ 0%] 732s ........................................................................ [ 0%] 733s ........................................................................ [ 1%] 734s ........................................................................ [ 1%] 734s .................... [ 1%] 734s tests/test_accessor_str.py ............................................. [ 1%] 734s ........................................................................ [ 2%] 734s ........................................................................ [ 2%] 734s ...................................... [ 2%] 734s tests/test_assertions.py .............................. [ 2%] 736s tests/test_backends.py .................s...............XxXXXXxXXX...... [ 3%] 736s .s.s....................................................s............... [ 3%] 739s ....s..............XxXXXXxXXX.......s.s................................. [ 3%] 740s ..................s..s...................s...............XxXsXsssss..... [ 4%] 743s ..s..................Fs........s.s.................ss................... [ 4%] 746s ..........................................................s............. [ 4%] 750s ..XxXsXsssss.......s..................Fs........s.s.................ss.. [ 5%] 755s ........................................................................ [ 5%] 759s ...s...............XxXsXsssss.......s..................Fs........s.s.... [ 5%] 764s .............ss......................................................... [ 5%] 772s .....FFF......................FFFFF...F.....Fs....FFFFFFFFF..xxxsxsssssF [ 6%] 785s FFFFFFs.s.F.F..FFFF..FFFFFsFFF.FFF.ss.FFFF...F....F..ssFFFFFFFFFFFFFFFFF [ 6%] 799s FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF.FF.FF.FFF...FFFFFF...F.....Fs....FFFFF [ 6%] 811s FFFF..xxxsxsssssFFFFFFFs.s.F.F..FFFF..FFFFFsFFF.FFF.ss.FFFF...F....F..ss [ 7%] 827s FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF.FF.FF.FFF...FFFFFF... [ 7%] 840s F.....Fs....FFFFFFFFF..xxxsxsssssFFFFFFFs.s.F.F..FFFF..FFFFFsFFF.FFF.ss. [ 7%] 855s FFFF...F....F..ssFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF.FF.F [ 8%] 863s F.FFF...FFFFFFFFFF....FF.F.F.FFFFFs..................s...............XxX [ 8%] 865s sXXxXsX.......s.s................................s...............XxXsXXx [ 8%] 866s XsX.......s.s...............ss.................s...............XxXsXXxXs [ 9%] 867s X.......s.s....................................s...............XxXsXXxXs [ 9%] 868s X.......s.s.................................s...............XxXsXXxXsX.. [ 9%] 870s .....s.s...............................s...............XxXsXXxXsX....... [ 10%] 872s s.s...................................s...............XxXsXXxXsX.......s [ 10%] 873s .s.............................................sss...................... [ 10%] 876s .......s...............XxXsXXxXsX.......s.s............................. [ 11%] 879s ................sss.............................s...............XxXsXXxX [ 11%] 881s sX.......s.s.............................................sss...........s [ 11%] 881s ..ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss.... [ 12%] 883s .................................................s..................s... [ 12%] 883s ..........................sssssss..x........s..s..s..s.sss.............. [ 12%] 887s ......................XXX........................s.FFFFFFFFFFFF......Fss [ 13%] 887s . [ 13%] 887s tests/test_backends_api.py ........................ [ 13%] 887s tests/test_backends_common.py ... [ 13%] 889s tests/test_backends_datatree.py ..................F.FFF.F.......F.F.F.F. [ 13%] 890s F.F.F.F...... [ 13%] 892s tests/test_backends_file_manager.py ............................... [ 13%] 892s tests/test_backends_locks.py . [ 13%] 892s tests/test_backends_lru_cache.py ........ [ 13%] 894s tests/test_calendar_ops.py ........................... [ 13%] 894s tests/test_cftime_offsets.py ........................................... [ 14%] 894s ........................................................................ [ 14%] 894s ........................................................................ [ 14%] 894s ........................................................................ [ 15%] 894s ........................................................................ [ 15%] 894s ........................................................................ [ 15%] 894s ........................................................................ [ 16%] 894s ........................................................................ [ 16%] 894s ........................................................................ [ 16%] 894s ........................................................................ [ 17%] 894s ........................................................................ [ 17%] 894s ........................................................................ [ 17%] 894s ........................................................................ [ 18%] 894s ........................................................................ [ 18%] 894s ........................................................................ [ 18%] 894s ........................................................................ [ 19%] 894s ........................................................................ [ 19%] 895s ........................................................................ [ 19%] 895s ........................................................................ [ 20%] 895s ........................................................................ [ 20%] 895s ........................................................................ [ 20%] 895s ........................................................................ [ 21%] 895s ........................................................................ [ 21%] 895s ........................................................................ [ 21%] 895s ........................................................................ [ 22%] 895s ........................................................................ [ 22%] 895s ........................................................................ [ 22%] 895s ........................................................................ [ 23%] 895s ........................................................................ [ 23%] 895s ........................................................................ [ 23%] 895s ........................................................................ [ 24%] 895s ........................................................................ [ 24%] 895s ........................................................................ [ 24%] 895s ........................................................................ [ 24%] 895s ........................................................................ [ 25%] 895s ........................................................................ [ 25%] 895s ........................................................................ [ 25%] 895s ........................................................................ [ 26%] 896s ........................................................................ [ 26%] 896s .............ssssssssssssssssssssssssssssssssssssssssssssssssssssssss... [ 26%] 896s .ssss....ssss....ssss....ssss.................................. [ 27%] 896s tests/test_cftimeindex.py .............................................. [ 27%] 896s ........................................................................ [ 27%] 896s ........................................................................ [ 28%] 896s ........................................................................ [ 28%] 896s ........................................................................ [ 28%] 896s ........................................................................ [ 29%] 896s ........................................................................ [ 29%] 896s ........................................................................ [ 29%] 896s ........................................................................ [ 30%] 896s ........................................................................ [ 30%] 896s ........................................................................ [ 30%] 897s ........................................................................ [ 31%] 897s ...........................................x............................ [ 31%] 897s ........................................................................ [ 31%] 897s ................................................ [ 31%] 897s tests/test_cftimeindex_resample.py ..................................... [ 32%] 898s ........................................................................ [ 32%] 898s ........................................................................ [ 32%] 898s ........................................................................ [ 33%] 899s ........................................................................ [ 33%] 899s ........................................................................ [ 33%] 900s ........................................................................ [ 34%] 900s ................................................ [ 34%] 900s tests/test_coarsen.py .................................................. [ 34%] 901s ........................................................................ [ 34%] 901s ..........s.......s.......s.......s.......s.......s.......s.......s..... [ 35%] 901s .... [ 35%] 901s tests/test_coding.py ............................... [ 35%] 901s tests/test_coding_strings.py ....................... [ 35%] 901s tests/test_coding_times.py ............................................. [ 35%] 902s ........................................................................ [ 36%] 902s ........................................................................ [ 36%] 902s ........................................................................ [ 36%] 902s ........................................................................ [ 37%] 902s ........................................................................ [ 37%] 902s ........................................................................ [ 37%] 902s ........................................................................ [ 38%] 902s ........................................................................ [ 38%] 903s ........................................................................ [ 38%] 903s ...................s.................................................... [ 39%] 903s ........................................................................ [ 39%] 903s ........................................................................ [ 39%] 903s ......................................ssssssss......s......s......s..... [ 39%] 904s .s......s............................................................... [ 40%] 904s .......................................................... [ 40%] 904s tests/test_combine.py .......................................x.......... [ 40%] 904s ...................................................... [ 41%] 905s tests/test_computation.py .............................................. [ 41%] 906s ........................................................................ [ 41%] 907s ........................................................................ [ 41%] 909s ........................................................................ [ 42%] 909s ..................................XxXx. [ 42%] 910s tests/test_concat.py ................................................... [ 42%] 910s ................................................. [ 42%] 910s tests/test_conventions.py .............................................. [ 43%] 911s ...s..............XxXsXXxXsX.......s.s............s........... [ 43%] 911s tests/test_coordinate_transform.py ............ [ 43%] 911s tests/test_coordinates.py ...................... [ 43%] 912s tests/test_dask.py ..................................................... [ 43%] 922s ..........XXx.X......................................................... [ 44%] 923s ........................................................................ [ 44%] 924s ...................... [ 44%] 924s tests/test_dataarray.py ................................................ [ 44%] 924s ........................................................................ [ 45%] 924s ........................................................................ [ 45%] 925s ........................................................................ [ 45%] 925s s...ss......................................Xx.......................... [ 46%] 926s ..........................ss....ss...................................... [ 46%] 928s ............x.....................................x.......x............. [ 46%] 928s ................sssssssssssss.................ss...... [ 47%] 956s tests/test_dataarray_typing.yml .............. [ 47%] 958s tests/test_dataset.py .................................................. [ 47%] 958s ........................................................................ [ 47%] 959s ......Xx...................................................s............ [ 47%] 959s ..............................................s......................... [ 48%] 959s ........................................................................ [ 48%] 960s ...............................................................ss....ss. [ 48%] 961s ......................................................................ss [ 49%] 961s ... [ 49%] 988s tests/test_dataset_typing.yml .............. [ 49%] 989s tests/test_datatree.py ............................xx..........x......x. [ 49%] 989s ........................................................................ [ 49%] 989s ........x.......... [ 49%] 989s tests/test_datatree_mapping.py .............x........ [ 50%] 1017s tests/test_datatree_typing.yml .............. [ 50%] 1017s tests/test_deprecation_helpers.py .. [ 50%] 1017s tests/test_dtypes.py ................................................... [ 50%] 1017s ...sss... [ 50%] 1017s tests/test_duck_array_ops.py ......s...........s........................ [ 50%] 1018s ..................................................................s..... [ 50%] 1018s ..................................ss..............ss..............ss.... [ 51%] 1019s ..ss......ss..............ss............................................ [ 51%] 1020s ..........ss......ss..............................ss..............ss.... [ 51%] 1021s ..........ss......ss......ss..............ss............................ [ 52%] 1023s ..........................ss......ss................ssssssssss.......... [ 52%] 1023s ssssssssss..........ssssssssss..........ssssssssss..........ssssss...... [ 52%] 1023s ........ssssss..............ssssss..............ssssss..............ssss [ 53%] 1024s sssssss.s.s.s.s.sssssssssss.s.s.s.s.sssssssssss.s.s.s.s.sssssssssss.s.s. [ 53%] 1024s s.s.sssssss.s.s.s.s.s.s.sssssss.s.s.s.s.s.s.sssssss.s.s.s.s.s.s.sssssss. [ 53%] 1025s s.s.s.s.s.s............................................................. [ 54%] 1025s ........................................................................ [ 54%] 1026s ........................................................................ [ 54%] 1026s ........................................................................ [ 55%] 1027s ........................................................................ [ 55%] 1028s ........................................................................ [ 55%] 1030s ........................................................ [ 56%] 1030s tests/test_duck_array_wrapping.py s.s.ss.s.ss.s.ss.s.ss.s.ss.s.ss.sxss.s [ 56%] 1031s .ss.s.ss.s.ss.sxss.s.ss.s.ss.s.ss.s.ss.s.ssXsxss.sxss.sxss.sxss.s.ss.s.s [ 56%] 1031s sxsxssxsxssxsxss.s.ss.sxss.s.ss.s.ss.s.ss.s.ss.sxss.sxssxsxss.s.ss.s.ss. [ 57%] 1032s sxss.sxss.s.ss.s.ss.s.ss.s.ss.sxss.s.ss.s.ss.s.ss.s.ssXsxss.s.ss.sxss.sx [ 57%] 1032s ss.sxss.sxss.sxss.sxss.sxss.sxss.sxss.sxss.s.ss.s.ss.s.ss.s.ss.s.ss.s.ss [ 57%] 1032s .s.ss.s.ss.s.ss.s.ss.s.ss.s.ss.s.ss.s.ss.s.ss.s.ss.s.ss.s.ss.s.ss.s.ssxs [ 57%] 1032s xss.s.ss.s.ss.s.ssxs.ss.s.ssxsxss.s.ss.s.ss.s.ssxsxss.s.ss.s.ss.s.ss.s.s [ 58%] 1032s s.s.ss.s.ss.s.ss.s.s [ 58%] 1032s tests/test_error_messages.py .. [ 58%] 1032s tests/test_extensions.py .... [ 58%] 1032s tests/test_formatting.py ............................................... [ 58%] 1032s ..... [ 58%] 1032s tests/test_formatting_html.py ........................ [ 58%] 1033s tests/test_groupby.py ......................s........................... [ 59%] 1034s ...............................ss....................................... [ 59%] 1035s ........................................................................ [ 59%] 1036s .............................................................sssssssss.. [ 60%] 1037s ..s..............sssssssssss............. [ 60%] 1037s tests/test_hashable.py ........ [ 60%] 1037s tests/test_indexes.py .................................................. [ 60%] 1037s ........................ [ 60%] 1037s tests/test_indexing.py ................................................. [ 60%] 1037s ........................................................................ [ 61%] 1037s ............... [ 61%] 1043s tests/test_interp.py ................................................... [ 61%] 1047s .x...................................................................... [ 61%] 1058s ................................................................sss..sss [ 62%] 1070s ..sss..sss..sss..sss..sss..sss............... [ 62%] 1070s tests/test_merge.py .................................................... [ 62%] 1070s ... [ 62%] 1072s tests/test_missing.py .................................................. [ 62%] 1073s ..................s...........................................x.. [ 63%] 1073s tests/test_namedarray.py ....x...........................s.............. [ 63%] 1073s .. [ 63%] 1073s tests/test_nputils.py .. [ 63%] 1073s tests/test_options.py ................... [ 63%] 1074s tests/test_pandas_to_xarray.py xxxxxxxxxxxxxxxxxxxxxxxsxxxxxx........... [ 63%] 1074s ....................... [ 63%] 1074s tests/test_parallelcompat.py ............... [ 63%] 1075s tests/test_plot.py ..................................................... [ 63%] 1076s ........................................................................ [ 64%] 1079s ........................................................................ [ 64%] 1082s ...............................................s........................ [ 64%] 1087s .............X.......................................................x.. [ 65%] 1099s ss.ssss................................................................. [ 65%] 1101s .......sss.............................................................. [ 65%] 1102s .......................................... [ 66%] 1102s tests/test_plugins.py ............. [ 66%] 1102s tests/test_print_versions.py . [ 66%] 1105s tests/test_rolling.py .................................................. [ 66%] 1107s ........................................................................ [ 66%] 1109s ........................................................................ [ 67%] 1110s ........................................................................ [ 67%] 1113s ........................................................................ [ 67%] 1114s ........................................................................ [ 68%] 1115s ........................................................................ [ 68%] 1115s ........................................................................ [ 68%] 1115s ........................................................................ [ 69%] 1115s ........................................................................ [ 69%] 1117s ........................................................................ [ 69%] 1120s ........................................................................ [ 70%] 1123s ........................................................................ [ 70%] 1125s ........................................................................ [ 70%] 1126s ........................................................................ [ 71%] 1126s ........................................................................ [ 71%] 1126s ........................................................................ [ 71%] 1127s ........................................................................ [ 72%] 1129s ........................................................................ [ 72%] 1132s ........................................................................ [ 72%] 1134s ........................................................................ [ 73%] 1135s ........................................................................ [ 73%] 1135s ........................................................................ [ 73%] 1135s ........................................................................ [ 74%] 1136s ........................................................................ [ 74%] 1139s ........................................................................ [ 74%] 1142s ........................................................................ [ 75%] 1145s ........................................................................ [ 75%] 1146s ........................................................................ [ 75%] 1146s ........................................................................ [ 76%] 1146s ........................................................................ [ 76%] 1151s ........................................................................ [ 76%] 1153s ...........ssssssssssssssssssssssssssssssssssssssssss................... [ 77%] 1154s ........................................................................ [ 77%] 1154s ........................................................................ [ 77%] 1154s ........................................................................ [ 78%] 1155s ........................................................................ [ 78%] 1155s ........................................................................ [ 78%] 1156s ........................................................ssssssssssssssss [ 78%] 1156s ........................................................................ [ 79%] 1156s ........................................................................ [ 79%] 1157s ........................................................................ [ 79%] 1158s ........................................................................ [ 80%] 1160s ........................................................................ [ 80%] 1164s ........................................................................ [ 80%] 1167s ssssssssssssssss........................................................ [ 81%] 1171s ........................................................................ [ 81%] 1174s ........................................................................ [ 81%] 1178s ........................................................................ [ 82%] 1184s ........................................................................ [ 82%] 1184s ........sss [ 82%] 1193s tests/test_strategies.py ..................... [ 82%] 1193s tests/test_treenode.py .................................. [ 82%] 1194s tests/test_tutorial.py XXss [ 82%] 1194s tests/test_typed_ops.py ..... [ 82%] 1194s tests/test_ufuncs.py ................................................... [ 83%] 1194s .......................................................................x [ 83%] 1194s .. [ 83%] 1195s tests/test_units.py .s..s..s..s......sssssxxxxx.....sssss.xxxx.....sssss [ 83%] 1197s xxxxx.....sssss.xxxx.....sssssxxxxx.....sssss.xxxx.....sssssxxxxx.....ss [ 84%] 1198s sss.xxxx.........sssss..........sssss..........sssss..........sssss..... [ 84%] 1198s .....sssss..........sssss..........sssss..........sssss..........sssss.. [ 84%] 1199s ........sssss..........sssss..........sssss......s..s..s..s..s..s..s..s. [ 85%] 1200s .sx.sx.sx.sx............................................................ [ 85%] 1200s ........................................................................ [ 85%] 1200s ...................ssssssssss..........ssssssssss....................... [ 86%] 1200s ........................................................................ [ 86%] 1200s ...................................ss..XX............ss..XX............. [ 86%] 1200s ........................................................................ [ 87%] 1201s .....................s..s..ss....ss......ss..s.......................ss. [ 87%] 1201s .s...................................................................... [ 87%] 1206s ....x....x......................xxxxx.....xxxxx.x.x.x.x.x.x.x.x.x.x..... [ 88%] 1207s .xxxx................................................................... [ 88%] 1208s ...............x...............sssss.....sssssssssssssss.....sssss.....s [ 88%] 1208s ssssssssssssss.....sssss..........sssss..................s..s..s..s.ssss [ 89%] 1208s ss.s..s..s..s..s..s..s..s.ssssss.s..s..s..s...........ssssssssssssssssss [ 89%] 1208s ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 89%] 1210s ........................................................xx..xx..ssssssss [ 90%] 1212s ssssssssssssxx..xx..ssssssssssssssssssss......ss....s......s..s.s.s.s.s. [ 90%] 1212s s...ss....ss....ss....ss....ss....ss....ss....ss...s..s..s.xs.sss.s..s.. [ 90%] 1213s s..s.xs.sss.s.....ss....ss....ss....ss....ss....ss....ss....ss.......sss [ 91%] 1213s ss..........sssss.......ss....ss........................................ [ 91%] 1214s ....................xxxx................................................ [ 91%] 1215s ..................................xx.....sssss.....sssss.....sssss.....s [ 92%] 1215s ssssssssssssss.....sssss.....sssssssssssssss.....sssss.....sssss........ [ 92%] 1216s .......sss...sssxx....s......s......ssssssssssssssssssssssssssssssssssss [ 92%] 1216s ssssssssssssssssssssssssssssssssssssssssssssssssssssss...sss......sss... [ 93%] 1217s ..................................................xx..xx..ssssssssssssss [ 93%] 1219s ssssssxx..xx..ssssssssssssssssssss............ssssssssssss.............. [ 93%] 1221s ..........ssssssssssss...............xx.ssssss...Xx....xx.ssssss...Xx..s [ 93%] 1221s ..s...........ssssssssss....................ssssssssss.................. [ 94%] 1222s s.....ssssssssssssss........s.............s.....ssssssssssssss........s. [ 94%] 1223s .........sssss..........sssss.......x.x.x.... [ 94%] 1223s tests/test_utils.py .................................................... [ 95%] 1223s .............. [ 95%] 1223s tests/test_variable.py ................................................. [ 95%] 1223s ........................................................................ [ 95%] 1223s ........................................................................ [ 96%] 1223s ........................................................................ [ 96%] 1224s ........................................................................ [ 96%] 1231s .................ssss...............x.xX.......xX.......xx.......xx..... [ 97%] 1232s ..xx.......s............................................................ [ 97%] 1232s ........................ssssssssssssssssssssssssssssssssssssssssssssssss [ 97%] 1232s sssssss..........................ssss....................... [ 97%] 1233s tests/test_weighted.py ................................................. [ 98%] 1233s ........................................................ssssssssssssssss [ 98%] 1233s ssssssssssssssssssssssssssssssssssssssssssssssssssssssss................ [ 98%] 1235s ........................................................................ [ 99%] 1236s ........................................................................ [ 99%] 1238s ........................................................................ [ 99%] 1240s ................................... [100%] 1240s 1240s =================================== FAILURES =================================== 1240s _________________ TestZarrDictStore.test_non_existent_store[2] _________________ 1240s 1240s self = 1240s 1240s def test_non_existent_store(self) -> None: 1240s with pytest.raises( 1240s FileNotFoundError, match="(No such file or directory|Unable to find group)" 1240s ): 1240s > xr.open_zarr(f"{uuid.uuid4()}") 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2346: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1240s ds = open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1608: in open_dataset 1240s store = ZarrStore.open_group( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:732: in open_group 1240s ) = _get_open_params( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1811: in _get_open_params 1240s zarr_root_group = zarr.open_consolidated(store, **open_kwargs) 1240s /usr/lib/python3/dist-packages/zarr/api/synchronous.py:231: in open_consolidated 1240s sync(async_api.open_consolidated(*args, use_consolidated=use_consolidated, **kwargs)) 1240s /usr/lib/python3/dist-packages/zarr/core/sync.py:163: in sync 1240s raise return_result 1240s /usr/lib/python3/dist-packages/zarr/core/sync.py:119: in _runner 1240s return await coro 1240s /usr/lib/python3/dist-packages/zarr/api/asynchronous.py:408: in open_consolidated 1240s return await open_group(*args, use_consolidated=use_consolidated, **kwargs) 1240s /usr/lib/python3/dist-packages/zarr/api/asynchronous.py:851: in open_group 1240s store_path = await make_store_path(store, mode=mode, storage_options=storage_options, path=path) 1240s /usr/lib/python3/dist-packages/zarr/storage/_common.py:418: in make_store_path 1240s store = await make_store(store_like, mode=mode, storage_options=storage_options) 1240s /usr/lib/python3/dist-packages/zarr/storage/_common.py:349: in make_store 1240s return await make_store(Path(store_like), mode=mode, storage_options=storage_options) 1240s /usr/lib/python3/dist-packages/zarr/storage/_common.py:339: in make_store 1240s return await LocalStore.open(root=store_like, mode=mode, read_only=_read_only) 1240s /usr/lib/python3/dist-packages/zarr/storage/_local.py:160: in open 1240s await store._open() 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = LocalStore('file:///tmp/autopkgtest.cdpOi4/autopkgtest_tmp/build/e4c0007f-1098-4ff0-84aa-eb15c74500cc') 1240s 1240s async def _open(self, *, mode: AccessModeLiteral | None = None) -> None: 1240s if not self.read_only: 1240s self.root.mkdir(parents=True, exist_ok=True) 1240s 1240s if not self.root.exists(): 1240s > raise FileNotFoundError(f"{self.root} does not exist") 1240s E FileNotFoundError: /tmp/autopkgtest.cdpOi4/autopkgtest_tmp/build/e4c0007f-1098-4ff0-84aa-eb15c74500cc does not exist 1240s 1240s /usr/lib/python3/dist-packages/zarr/storage/_local.py:172: FileNotFoundError 1240s 1240s During handling of the above exception, another exception occurred: 1240s 1240s self = 1240s 1240s def test_non_existent_store(self) -> None: 1240s > with pytest.raises( 1240s FileNotFoundError, match="(No such file or directory|Unable to find group)" 1240s ): 1240s E AssertionError: Regex pattern did not match. 1240s E Regex: '(No such file or directory|Unable to find group)' 1240s E Input: '/tmp/autopkgtest.cdpOi4/autopkgtest_tmp/build/e4c0007f-1098-4ff0-84aa-eb15c74500cc does not exist' 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2343: AssertionError 1240s ______________ TestZarrDirectoryStore.test_non_existent_store[2] _______________ 1240s 1240s self = 1240s 1240s def test_non_existent_store(self) -> None: 1240s with pytest.raises( 1240s FileNotFoundError, match="(No such file or directory|Unable to find group)" 1240s ): 1240s > xr.open_zarr(f"{uuid.uuid4()}") 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2346: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1240s ds = open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1608: in open_dataset 1240s store = ZarrStore.open_group( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:732: in open_group 1240s ) = _get_open_params( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1811: in _get_open_params 1240s zarr_root_group = zarr.open_consolidated(store, **open_kwargs) 1240s /usr/lib/python3/dist-packages/zarr/api/synchronous.py:231: in open_consolidated 1240s sync(async_api.open_consolidated(*args, use_consolidated=use_consolidated, **kwargs)) 1240s /usr/lib/python3/dist-packages/zarr/core/sync.py:163: in sync 1240s raise return_result 1240s /usr/lib/python3/dist-packages/zarr/core/sync.py:119: in _runner 1240s return await coro 1240s /usr/lib/python3/dist-packages/zarr/api/asynchronous.py:408: in open_consolidated 1240s return await open_group(*args, use_consolidated=use_consolidated, **kwargs) 1240s /usr/lib/python3/dist-packages/zarr/api/asynchronous.py:851: in open_group 1240s store_path = await make_store_path(store, mode=mode, storage_options=storage_options, path=path) 1240s /usr/lib/python3/dist-packages/zarr/storage/_common.py:418: in make_store_path 1240s store = await make_store(store_like, mode=mode, storage_options=storage_options) 1240s /usr/lib/python3/dist-packages/zarr/storage/_common.py:349: in make_store 1240s return await make_store(Path(store_like), mode=mode, storage_options=storage_options) 1240s /usr/lib/python3/dist-packages/zarr/storage/_common.py:339: in make_store 1240s return await LocalStore.open(root=store_like, mode=mode, read_only=_read_only) 1240s /usr/lib/python3/dist-packages/zarr/storage/_local.py:160: in open 1240s await store._open() 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = LocalStore('file:///tmp/autopkgtest.cdpOi4/autopkgtest_tmp/build/16fb36a3-f135-4814-a5b5-dd0f02ed5e26') 1240s 1240s async def _open(self, *, mode: AccessModeLiteral | None = None) -> None: 1240s if not self.read_only: 1240s self.root.mkdir(parents=True, exist_ok=True) 1240s 1240s if not self.root.exists(): 1240s > raise FileNotFoundError(f"{self.root} does not exist") 1240s E FileNotFoundError: /tmp/autopkgtest.cdpOi4/autopkgtest_tmp/build/16fb36a3-f135-4814-a5b5-dd0f02ed5e26 does not exist 1240s 1240s /usr/lib/python3/dist-packages/zarr/storage/_local.py:172: FileNotFoundError 1240s 1240s During handling of the above exception, another exception occurred: 1240s 1240s self = 1240s 1240s def test_non_existent_store(self) -> None: 1240s > with pytest.raises( 1240s FileNotFoundError, match="(No such file or directory|Unable to find group)" 1240s ): 1240s E AssertionError: Regex pattern did not match. 1240s E Regex: '(No such file or directory|Unable to find group)' 1240s E Input: '/tmp/autopkgtest.cdpOi4/autopkgtest_tmp/build/16fb36a3-f135-4814-a5b5-dd0f02ed5e26 does not exist' 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2343: AssertionError 1240s ________________ TestZarrWriteEmpty.test_non_existent_store[2] _________________ 1240s 1240s self = 1240s 1240s def test_non_existent_store(self) -> None: 1240s with pytest.raises( 1240s FileNotFoundError, match="(No such file or directory|Unable to find group)" 1240s ): 1240s > xr.open_zarr(f"{uuid.uuid4()}") 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2346: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1240s ds = open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1608: in open_dataset 1240s store = ZarrStore.open_group( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:732: in open_group 1240s ) = _get_open_params( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1811: in _get_open_params 1240s zarr_root_group = zarr.open_consolidated(store, **open_kwargs) 1240s /usr/lib/python3/dist-packages/zarr/api/synchronous.py:231: in open_consolidated 1240s sync(async_api.open_consolidated(*args, use_consolidated=use_consolidated, **kwargs)) 1240s /usr/lib/python3/dist-packages/zarr/core/sync.py:163: in sync 1240s raise return_result 1240s /usr/lib/python3/dist-packages/zarr/core/sync.py:119: in _runner 1240s return await coro 1240s /usr/lib/python3/dist-packages/zarr/api/asynchronous.py:408: in open_consolidated 1240s return await open_group(*args, use_consolidated=use_consolidated, **kwargs) 1240s /usr/lib/python3/dist-packages/zarr/api/asynchronous.py:851: in open_group 1240s store_path = await make_store_path(store, mode=mode, storage_options=storage_options, path=path) 1240s /usr/lib/python3/dist-packages/zarr/storage/_common.py:418: in make_store_path 1240s store = await make_store(store_like, mode=mode, storage_options=storage_options) 1240s /usr/lib/python3/dist-packages/zarr/storage/_common.py:349: in make_store 1240s return await make_store(Path(store_like), mode=mode, storage_options=storage_options) 1240s /usr/lib/python3/dist-packages/zarr/storage/_common.py:339: in make_store 1240s return await LocalStore.open(root=store_like, mode=mode, read_only=_read_only) 1240s /usr/lib/python3/dist-packages/zarr/storage/_local.py:160: in open 1240s await store._open() 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = LocalStore('file:///tmp/autopkgtest.cdpOi4/autopkgtest_tmp/build/52c3f656-136f-49f1-b287-2ca47c80f8cc') 1240s 1240s async def _open(self, *, mode: AccessModeLiteral | None = None) -> None: 1240s if not self.read_only: 1240s self.root.mkdir(parents=True, exist_ok=True) 1240s 1240s if not self.root.exists(): 1240s > raise FileNotFoundError(f"{self.root} does not exist") 1240s E FileNotFoundError: /tmp/autopkgtest.cdpOi4/autopkgtest_tmp/build/52c3f656-136f-49f1-b287-2ca47c80f8cc does not exist 1240s 1240s /usr/lib/python3/dist-packages/zarr/storage/_local.py:172: FileNotFoundError 1240s 1240s During handling of the above exception, another exception occurred: 1240s 1240s self = 1240s 1240s def test_non_existent_store(self) -> None: 1240s > with pytest.raises( 1240s FileNotFoundError, match="(No such file or directory|Unable to find group)" 1240s ): 1240s E AssertionError: Regex pattern did not match. 1240s E Regex: '(No such file or directory|Unable to find group)' 1240s E Input: '/tmp/autopkgtest.cdpOi4/autopkgtest_tmp/build/52c3f656-136f-49f1-b287-2ca47c80f8cc does not exist' 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2343: AssertionError 1240s _______________ TestZarrWriteEmpty.test_write_empty[2-True-True] _______________ 1240s 1240s self = 1240s consolidated = True, write_empty = True 1240s 1240s @pytest.mark.parametrize("consolidated", [True, False, None]) 1240s @pytest.mark.parametrize("write_empty", [True, False, None]) 1240s def test_write_empty( 1240s self, 1240s consolidated: bool | None, 1240s write_empty: bool | None, 1240s ) -> None: 1240s def assert_expected_files(expected: list[str], store: str) -> None: 1240s """Convenience for comparing with actual files written""" 1240s ls = [] 1240s test_root = os.path.join(store, "test") 1240s for root, _, files in os.walk(test_root): 1240s ls.extend( 1240s [ 1240s os.path.join(root, f).removeprefix(test_root).lstrip("/") 1240s for f in files 1240s ] 1240s ) 1240s 1240s assert set(expected) == set( 1240s [ 1240s file.lstrip("c/") 1240s for file in ls 1240s if (file not in (".zattrs", ".zarray", "zarr.json")) 1240s ] 1240s ) 1240s 1240s # The zarr format is set by the `default_zarr_format` 1240s # pytest fixture that acts on a superclass 1240s zarr_format_3 = has_zarr_v3 and zarr.config.config["default_zarr_format"] == 3 1240s if (write_empty is False) or (write_empty is None and has_zarr_v3): 1240s expected = ["0.1.0"] 1240s else: 1240s expected = [ 1240s "0.0.0", 1240s "0.0.1", 1240s "0.1.0", 1240s "0.1.1", 1240s ] 1240s 1240s if zarr_format_3: 1240s data = np.array([0.0, 0, 1.0, 0]).reshape((1, 2, 2)) 1240s # transform to the path style of zarr 3 1240s # e.g. 0/0/1 1240s expected = [e.replace(".", "/") for e in expected] 1240s else: 1240s # use nan for default fill_value behaviour 1240s data = np.array([np.nan, np.nan, 1.0, np.nan]).reshape((1, 2, 2)) 1240s 1240s ds = xr.Dataset(data_vars={"test": (("Z", "Y", "X"), data)}) 1240s 1240s if has_dask: 1240s ds["test"] = ds["test"].chunk(1) 1240s encoding = None 1240s else: 1240s encoding = {"test": {"chunks": (1, 1, 1)}} 1240s 1240s with self.temp_dir() as (d, store): 1240s ds.to_zarr( 1240s store, 1240s mode="w", 1240s encoding=encoding, 1240s write_empty_chunks=write_empty, 1240s ) 1240s 1240s # check expected files after a write 1240s assert_expected_files(expected, store) 1240s 1240s with self.roundtrip_dir( 1240s ds, 1240s store, 1240s save_kwargs={ 1240s "mode": "a", 1240s "append_dim": "Z", 1240s "write_empty_chunks": write_empty, 1240s }, 1240s ) as a_ds: 1240s expected_ds = xr.concat([ds, ds], dim="Z") 1240s 1240s assert_identical(a_ds, expected_ds.compute()) 1240s # add the new files we expect to be created by the append 1240s # that was performed by the roundtrip_dir 1240s if (write_empty is False) or (write_empty is None and has_zarr_v3): 1240s expected.append("1.1.0") 1240s else: 1240s if not has_zarr_v3: 1240s # TODO: remove zarr3 if once zarr issue is fixed 1240s # https://github.com/zarr-developers/zarr-python/issues/2931 1240s expected.extend( 1240s [ 1240s "1.1.0", 1240s "1.0.0", 1240s "1.0.1", 1240s "1.1.1", 1240s ] 1240s ) 1240s else: 1240s expected.append("1.1.0") 1240s if zarr_format_3: 1240s expected = [e.replace(".", "/") for e in expected] 1240s > assert_expected_files(expected, store) 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3793: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s expected = ['0.0.0', '0.0.1', '0.1.0', '0.1.1', '1.1.0'] 1240s store = '/tmp/tmpqtzdilu2/test.zarr' 1240s 1240s def assert_expected_files(expected: list[str], store: str) -> None: 1240s """Convenience for comparing with actual files written""" 1240s ls = [] 1240s test_root = os.path.join(store, "test") 1240s for root, _, files in os.walk(test_root): 1240s ls.extend( 1240s [ 1240s os.path.join(root, f).removeprefix(test_root).lstrip("/") 1240s for f in files 1240s ] 1240s ) 1240s 1240s > assert set(expected) == set( 1240s [ 1240s file.lstrip("c/") 1240s for file in ls 1240s if (file not in (".zattrs", ".zarray", "zarr.json")) 1240s ] 1240s ) 1240s E AssertionError: assert {'0.0.0', '0....1.1', '1.1.0'} == {'0.0.0', '0.... '1.0.1', ...} 1240s E 1240s E Extra items in the right set: 1240s E '1.0.1' 1240s E '1.1.1' 1240s E '1.0.0' 1240s E Use -v to get more diff 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3712: AssertionError 1240s ______________ TestZarrWriteEmpty.test_write_empty[2-True-False] _______________ 1240s 1240s self = 1240s consolidated = False, write_empty = True 1240s 1240s @pytest.mark.parametrize("consolidated", [True, False, None]) 1240s @pytest.mark.parametrize("write_empty", [True, False, None]) 1240s def test_write_empty( 1240s self, 1240s consolidated: bool | None, 1240s write_empty: bool | None, 1240s ) -> None: 1240s def assert_expected_files(expected: list[str], store: str) -> None: 1240s """Convenience for comparing with actual files written""" 1240s ls = [] 1240s test_root = os.path.join(store, "test") 1240s for root, _, files in os.walk(test_root): 1240s ls.extend( 1240s [ 1240s os.path.join(root, f).removeprefix(test_root).lstrip("/") 1240s for f in files 1240s ] 1240s ) 1240s 1240s assert set(expected) == set( 1240s [ 1240s file.lstrip("c/") 1240s for file in ls 1240s if (file not in (".zattrs", ".zarray", "zarr.json")) 1240s ] 1240s ) 1240s 1240s # The zarr format is set by the `default_zarr_format` 1240s # pytest fixture that acts on a superclass 1240s zarr_format_3 = has_zarr_v3 and zarr.config.config["default_zarr_format"] == 3 1240s if (write_empty is False) or (write_empty is None and has_zarr_v3): 1240s expected = ["0.1.0"] 1240s else: 1240s expected = [ 1240s "0.0.0", 1240s "0.0.1", 1240s "0.1.0", 1240s "0.1.1", 1240s ] 1240s 1240s if zarr_format_3: 1240s data = np.array([0.0, 0, 1.0, 0]).reshape((1, 2, 2)) 1240s # transform to the path style of zarr 3 1240s # e.g. 0/0/1 1240s expected = [e.replace(".", "/") for e in expected] 1240s else: 1240s # use nan for default fill_value behaviour 1240s data = np.array([np.nan, np.nan, 1.0, np.nan]).reshape((1, 2, 2)) 1240s 1240s ds = xr.Dataset(data_vars={"test": (("Z", "Y", "X"), data)}) 1240s 1240s if has_dask: 1240s ds["test"] = ds["test"].chunk(1) 1240s encoding = None 1240s else: 1240s encoding = {"test": {"chunks": (1, 1, 1)}} 1240s 1240s with self.temp_dir() as (d, store): 1240s ds.to_zarr( 1240s store, 1240s mode="w", 1240s encoding=encoding, 1240s write_empty_chunks=write_empty, 1240s ) 1240s 1240s # check expected files after a write 1240s assert_expected_files(expected, store) 1240s 1240s with self.roundtrip_dir( 1240s ds, 1240s store, 1240s save_kwargs={ 1240s "mode": "a", 1240s "append_dim": "Z", 1240s "write_empty_chunks": write_empty, 1240s }, 1240s ) as a_ds: 1240s expected_ds = xr.concat([ds, ds], dim="Z") 1240s 1240s assert_identical(a_ds, expected_ds.compute()) 1240s # add the new files we expect to be created by the append 1240s # that was performed by the roundtrip_dir 1240s if (write_empty is False) or (write_empty is None and has_zarr_v3): 1240s expected.append("1.1.0") 1240s else: 1240s if not has_zarr_v3: 1240s # TODO: remove zarr3 if once zarr issue is fixed 1240s # https://github.com/zarr-developers/zarr-python/issues/2931 1240s expected.extend( 1240s [ 1240s "1.1.0", 1240s "1.0.0", 1240s "1.0.1", 1240s "1.1.1", 1240s ] 1240s ) 1240s else: 1240s expected.append("1.1.0") 1240s if zarr_format_3: 1240s expected = [e.replace(".", "/") for e in expected] 1240s > assert_expected_files(expected, store) 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3793: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s expected = ['0.0.0', '0.0.1', '0.1.0', '0.1.1', '1.1.0'] 1240s store = '/tmp/tmpipreszy3/test.zarr' 1240s 1240s def assert_expected_files(expected: list[str], store: str) -> None: 1240s """Convenience for comparing with actual files written""" 1240s ls = [] 1240s test_root = os.path.join(store, "test") 1240s for root, _, files in os.walk(test_root): 1240s ls.extend( 1240s [ 1240s os.path.join(root, f).removeprefix(test_root).lstrip("/") 1240s for f in files 1240s ] 1240s ) 1240s 1240s > assert set(expected) == set( 1240s [ 1240s file.lstrip("c/") 1240s for file in ls 1240s if (file not in (".zattrs", ".zarray", "zarr.json")) 1240s ] 1240s ) 1240s E AssertionError: assert {'0.0.0', '0....1.1', '1.1.0'} == {'0.0.0', '0.... '1.0.1', ...} 1240s E 1240s E Extra items in the right set: 1240s E '1.0.1' 1240s E '1.1.1' 1240s E '1.0.0' 1240s E Use -v to get more diff 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3712: AssertionError 1240s _______________ TestZarrWriteEmpty.test_write_empty[2-True-None] _______________ 1240s 1240s self = 1240s consolidated = None, write_empty = True 1240s 1240s @pytest.mark.parametrize("consolidated", [True, False, None]) 1240s @pytest.mark.parametrize("write_empty", [True, False, None]) 1240s def test_write_empty( 1240s self, 1240s consolidated: bool | None, 1240s write_empty: bool | None, 1240s ) -> None: 1240s def assert_expected_files(expected: list[str], store: str) -> None: 1240s """Convenience for comparing with actual files written""" 1240s ls = [] 1240s test_root = os.path.join(store, "test") 1240s for root, _, files in os.walk(test_root): 1240s ls.extend( 1240s [ 1240s os.path.join(root, f).removeprefix(test_root).lstrip("/") 1240s for f in files 1240s ] 1240s ) 1240s 1240s assert set(expected) == set( 1240s [ 1240s file.lstrip("c/") 1240s for file in ls 1240s if (file not in (".zattrs", ".zarray", "zarr.json")) 1240s ] 1240s ) 1240s 1240s # The zarr format is set by the `default_zarr_format` 1240s # pytest fixture that acts on a superclass 1240s zarr_format_3 = has_zarr_v3 and zarr.config.config["default_zarr_format"] == 3 1240s if (write_empty is False) or (write_empty is None and has_zarr_v3): 1240s expected = ["0.1.0"] 1240s else: 1240s expected = [ 1240s "0.0.0", 1240s "0.0.1", 1240s "0.1.0", 1240s "0.1.1", 1240s ] 1240s 1240s if zarr_format_3: 1240s data = np.array([0.0, 0, 1.0, 0]).reshape((1, 2, 2)) 1240s # transform to the path style of zarr 3 1240s # e.g. 0/0/1 1240s expected = [e.replace(".", "/") for e in expected] 1240s else: 1240s # use nan for default fill_value behaviour 1240s data = np.array([np.nan, np.nan, 1.0, np.nan]).reshape((1, 2, 2)) 1240s 1240s ds = xr.Dataset(data_vars={"test": (("Z", "Y", "X"), data)}) 1240s 1240s if has_dask: 1240s ds["test"] = ds["test"].chunk(1) 1240s encoding = None 1240s else: 1240s encoding = {"test": {"chunks": (1, 1, 1)}} 1240s 1240s with self.temp_dir() as (d, store): 1240s ds.to_zarr( 1240s store, 1240s mode="w", 1240s encoding=encoding, 1240s write_empty_chunks=write_empty, 1240s ) 1240s 1240s # check expected files after a write 1240s assert_expected_files(expected, store) 1240s 1240s with self.roundtrip_dir( 1240s ds, 1240s store, 1240s save_kwargs={ 1240s "mode": "a", 1240s "append_dim": "Z", 1240s "write_empty_chunks": write_empty, 1240s }, 1240s ) as a_ds: 1240s expected_ds = xr.concat([ds, ds], dim="Z") 1240s 1240s assert_identical(a_ds, expected_ds.compute()) 1240s # add the new files we expect to be created by the append 1240s # that was performed by the roundtrip_dir 1240s if (write_empty is False) or (write_empty is None and has_zarr_v3): 1240s expected.append("1.1.0") 1240s else: 1240s if not has_zarr_v3: 1240s # TODO: remove zarr3 if once zarr issue is fixed 1240s # https://github.com/zarr-developers/zarr-python/issues/2931 1240s expected.extend( 1240s [ 1240s "1.1.0", 1240s "1.0.0", 1240s "1.0.1", 1240s "1.1.1", 1240s ] 1240s ) 1240s else: 1240s expected.append("1.1.0") 1240s if zarr_format_3: 1240s expected = [e.replace(".", "/") for e in expected] 1240s > assert_expected_files(expected, store) 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3793: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s expected = ['0.0.0', '0.0.1', '0.1.0', '0.1.1', '1.1.0'] 1240s store = '/tmp/tmp957zya8l/test.zarr' 1240s 1240s def assert_expected_files(expected: list[str], store: str) -> None: 1240s """Convenience for comparing with actual files written""" 1240s ls = [] 1240s test_root = os.path.join(store, "test") 1240s for root, _, files in os.walk(test_root): 1240s ls.extend( 1240s [ 1240s os.path.join(root, f).removeprefix(test_root).lstrip("/") 1240s for f in files 1240s ] 1240s ) 1240s 1240s > assert set(expected) == set( 1240s [ 1240s file.lstrip("c/") 1240s for file in ls 1240s if (file not in (".zattrs", ".zarray", "zarr.json")) 1240s ] 1240s ) 1240s E AssertionError: assert {'0.0.0', '0....1.1', '1.1.0'} == {'0.0.0', '0.... '1.0.1', ...} 1240s E 1240s E Extra items in the right set: 1240s E '1.0.1' 1240s E '1.1.1' 1240s E '1.0.0' 1240s E Use -v to get more diff 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3712: AssertionError 1240s _____________ TestZarrDictStore.test_zero_dimensional_variable[3] ______________ 1240s 1240s self = 1240s 1240s def test_zero_dimensional_variable(self) -> None: 1240s expected = create_test_data() 1240s expected["float_var"] = ([], 1.0e9, {"units": "units of awesome"}) 1240s expected["bytes_var"] = ([], b"foobar") 1240s expected["string_var"] = ([], "foobar") 1240s > with self.roundtrip(expected) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:408: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1240s with self.open(store_target, **open_kwargs) as ds: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'dim2' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s ____________________ TestZarrDictStore.test_write_store[3] _____________________ 1240s 1240s self = 1240s 1240s def test_write_store(self) -> None: 1240s expected = create_test_data() 1240s with self.create_store() as store: 1240s expected.dump_to_store(store) 1240s # we need to cf decode the store because it has time and 1240s # non-dimension coordinates 1240s > with xr.decode_cf(store) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:417: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/conventions.py:570: in decode_cf 1240s vars, attrs = obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'dim2' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s ________________ TestZarrDictStore.test_roundtrip_test_data[3] _________________ 1240s 1240s self = 1240s 1240s def test_roundtrip_test_data(self) -> None: 1240s expected = create_test_data() 1240s > with self.roundtrip(expected) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:441: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1240s with self.open(store_target, **open_kwargs) as ds: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'dim2' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s ________________________ TestZarrDictStore.test_load[3] ________________________ 1240s 1240s self = 1240s 1240s def test_load(self) -> None: 1240s expected = create_test_data() 1240s 1240s @contextlib.contextmanager 1240s def assert_loads(vars=None): 1240s if vars is None: 1240s vars = expected 1240s with self.roundtrip(expected) as actual: 1240s for k, v in actual.variables.items(): 1240s # IndexVariables are eagerly loaded into memory 1240s assert v._in_memory == (k in actual.dims) 1240s yield actual 1240s for k, v in actual.variables.items(): 1240s if k in vars: 1240s assert v._in_memory 1240s assert_identical(expected, actual) 1240s 1240s with pytest.raises(AssertionError): 1240s # make sure the contextmanager works! 1240s > with assert_loads() as ds: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:464: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:452: in assert_loads 1240s with self.roundtrip(expected) as actual: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1240s with self.open(store_target, **open_kwargs) as ds: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'dim2' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s __________________ TestZarrDictStore.test_dataset_compute[3] ___________________ 1240s 1240s self = 1240s 1240s def test_dataset_compute(self) -> None: 1240s expected = create_test_data() 1240s 1240s > with self.roundtrip(expected) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:481: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1240s with self.open(store_target, **open_kwargs) as ds: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'dim2' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s _______________ TestZarrDictStore.test_roundtrip_object_dtype[3] _______________ 1240s 1240s self = 1240s 1240s def test_roundtrip_object_dtype(self) -> None: 1240s floats = np.array([0.0, 0.0, 1.0, 2.0, 3.0], dtype=object) 1240s floats_nans = np.array([np.nan, np.nan, 1.0, 2.0, 3.0], dtype=object) 1240s bytes_ = np.array([b"ab", b"cdef", b"g"], dtype=object) 1240s bytes_nans = np.array([b"ab", b"cdef", np.nan], dtype=object) 1240s strings = np.array(["ab", "cdef", "g"], dtype=object) 1240s strings_nans = np.array(["ab", "cdef", np.nan], dtype=object) 1240s all_nans = np.array([np.nan, np.nan], dtype=object) 1240s original = Dataset( 1240s { 1240s "floats": ("a", floats), 1240s "floats_nans": ("a", floats_nans), 1240s "bytes": ("b", bytes_), 1240s "bytes_nans": ("b", bytes_nans), 1240s "strings": ("b", strings), 1240s "strings_nans": ("b", strings_nans), 1240s "all_nans": ("c", all_nans), 1240s "nan": ([], np.nan), 1240s } 1240s ) 1240s expected = original.copy(deep=True) 1240s > with self.roundtrip(original) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:558: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1240s with self.open(store_target, **open_kwargs) as ds: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'nan' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s _______________ TestZarrDictStore.test_roundtrip_float64_data[3] _______________ 1240s 1240s self = 1240s 1240s def test_roundtrip_float64_data(self) -> None: 1240s expected = Dataset({"x": ("y", np.array([1.0, 2.0, np.pi], dtype="float64"))}) 1240s > with self.roundtrip(expected) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:646: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1240s with self.open(store_target, **open_kwargs) as ds: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'x' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s ________________ TestZarrDictStore.test_orthogonal_indexing[3] _________________ 1240s 1240s self = 1240s 1240s def test_orthogonal_indexing(self) -> None: 1240s in_memory = create_test_data() 1240s > with self.roundtrip(in_memory) as on_disk: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:713: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1240s with self.open(store_target, **open_kwargs) as ds: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'dim2' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s ________________ TestZarrDictStore.test_vectorized_indexing[3] _________________ 1240s 1240s self = 1240s 1240s def test_vectorized_indexing(self) -> None: 1240s in_memory = create_test_data() 1240s > with self.roundtrip(in_memory) as on_disk: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:727: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1240s with self.open(store_target, **open_kwargs) as ds: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'dim2' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s _________ TestZarrDictStore.test_vectorized_indexing_negative_step[3] __________ 1240s 1240s self = 1240s 1240s def test_vectorized_indexing_negative_step(self) -> None: 1240s # use dask explicitly when present 1240s open_kwargs: dict[str, Any] | None 1240s if has_dask: 1240s open_kwargs = {"chunks": {}} 1240s else: 1240s open_kwargs = None 1240s in_memory = create_test_data() 1240s 1240s def multiple_indexing(indexers): 1240s # make sure a sequence of lazy indexings certainly works. 1240s with self.roundtrip(in_memory, open_kwargs=open_kwargs) as on_disk: 1240s actual = on_disk["var3"] 1240s expected = in_memory["var3"] 1240s for ind in indexers: 1240s actual = actual.isel(ind) 1240s expected = expected.isel(ind) 1240s # make sure the array is not yet loaded into memory 1240s assert not actual.variable._in_memory 1240s assert_identical(expected, actual.load()) 1240s 1240s # with negative step slice. 1240s indexers = [ 1240s { 1240s "dim1": DataArray([[0, 7], [2, 6], [3, 5]], dims=["a", "b"]), 1240s "dim3": slice(-1, 1, -1), 1240s } 1240s ] 1240s > multiple_indexing(indexers) 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:817: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:800: in multiple_indexing 1240s with self.roundtrip(in_memory, open_kwargs=open_kwargs) as on_disk: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1240s with self.open(store_target, **open_kwargs) as ds: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'dim2' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s ______________ TestZarrDictStore.test_outer_indexing_reversed[3] _______________ 1240s 1240s self = 1240s 1240s def test_outer_indexing_reversed(self) -> None: 1240s # regression test for GH6560 1240s ds = xr.Dataset( 1240s {"z": (("t", "p", "y", "x"), np.ones((1, 1, 31, 40)))}, 1240s ) 1240s 1240s > with self.roundtrip(ds) as on_disk: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:834: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1240s with self.open(store_target, **open_kwargs) as ds: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'z' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s ___________________ TestZarrDictStore.test_isel_dataarray[3] ___________________ 1240s 1240s self = 1240s 1240s def test_isel_dataarray(self) -> None: 1240s # Make sure isel works lazily. GH:issue:1688 1240s in_memory = create_test_data() 1240s > with self.roundtrip(in_memory) as on_disk: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:841: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1240s with self.open(store_target, **open_kwargs) as ds: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'dim2' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s _____________ TestZarrDictStore.test_array_type_after_indexing[3] ______________ 1240s 1240s self = 1240s 1240s def test_array_type_after_indexing(self) -> None: 1240s in_memory = create_test_data() 1240s > with self.roundtrip(in_memory) as on_disk: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:868: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1240s with self.open(store_target, **open_kwargs) as ds: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'dim2' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s _______________________ TestZarrDictStore.test_dropna[3] _______________________ 1240s 1240s self = 1240s 1240s def test_dropna(self) -> None: 1240s # regression test for GH:issue:1694 1240s a = np.random.randn(4, 3) 1240s a[1, 1] = np.nan 1240s in_memory = xr.Dataset( 1240s {"a": (("y", "x"), a)}, coords={"y": np.arange(4), "x": np.arange(3)} 1240s ) 1240s 1240s assert_identical( 1240s in_memory.dropna(dim="x"), in_memory.isel(x=slice(None, None, 2)) 1240s ) 1240s 1240s > with self.roundtrip(in_memory) as on_disk: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:893: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1240s with self.open(store_target, **open_kwargs) as ds: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'a' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s _________________ TestZarrDictStore.test_ondisk_after_print[3] _________________ 1240s 1240s self = 1240s 1240s def test_ondisk_after_print(self) -> None: 1240s """Make sure print does not load file into memory""" 1240s in_memory = create_test_data() 1240s > with self.roundtrip(in_memory) as on_disk: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:902: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1240s with self.open(store_target, **open_kwargs) as ds: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'dim2' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s __________ TestZarrDictStore.test_roundtrip_bytes_with_fill_value[3] ___________ 1240s 1240s self = 1240s 1240s def test_roundtrip_bytes_with_fill_value(self) -> None: 1240s values = np.array([b"ab", b"cdef", np.nan], dtype=object) 1240s encoding = {"_FillValue": b"X", "dtype": "S1"} 1240s original = Dataset({"x": ("t", values, {}, encoding)}) 1240s expected = original.copy(deep=True) 1240s > with self.roundtrip(original) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:913: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1240s with self.open(store_target, **open_kwargs) as ds: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'x' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'NullTerminatedBytes' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s ________ TestZarrDictStore.test_roundtrip_unsigned[3-fill_value0-False] ________ 1240s 1240s self = 1240s fill_value = np.int8(-1), exp_fill_warning = False 1240s 1240s @pytest.mark.parametrize( 1240s ("fill_value", "exp_fill_warning"), 1240s [ 1240s (np.int8(-1), False), 1240s (np.uint8(255), True), 1240s (-1, False), 1240s (255, True), 1240s ], 1240s ) 1240s def test_roundtrip_unsigned(self, fill_value, exp_fill_warning): 1240s @contextlib.contextmanager 1240s def _roundtrip_with_warnings(*args, **kwargs): 1240s is_np2 = module_available("numpy", minversion="2.0.0.dev0") 1240s if exp_fill_warning and is_np2: 1240s warn_checker: contextlib.AbstractContextManager = pytest.warns( 1240s SerializationWarning, 1240s match="_FillValue attribute can't be represented", 1240s ) 1240s else: 1240s warn_checker = contextlib.nullcontext() 1240s with warn_checker: 1240s with self.roundtrip(*args, **kwargs) as actual: 1240s yield actual 1240s 1240s # regression/numpy2 test for 1240s encoding = { 1240s "_FillValue": fill_value, 1240s "_Unsigned": "true", 1240s "dtype": "i1", 1240s } 1240s x = np.array([0, 1, 127, 128, 254, np.nan], dtype=np.float32) 1240s decoded = Dataset({"x": ("t", x, {}, encoding)}) 1240s 1240s attributes = { 1240s "_FillValue": fill_value, 1240s "_Unsigned": "true", 1240s } 1240s # Create unsigned data corresponding to [0, 1, 127, 128, 255] unsigned 1240s sb = np.asarray([0, 1, 127, -128, -2, -1], dtype="i1") 1240s encoded = Dataset({"x": ("t", sb, attributes)}) 1240s unsigned_dtype = np.dtype(f"u{sb.dtype.itemsize}") 1240s 1240s > with _roundtrip_with_warnings(decoded) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1066: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1045: in _roundtrip_with_warnings 1240s with self.roundtrip(*args, **kwargs) as actual: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1240s with self.open(store_target, **open_kwargs) as ds: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'x' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Int8' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s ________ TestZarrDictStore.test_roundtrip_unsigned[3-fill_value1-True] _________ 1240s 1240s self = 1240s fill_value = np.uint8(255), exp_fill_warning = True 1240s 1240s @pytest.mark.parametrize( 1240s ("fill_value", "exp_fill_warning"), 1240s [ 1240s (np.int8(-1), False), 1240s (np.uint8(255), True), 1240s (-1, False), 1240s (255, True), 1240s ], 1240s ) 1240s def test_roundtrip_unsigned(self, fill_value, exp_fill_warning): 1240s @contextlib.contextmanager 1240s def _roundtrip_with_warnings(*args, **kwargs): 1240s is_np2 = module_available("numpy", minversion="2.0.0.dev0") 1240s if exp_fill_warning and is_np2: 1240s warn_checker: contextlib.AbstractContextManager = pytest.warns( 1240s SerializationWarning, 1240s match="_FillValue attribute can't be represented", 1240s ) 1240s else: 1240s warn_checker = contextlib.nullcontext() 1240s with warn_checker: 1240s with self.roundtrip(*args, **kwargs) as actual: 1240s yield actual 1240s 1240s # regression/numpy2 test for 1240s encoding = { 1240s "_FillValue": fill_value, 1240s "_Unsigned": "true", 1240s "dtype": "i1", 1240s } 1240s x = np.array([0, 1, 127, 128, 254, np.nan], dtype=np.float32) 1240s decoded = Dataset({"x": ("t", x, {}, encoding)}) 1240s 1240s attributes = { 1240s "_FillValue": fill_value, 1240s "_Unsigned": "true", 1240s } 1240s # Create unsigned data corresponding to [0, 1, 127, 128, 255] unsigned 1240s sb = np.asarray([0, 1, 127, -128, -2, -1], dtype="i1") 1240s encoded = Dataset({"x": ("t", sb, attributes)}) 1240s unsigned_dtype = np.dtype(f"u{sb.dtype.itemsize}") 1240s 1240s > with _roundtrip_with_warnings(decoded) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1066: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1045: in _roundtrip_with_warnings 1240s with self.roundtrip(*args, **kwargs) as actual: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1240s with self.open(store_target, **open_kwargs) as ds: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'x' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Int8' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s ____________ TestZarrDictStore.test_roundtrip_unsigned[3--1-False] _____________ 1240s 1240s self = 1240s fill_value = -1, exp_fill_warning = False 1240s 1240s @pytest.mark.parametrize( 1240s ("fill_value", "exp_fill_warning"), 1240s [ 1240s (np.int8(-1), False), 1240s (np.uint8(255), True), 1240s (-1, False), 1240s (255, True), 1240s ], 1240s ) 1240s def test_roundtrip_unsigned(self, fill_value, exp_fill_warning): 1240s @contextlib.contextmanager 1240s def _roundtrip_with_warnings(*args, **kwargs): 1240s is_np2 = module_available("numpy", minversion="2.0.0.dev0") 1240s if exp_fill_warning and is_np2: 1240s warn_checker: contextlib.AbstractContextManager = pytest.warns( 1240s SerializationWarning, 1240s match="_FillValue attribute can't be represented", 1240s ) 1240s else: 1240s warn_checker = contextlib.nullcontext() 1240s with warn_checker: 1240s with self.roundtrip(*args, **kwargs) as actual: 1240s yield actual 1240s 1240s # regression/numpy2 test for 1240s encoding = { 1240s "_FillValue": fill_value, 1240s "_Unsigned": "true", 1240s "dtype": "i1", 1240s } 1240s x = np.array([0, 1, 127, 128, 254, np.nan], dtype=np.float32) 1240s decoded = Dataset({"x": ("t", x, {}, encoding)}) 1240s 1240s attributes = { 1240s "_FillValue": fill_value, 1240s "_Unsigned": "true", 1240s } 1240s # Create unsigned data corresponding to [0, 1, 127, 128, 255] unsigned 1240s sb = np.asarray([0, 1, 127, -128, -2, -1], dtype="i1") 1240s encoded = Dataset({"x": ("t", sb, attributes)}) 1240s unsigned_dtype = np.dtype(f"u{sb.dtype.itemsize}") 1240s 1240s > with _roundtrip_with_warnings(decoded) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1066: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1045: in _roundtrip_with_warnings 1240s with self.roundtrip(*args, **kwargs) as actual: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1240s with self.open(store_target, **open_kwargs) as ds: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'x' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Int8' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s ____________ TestZarrDictStore.test_roundtrip_unsigned[3-255-True] _____________ 1240s 1240s self = 1240s fill_value = 255, exp_fill_warning = True 1240s 1240s @pytest.mark.parametrize( 1240s ("fill_value", "exp_fill_warning"), 1240s [ 1240s (np.int8(-1), False), 1240s (np.uint8(255), True), 1240s (-1, False), 1240s (255, True), 1240s ], 1240s ) 1240s def test_roundtrip_unsigned(self, fill_value, exp_fill_warning): 1240s @contextlib.contextmanager 1240s def _roundtrip_with_warnings(*args, **kwargs): 1240s is_np2 = module_available("numpy", minversion="2.0.0.dev0") 1240s if exp_fill_warning and is_np2: 1240s warn_checker: contextlib.AbstractContextManager = pytest.warns( 1240s SerializationWarning, 1240s match="_FillValue attribute can't be represented", 1240s ) 1240s else: 1240s warn_checker = contextlib.nullcontext() 1240s with warn_checker: 1240s with self.roundtrip(*args, **kwargs) as actual: 1240s yield actual 1240s 1240s # regression/numpy2 test for 1240s encoding = { 1240s "_FillValue": fill_value, 1240s "_Unsigned": "true", 1240s "dtype": "i1", 1240s } 1240s x = np.array([0, 1, 127, 128, 254, np.nan], dtype=np.float32) 1240s decoded = Dataset({"x": ("t", x, {}, encoding)}) 1240s 1240s attributes = { 1240s "_FillValue": fill_value, 1240s "_Unsigned": "true", 1240s } 1240s # Create unsigned data corresponding to [0, 1, 127, 128, 255] unsigned 1240s sb = np.asarray([0, 1, 127, -128, -2, -1], dtype="i1") 1240s encoded = Dataset({"x": ("t", sb, attributes)}) 1240s unsigned_dtype = np.dtype(f"u{sb.dtype.itemsize}") 1240s 1240s > with _roundtrip_with_warnings(decoded) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1066: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1045: in _roundtrip_with_warnings 1240s with self.roundtrip(*args, **kwargs) as actual: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1240s with self.open(store_target, **open_kwargs) as ds: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'x' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Int8' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s _ TestZarrDictStore.test_grid_mapping_and_bounds_are_not_coordinates_in_file[3] _ 1240s 1240s self = 1240s 1240s def test_grid_mapping_and_bounds_are_not_coordinates_in_file(self) -> None: 1240s original = self._create_cf_dataset() 1240s > with self.roundtrip(original, open_kwargs={"decode_coords": False}) as ds: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1142: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1240s with self.open(store_target, **open_kwargs) as ds: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = 1240s name = 'det_lim' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s ____ TestZarrDictStore.test_coordinate_variables_after_dataset_roundtrip[3] ____ 1240s 1240s self = 1240s 1240s def test_coordinate_variables_after_dataset_roundtrip(self) -> None: 1240s original = self._create_cf_dataset() 1240s > with self.roundtrip(original, open_kwargs={"decode_coords": "all"}) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1150: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1240s with self.open(store_target, **open_kwargs) as ds: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = 1240s name = 'det_lim' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s _ TestZarrDictStore.test_grid_mapping_and_bounds_are_coordinates_after_dataarray_roundtrip[3] _ 1240s 1240s self = 1240s 1240s def test_grid_mapping_and_bounds_are_coordinates_after_dataarray_roundtrip( 1240s self, 1240s ) -> None: 1240s original = self._create_cf_dataset() 1240s # The DataArray roundtrip should have the same warnings as the 1240s # Dataset, but we already tested for those, so just go for the 1240s # new warnings. It would appear that there is no way to tell 1240s # pytest "This warning and also this warning should both be 1240s # present". 1240s # xarray/tests/test_conventions.py::TestCFEncodedDataStore 1240s # needs the to_dataset. The other backends should be fine 1240s # without it. 1240s with pytest.warns( 1240s UserWarning, 1240s match=( 1240s r"Variable\(s\) referenced in bounds not in variables: " 1240s r"\['l(at|ong)itude_bnds'\]" 1240s ), 1240s ): 1240s > with self.roundtrip( 1240s original["variable"].to_dataset(), open_kwargs={"decode_coords": "all"} 1240s ) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1182: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1240s with self.open(store_target, **open_kwargs) as ds: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'ln_p' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s 1240s During handling of the above exception, another exception occurred: 1240s 1240s self = 1240s 1240s def test_grid_mapping_and_bounds_are_coordinates_after_dataarray_roundtrip( 1240s self, 1240s ) -> None: 1240s original = self._create_cf_dataset() 1240s # The DataArray roundtrip should have the same warnings as the 1240s # Dataset, but we already tested for those, so just go for the 1240s # new warnings. It would appear that there is no way to tell 1240s # pytest "This warning and also this warning should both be 1240s # present". 1240s # xarray/tests/test_conventions.py::TestCFEncodedDataStore 1240s # needs the to_dataset. The other backends should be fine 1240s # without it. 1240s > with pytest.warns( 1240s UserWarning, 1240s match=( 1240s r"Variable\(s\) referenced in bounds not in variables: " 1240s r"\['l(at|ong)itude_bnds'\]" 1240s ), 1240s ): 1240s E Failed: DID NOT WARN. No warnings of type (,) matching the regex were emitted. 1240s E Regex: Variable\(s\) referenced in bounds not in variables: \['l(at|ong)itude_bnds'\] 1240s E Emitted warnings: [ ZarrUserWarning('Consolidated metadata is currently not part in the Zarr format 3 specification. It may not be supported by other zarr implementations and may change in the future.')]. 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1175: Failed 1240s ___________________ TestZarrDictStore.test_encoding_kwarg[3] ___________________ 1240s 1240s self = 1240s 1240s def test_encoding_kwarg(self) -> None: 1240s ds = Dataset({"x": ("y", np.arange(10.0))}) 1240s 1240s kwargs: dict[str, Any] = dict(encoding={"x": {"dtype": "f4"}}) 1240s > with self.roundtrip(ds, save_kwargs=kwargs) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1277: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1240s with self.open(store_target, **open_kwargs) as ds: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'x' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float32' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s _________________ TestZarrDictStore.test_default_fill_value[3] _________________ 1240s 1240s self = 1240s 1240s def test_default_fill_value(self) -> None: 1240s # Test default encoding for float: 1240s ds = Dataset({"x": ("y", np.arange(10.0))}) 1240s kwargs = dict(encoding={"x": {"dtype": "f4"}}) 1240s > with self.roundtrip(ds, save_kwargs=kwargs) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1319: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1240s with self.open(store_target, **open_kwargs) as ds: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'x' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float32' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s ________ TestZarrDictStore.test_explicitly_omit_fill_value_in_coord[3] _________ 1240s 1240s self = 1240s 1240s def test_explicitly_omit_fill_value_in_coord(self) -> None: 1240s ds = Dataset({"x": ("y", [np.pi, -np.pi])}, coords={"y": [0.0, 1.0]}) 1240s ds.y.encoding["_FillValue"] = None 1240s > with self.roundtrip(ds) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1355: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1240s with self.open(store_target, **open_kwargs) as ds: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'x' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s _ TestZarrDictStore.test_explicitly_omit_fill_value_in_coord_via_encoding_kwarg[3] _ 1240s 1240s self = 1240s 1240s def test_explicitly_omit_fill_value_in_coord_via_encoding_kwarg(self) -> None: 1240s ds = Dataset({"x": ("y", [np.pi, -np.pi])}, coords={"y": [0.0, 1.0]}) 1240s kwargs = dict(encoding={"y": {"_FillValue": None}}) 1240s > with self.roundtrip(ds, save_kwargs=kwargs) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1361: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1240s with self.open(store_target, **open_kwargs) as ds: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'x' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s ________________ TestZarrDictStore.test_encoding_same_dtype[3] _________________ 1240s 1240s self = 1240s 1240s def test_encoding_same_dtype(self) -> None: 1240s ds = Dataset({"x": ("y", np.arange(10.0, dtype="f4"))}) 1240s kwargs = dict(encoding={"x": {"dtype": "f4"}}) 1240s > with self.roundtrip(ds, save_kwargs=kwargs) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1368: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1240s with self.open(store_target, **open_kwargs) as ds: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'x' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float32' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s ______________ TestZarrDictStore.test_append_overwrite_values[3] _______________ 1240s 1240s self = 1240s 1240s def test_append_overwrite_values(self) -> None: 1240s # regression for GH1215 1240s data = create_test_data() 1240s with create_tmp_file(allow_cleanup_failure=False) as tmp_file: 1240s self.save(data, tmp_file, mode="w") 1240s data["var2"][:] = -999 1240s data["var9"] = data["var2"] * 3 1240s > self.save(data[["var2", "var9"]], tmp_file, mode="a") 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1387: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2296: in save 1240s return dataset.to_zarr(store=store_target, **kwargs, **self.version_kwargs) 1240s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1240s return to_zarr( # type: ignore[call-overload,misc] 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1240s dump_to_store(dataset, zstore, writer, encoding=encoding) 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1240s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1240s k: self.open_store_variable(name=k) for k in existing_variable_names 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'dim2' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s ____________ TestZarrDictStore.test_roundtrip_consolidated[3-False] ____________ 1240s 1240s self = 1240s consolidated = False 1240s 1240s @pytest.mark.parametrize("consolidated", [False, True, None]) 1240s def test_roundtrip_consolidated(self, consolidated) -> None: 1240s expected = create_test_data() 1240s > with self.roundtrip( 1240s expected, 1240s save_kwargs={"consolidated": consolidated}, 1240s open_kwargs={"backend_kwargs": {"consolidated": consolidated}}, 1240s ) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2321: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1240s with self.open(store_target, **open_kwargs) as ds: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'dim2' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s ____________ TestZarrDictStore.test_roundtrip_consolidated[3-True] _____________ 1240s 1240s self = 1240s consolidated = True 1240s 1240s @pytest.mark.parametrize("consolidated", [False, True, None]) 1240s def test_roundtrip_consolidated(self, consolidated) -> None: 1240s expected = create_test_data() 1240s > with self.roundtrip( 1240s expected, 1240s save_kwargs={"consolidated": consolidated}, 1240s open_kwargs={"backend_kwargs": {"consolidated": consolidated}}, 1240s ) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2321: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1240s with self.open(store_target, **open_kwargs) as ds: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'dim2' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s ____________ TestZarrDictStore.test_roundtrip_consolidated[3-None] _____________ 1240s 1240s self = 1240s consolidated = None 1240s 1240s @pytest.mark.parametrize("consolidated", [False, True, None]) 1240s def test_roundtrip_consolidated(self, consolidated) -> None: 1240s expected = create_test_data() 1240s > with self.roundtrip( 1240s expected, 1240s save_kwargs={"consolidated": consolidated}, 1240s open_kwargs={"backend_kwargs": {"consolidated": consolidated}}, 1240s ) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2321: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1240s with self.open(store_target, **open_kwargs) as ds: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'dim2' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s ___________ TestZarrDictStore.test_read_non_consolidated_warning[3] ____________ 1240s 1240s self = 1240s 1240s def test_read_non_consolidated_warning(self) -> None: 1240s expected = create_test_data() 1240s with self.create_zarr_target() as store: 1240s self.save( 1240s expected, store_target=store, consolidated=False, **self.version_kwargs 1240s ) 1240s with pytest.warns( 1240s RuntimeWarning, 1240s match="Failed to open Zarr store with consolidated", 1240s ): 1240s > with xr.open_zarr(store, **self.version_kwargs) as ds: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2339: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1240s ds = open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'dim2' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s _________________ TestZarrDictStore.test_non_existent_store[3] _________________ 1240s 1240s self = 1240s 1240s def test_non_existent_store(self) -> None: 1240s with pytest.raises( 1240s FileNotFoundError, match="(No such file or directory|Unable to find group)" 1240s ): 1240s > xr.open_zarr(f"{uuid.uuid4()}") 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2346: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1240s ds = open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1608: in open_dataset 1240s store = ZarrStore.open_group( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:732: in open_group 1240s ) = _get_open_params( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1811: in _get_open_params 1240s zarr_root_group = zarr.open_consolidated(store, **open_kwargs) 1240s /usr/lib/python3/dist-packages/zarr/api/synchronous.py:231: in open_consolidated 1240s sync(async_api.open_consolidated(*args, use_consolidated=use_consolidated, **kwargs)) 1240s /usr/lib/python3/dist-packages/zarr/core/sync.py:163: in sync 1240s raise return_result 1240s /usr/lib/python3/dist-packages/zarr/core/sync.py:119: in _runner 1240s return await coro 1240s /usr/lib/python3/dist-packages/zarr/api/asynchronous.py:408: in open_consolidated 1240s return await open_group(*args, use_consolidated=use_consolidated, **kwargs) 1240s /usr/lib/python3/dist-packages/zarr/api/asynchronous.py:851: in open_group 1240s store_path = await make_store_path(store, mode=mode, storage_options=storage_options, path=path) 1240s /usr/lib/python3/dist-packages/zarr/storage/_common.py:418: in make_store_path 1240s store = await make_store(store_like, mode=mode, storage_options=storage_options) 1240s /usr/lib/python3/dist-packages/zarr/storage/_common.py:349: in make_store 1240s return await make_store(Path(store_like), mode=mode, storage_options=storage_options) 1240s /usr/lib/python3/dist-packages/zarr/storage/_common.py:339: in make_store 1240s return await LocalStore.open(root=store_like, mode=mode, read_only=_read_only) 1240s /usr/lib/python3/dist-packages/zarr/storage/_local.py:160: in open 1240s await store._open() 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = LocalStore('file:///tmp/autopkgtest.cdpOi4/autopkgtest_tmp/build/fde48296-c7e4-41f3-96ce-2801e897fa97') 1240s 1240s async def _open(self, *, mode: AccessModeLiteral | None = None) -> None: 1240s if not self.read_only: 1240s self.root.mkdir(parents=True, exist_ok=True) 1240s 1240s if not self.root.exists(): 1240s > raise FileNotFoundError(f"{self.root} does not exist") 1240s E FileNotFoundError: /tmp/autopkgtest.cdpOi4/autopkgtest_tmp/build/fde48296-c7e4-41f3-96ce-2801e897fa97 does not exist 1240s 1240s /usr/lib/python3/dist-packages/zarr/storage/_local.py:172: FileNotFoundError 1240s 1240s During handling of the above exception, another exception occurred: 1240s 1240s self = 1240s 1240s def test_non_existent_store(self) -> None: 1240s > with pytest.raises( 1240s FileNotFoundError, match="(No such file or directory|Unable to find group)" 1240s ): 1240s E AssertionError: Regex pattern did not match. 1240s E Regex: '(No such file or directory|Unable to find group)' 1240s E Input: '/tmp/autopkgtest.cdpOi4/autopkgtest_tmp/build/fde48296-c7e4-41f3-96ce-2801e897fa97 does not exist' 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2343: AssertionError 1240s _____________________ TestZarrDictStore.test_auto_chunk[3] _____________________ 1240s 1240s self = 1240s 1240s @requires_dask 1240s def test_auto_chunk(self) -> None: 1240s original = create_test_data().chunk() 1240s 1240s > with self.roundtrip(original, open_kwargs={"chunks": None}) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2367: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1240s with self.open(store_target, **open_kwargs) as ds: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'dim2' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s ____________________ TestZarrDictStore.test_manual_chunk[3] ____________________ 1240s 1240s self = 1240s 1240s @requires_dask 1240s @pytest.mark.filterwarnings("ignore:The specified chunks separate:UserWarning") 1240s def test_manual_chunk(self) -> None: 1240s original = create_test_data().chunk({"dim1": 3, "dim2": 4, "dim3": 3}) 1240s 1240s # Using chunks = None should return non-chunked arrays 1240s open_kwargs: dict[str, Any] = {"chunks": None} 1240s > with self.roundtrip(original, open_kwargs=open_kwargs) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2388: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1240s with self.open(store_target, **open_kwargs) as ds: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'dim2' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s _______________ TestZarrDictStore.test_warning_on_bad_chunks[3] ________________ 1240s 1240s self = 1240s 1240s @requires_dask 1240s def test_warning_on_bad_chunks(self) -> None: 1240s original = create_test_data().chunk({"dim1": 4, "dim2": 3, "dim3": 3}) 1240s 1240s bad_chunks = (2, {"dim2": (3, 3, 2, 1)}) 1240s for chunks in bad_chunks: 1240s kwargs = {"chunks": chunks} 1240s with pytest.warns(UserWarning): 1240s > with self.roundtrip(original, open_kwargs=kwargs) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2433: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1240s with self.open(store_target, **open_kwargs) as ds: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'dim2' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s ______________ TestZarrDictStore.test_write_uneven_dask_chunks[3] ______________ 1240s 1240s self = 1240s 1240s @requires_dask 1240s def test_write_uneven_dask_chunks(self) -> None: 1240s # regression for GH#2225 1240s original = create_test_data().chunk({"dim1": 3, "dim2": 4, "dim3": 3}) 1240s > with self.roundtrip(original, open_kwargs={"chunks": {}}) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2476: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1240s with self.open(store_target, **open_kwargs) as ds: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'dim2' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s ___________________ TestZarrDictStore.test_chunk_encoding[3] ___________________ 1240s 1240s self = 1240s 1240s def test_chunk_encoding(self) -> None: 1240s # These datasets have no dask chunks. All chunking specified in 1240s # encoding 1240s data = create_test_data() 1240s chunks = (5, 5) 1240s data["var2"].encoding.update({"chunks": chunks}) 1240s 1240s > with self.roundtrip(data) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2487: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1240s with self.open(store_target, **open_kwargs) as ds: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'dim2' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s ___________________ TestZarrDictStore.test_shard_encoding[3] ___________________ 1240s 1240s self = 1240s 1240s def test_shard_encoding(self) -> None: 1240s # These datasets have no dask chunks. All chunking/sharding specified in 1240s # encoding 1240s if has_zarr_v3 and zarr.config.config["default_zarr_format"] == 3: 1240s data = create_test_data() 1240s chunks = (1, 1) 1240s shards = (5, 5) 1240s data["var2"].encoding.update({"chunks": chunks}) 1240s data["var2"].encoding.update({"shards": shards}) 1240s > with self.roundtrip(data) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2505: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1240s with self.open(store_target, **open_kwargs) as ds: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'dim2' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s ____________ TestZarrDictStore.test_write_persistence_modes[3-None] ____________ 1240s 1240s self = 1240s group = None 1240s 1240s @pytest.mark.parametrize("group", [None, "group1"]) 1240s def test_write_persistence_modes(self, group) -> None: 1240s original = create_test_data() 1240s 1240s # overwrite mode 1240s > with self.roundtrip( 1240s original, 1240s save_kwargs={"mode": "w", "group": group}, 1240s open_kwargs={"group": group}, 1240s ) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2650: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1240s with self.open(store_target, **open_kwargs) as ds: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'dim2' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s ___________ TestZarrDictStore.test_write_persistence_modes[3-group1] ___________ 1240s 1240s self = 1240s group = 'group1' 1240s 1240s @pytest.mark.parametrize("group", [None, "group1"]) 1240s def test_write_persistence_modes(self, group) -> None: 1240s original = create_test_data() 1240s 1240s # overwrite mode 1240s > with self.roundtrip( 1240s original, 1240s save_kwargs={"mode": "w", "group": group}, 1240s open_kwargs={"group": group}, 1240s ) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2650: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1240s with self.open(store_target, **open_kwargs) as ds: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'dim2' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s ________________ TestZarrDictStore.test_compressor_encoding[3] _________________ 1240s 1240s self = 1240s 1240s def test_compressor_encoding(self) -> None: 1240s # specify a custom compressor 1240s original = create_test_data() 1240s if has_zarr_v3 and zarr.config.config["default_zarr_format"] == 3: 1240s encoding_key = "compressors" 1240s # all parameters need to be explicitly specified in order for the comparison to pass below 1240s encoding = { 1240s "serializer": zarr.codecs.BytesCodec(endian="little"), 1240s encoding_key: ( 1240s zarr.codecs.BloscCodec( 1240s cname="zstd", 1240s clevel=3, 1240s shuffle="shuffle", 1240s typesize=8, 1240s blocksize=0, 1240s ), 1240s ), 1240s } 1240s else: 1240s from numcodecs.blosc import Blosc 1240s 1240s encoding_key = "compressors" if has_zarr_v3 else "compressor" 1240s comp = Blosc(cname="zstd", clevel=3, shuffle=2) 1240s encoding = {encoding_key: (comp,) if has_zarr_v3 else comp} 1240s 1240s save_kwargs = dict(encoding={"var1": encoding}) 1240s 1240s > with self.roundtrip(original, save_kwargs=save_kwargs) as ds: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2723: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1240s with self.open(store_target, **open_kwargs) as ds: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'dim2' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s _______________________ TestZarrDictStore.test_group[3] ________________________ 1240s 1240s self = 1240s 1240s def test_group(self) -> None: 1240s original = create_test_data() 1240s group = "some/random/path" 1240s > with self.roundtrip( 1240s original, save_kwargs={"group": group}, open_kwargs={"group": group} 1240s ) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2730: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1240s with self.open(store_target, **open_kwargs) as ds: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'dim2' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s ____________________ TestZarrDictStore.test_append_write[3] ____________________ 1240s 1240s self = 1240s 1240s def test_append_write(self) -> None: 1240s > super().test_append_write() 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2762: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1377: in test_append_write 1240s with self.roundtrip_append(data) as actual: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:388: in roundtrip_append 1240s self.save(data[[key]], path, mode=mode, **save_kwargs) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2296: in save 1240s return dataset.to_zarr(store=store_target, **kwargs, **self.version_kwargs) 1240s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1240s return to_zarr( # type: ignore[call-overload,misc] 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1240s dump_to_store(dataset, zstore, writer, encoding=encoding) 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1240s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1240s k: self.open_store_variable(name=k) for k in existing_variable_names 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'dim2' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s _______ TestZarrDictStore.test_append_with_append_dim_not_set_raises[3] ________ 1240s 1240s self = 1240s 1240s def test_append_with_append_dim_not_set_raises(self) -> None: 1240s ds, ds_to_append, _ = create_append_test_data() 1240s with self.create_zarr_target() as store_target: 1240s ds.to_zarr(store_target, mode="w", **self.version_kwargs) 1240s with pytest.raises(ValueError, match="different dimension sizes"): 1240s > ds_to_append.to_zarr(store_target, mode="a", **self.version_kwargs) 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2809: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1240s return to_zarr( # type: ignore[call-overload,misc] 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1240s dump_to_store(dataset, zstore, writer, encoding=encoding) 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1240s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1240s k: self.open_store_variable(name=k) for k in existing_variable_names 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'da' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s _______ TestZarrDictStore.test_append_string_length_mismatch_works[3-U] ________ 1240s 1240s self = 1240s dtype = 'U' 1240s 1240s @pytest.mark.parametrize("dtype", ["U", "S"]) 1240s def test_append_string_length_mismatch_works(self, dtype) -> None: 1240s skip_if_zarr_format_2("This doesn't work with Zarr format 2") 1240s # ...but it probably would if we used object dtype 1240s ds, ds_to_append = create_append_string_length_mismatch_test_data(dtype) 1240s expected = xr.concat([ds, ds_to_append], dim="time") 1240s with self.create_zarr_target() as store_target: 1240s ds.to_zarr(store_target, mode="w", **self.version_kwargs) 1240s > ds_to_append.to_zarr(store_target, append_dim="time", **self.version_kwargs) 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2851: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1240s return to_zarr( # type: ignore[call-overload,misc] 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1240s dump_to_store(dataset, zstore, writer, encoding=encoding) 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1240s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1018: in store 1240s _validate_datatypes_for_zarr_append( 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s vname = 'temperature' 1240s existing_var = Size: 24B 1240s [3 values with dtype= Size: 60B 1240s array(['abc', 'def', 'ghijk'], dtype=' raise ValueError( 1240s f"Mismatched dtypes for variable {vname} between Zarr store on disk " 1240s f"and dataset to append. Store has dtype {existing_var.dtype} but " 1240s f"dataset to append has dtype {new_var.dtype}." 1240s ) 1240s E ValueError: Mismatched dtypes for variable temperature between Zarr store on disk and dataset to append. Store has dtype 1240s dtype = 'S' 1240s 1240s @pytest.mark.parametrize("dtype", ["U", "S"]) 1240s def test_append_string_length_mismatch_works(self, dtype) -> None: 1240s skip_if_zarr_format_2("This doesn't work with Zarr format 2") 1240s # ...but it probably would if we used object dtype 1240s ds, ds_to_append = create_append_string_length_mismatch_test_data(dtype) 1240s expected = xr.concat([ds, ds_to_append], dim="time") 1240s with self.create_zarr_target() as store_target: 1240s ds.to_zarr(store_target, mode="w", **self.version_kwargs) 1240s > ds_to_append.to_zarr(store_target, append_dim="time", **self.version_kwargs) 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2851: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1240s return to_zarr( # type: ignore[call-overload,misc] 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1240s dump_to_store(dataset, zstore, writer, encoding=encoding) 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1240s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1018: in store 1240s _validate_datatypes_for_zarr_append( 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s vname = 'temperature' 1240s existing_var = Size: 6B 1240s [3 values with dtype=|S2] 1240s new_var = Size: 9B 1240s array([b'aaa', b'bbb', b'ccc'], dtype='|S3') 1240s 1240s def _validate_datatypes_for_zarr_append(vname, existing_var, new_var): 1240s """If variable exists in the store, confirm dtype of the data to append is compatible with 1240s existing dtype. 1240s """ 1240s if ( 1240s np.issubdtype(new_var.dtype, np.number) 1240s or np.issubdtype(new_var.dtype, np.datetime64) 1240s or np.issubdtype(new_var.dtype, np.bool_) 1240s or new_var.dtype == object 1240s or (new_var.dtype.kind in ("S", "U") and existing_var.dtype == object) 1240s ): 1240s # We can skip dtype equality checks under two conditions: (1) if the var to append is 1240s # new to the dataset, because in this case there is no existing var to compare it to; 1240s # or (2) if var to append's dtype is known to be easy-to-append, because in this case 1240s # we can be confident appending won't cause problems. Examples of dtypes which are not 1240s # easy-to-append include length-specified strings of type `|S*` or ` raise ValueError( 1240s f"Mismatched dtypes for variable {vname} between Zarr store on disk " 1240s f"and dataset to append. Store has dtype {existing_var.dtype} but " 1240s f"dataset to append has dtype {new_var.dtype}." 1240s ) 1240s E ValueError: Mismatched dtypes for variable temperature between Zarr store on disk and dataset to append. Store has dtype |S2 but dataset to append has dtype |S3. 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:566: ValueError 1240s _____ TestZarrDictStore.test_check_encoding_is_consistent_after_append[3] ______ 1240s 1240s self = 1240s 1240s def test_check_encoding_is_consistent_after_append(self) -> None: 1240s ds, ds_to_append, _ = create_append_test_data() 1240s 1240s # check encoding consistency 1240s with self.create_zarr_target() as store_target: 1240s import numcodecs 1240s 1240s encoding_value: Any 1240s if has_zarr_v3 and zarr.config.config["default_zarr_format"] == 3: 1240s compressor = zarr.codecs.BloscCodec() 1240s else: 1240s compressor = numcodecs.Blosc() 1240s encoding_key = "compressors" if has_zarr_v3 else "compressor" 1240s encoding_value = (compressor,) if has_zarr_v3 else compressor 1240s 1240s encoding = {"da": {encoding_key: encoding_value}} 1240s ds.to_zarr(store_target, mode="w", encoding=encoding, **self.version_kwargs) 1240s > original_ds = xr.open_dataset( 1240s store_target, engine="zarr", **self.version_kwargs 1240s ) 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2872: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'da' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s ______________ TestZarrDictStore.test_append_with_new_variable[3] ______________ 1240s 1240s self = 1240s 1240s def test_append_with_new_variable(self) -> None: 1240s ds, ds_to_append, ds_with_new_var = create_append_test_data() 1240s 1240s # check append mode for new variable 1240s with self.create_zarr_target() as store_target: 1240s combined = xr.concat([ds, ds_to_append], dim="time") 1240s combined.to_zarr(store_target, mode="w", **self.version_kwargs) 1240s assert_identical( 1240s combined, 1240s > xr.open_dataset(store_target, engine="zarr", **self.version_kwargs), 1240s ) 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2899: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'da' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s ________ TestZarrDictStore.test_append_with_append_dim_no_overwrite[3] _________ 1240s 1240s self = 1240s 1240s def test_append_with_append_dim_no_overwrite(self) -> None: 1240s ds, ds_to_append, _ = create_append_test_data() 1240s with self.create_zarr_target() as store_target: 1240s ds.to_zarr(store_target, mode="w", **self.version_kwargs) 1240s original = xr.concat([ds, ds_to_append], dim="time") 1240s original2 = xr.concat([original, ds_to_append], dim="time") 1240s 1240s # overwrite a coordinate; 1240s # for mode='a-', this will not get written to the store 1240s # because it does not have the append_dim as a dim 1240s lon = ds_to_append.lon.to_numpy().copy() 1240s lon[:] = -999 1240s ds_to_append["lon"] = lon 1240s > ds_to_append.to_zarr( 1240s store_target, mode="a-", append_dim="time", **self.version_kwargs 1240s ) 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2922: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1240s return to_zarr( # type: ignore[call-overload,misc] 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1240s dump_to_store(dataset, zstore, writer, encoding=encoding) 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1240s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1240s k: self.open_store_variable(name=k) for k in existing_variable_names 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'da' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s __________ TestZarrDictStore.test_to_zarr_compute_false_roundtrip[3] ___________ 1240s 1240s self = 1240s 1240s @requires_dask 1240s def test_to_zarr_compute_false_roundtrip(self) -> None: 1240s from dask.delayed import Delayed 1240s 1240s original = create_test_data().chunk() 1240s 1240s with self.create_zarr_target() as store: 1240s delayed_obj = self.save(original, store, compute=False) 1240s assert isinstance(delayed_obj, Delayed) 1240s 1240s # make sure target store has not been written to yet 1240s with pytest.raises(AssertionError): 1240s > with self.open(store) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2948: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'dim2' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s _______ TestZarrDictStore.test_to_zarr_append_compute_false_roundtrip[3] _______ 1240s 1240s self = 1240s 1240s @requires_dask 1240s def test_to_zarr_append_compute_false_roundtrip(self) -> None: 1240s from dask.delayed import Delayed 1240s 1240s ds, ds_to_append, _ = create_append_test_data() 1240s ds, ds_to_append = ds.chunk(), ds_to_append.chunk() 1240s 1240s with pytest.warns(SerializationWarning): 1240s with self.create_zarr_target() as store: 1240s delayed_obj = self.save(ds, store, compute=False, mode="w") 1240s assert isinstance(delayed_obj, Delayed) 1240s 1240s with pytest.raises(AssertionError): 1240s > with self.open(store) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2969: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'da' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s ________________ TestZarrDictStore.test_save_emptydim[3-False] _________________ 1240s 1240s self = 1240s chunk = False 1240s 1240s @pytest.mark.parametrize("chunk", [False, True]) 1240s def test_save_emptydim(self, chunk) -> None: 1240s if chunk and not has_dask: 1240s pytest.skip("requires dask") 1240s ds = Dataset({"x": (("a", "b"), np.empty((5, 0))), "y": ("a", [1, 2, 5, 8, 9])}) 1240s if chunk: 1240s ds = ds.chunk({}) # chunk dataset to save dask array 1240s > with self.roundtrip(ds) as ds_reload: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3000: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1240s with self.open(store_target, **open_kwargs) as ds: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'x' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s _________________ TestZarrDictStore.test_save_emptydim[3-True] _________________ 1240s 1240s self = 1240s chunk = True 1240s 1240s @pytest.mark.parametrize("chunk", [False, True]) 1240s def test_save_emptydim(self, chunk) -> None: 1240s if chunk and not has_dask: 1240s pytest.skip("requires dask") 1240s ds = Dataset({"x": (("a", "b"), np.empty((5, 0))), "y": ("a", [1, 2, 5, 8, 9])}) 1240s if chunk: 1240s ds = ds.chunk({}) # chunk dataset to save dask array 1240s > with self.roundtrip(ds) as ds_reload: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3000: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1240s with self.open(store_target, **open_kwargs) as ds: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'x' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s _____ TestZarrDictStore.test_no_warning_from_open_emptydim_with_chunks[3] ______ 1240s 1240s self = 1240s 1240s @requires_dask 1240s def test_no_warning_from_open_emptydim_with_chunks(self) -> None: 1240s ds = Dataset({"x": (("a", "b"), np.empty((5, 0)))}).chunk({"a": 1}) 1240s with assert_no_warnings(): 1240s with warnings.catch_warnings(): 1240s warnings.filterwarnings( 1240s "ignore", 1240s message=".*Zarr format 3 specification.*", 1240s category=UserWarning, 1240s ) 1240s > with self.roundtrip(ds, open_kwargs=dict(chunks={"a": 1})) as ds_reload: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3013: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1240s with self.open(store_target, **open_kwargs) as ds: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'x' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s ________ TestZarrDictStore.test_write_region[3-False-False-False-False] ________ 1240s 1240s self = 1240s consolidated = False, compute = False, use_dask = False, write_empty = False 1240s 1240s @pytest.mark.parametrize("consolidated", [False, True, None]) 1240s @pytest.mark.parametrize("compute", [False, True]) 1240s @pytest.mark.parametrize("use_dask", [False, True]) 1240s @pytest.mark.parametrize("write_empty", [False, True, None]) 1240s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1240s if (use_dask or not compute) and not has_dask: 1240s pytest.skip("requires dask") 1240s 1240s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1240s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1240s 1240s if use_dask: 1240s zeros = zeros.chunk(2) 1240s nonzeros = nonzeros.chunk(2) 1240s 1240s with self.create_zarr_target() as store: 1240s zeros.to_zarr( 1240s store, 1240s consolidated=consolidated, 1240s compute=compute, 1240s encoding={"u": dict(chunks=2)}, 1240s **self.version_kwargs, 1240s ) 1240s if compute: 1240s with xr.open_zarr( 1240s store, consolidated=consolidated, **self.version_kwargs 1240s ) as actual: 1240s assert_identical(actual, zeros) 1240s for i in range(0, 10, 2): 1240s region = {"x": slice(i, i + 2)} 1240s > nonzeros.isel(region).to_zarr( 1240s store, 1240s region=region, 1240s consolidated=consolidated, 1240s write_empty_chunks=write_empty, 1240s **self.version_kwargs, 1240s ) 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1240s return to_zarr( # type: ignore[call-overload,misc] 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1240s dump_to_store(dataset, zstore, writer, encoding=encoding) 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1240s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1240s k: self.open_store_variable(name=k) for k in existing_variable_names 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'u' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s ________ TestZarrDictStore.test_write_region[3-False-False-False-True] _________ 1240s 1240s self = 1240s consolidated = True, compute = False, use_dask = False, write_empty = False 1240s 1240s @pytest.mark.parametrize("consolidated", [False, True, None]) 1240s @pytest.mark.parametrize("compute", [False, True]) 1240s @pytest.mark.parametrize("use_dask", [False, True]) 1240s @pytest.mark.parametrize("write_empty", [False, True, None]) 1240s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1240s if (use_dask or not compute) and not has_dask: 1240s pytest.skip("requires dask") 1240s 1240s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1240s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1240s 1240s if use_dask: 1240s zeros = zeros.chunk(2) 1240s nonzeros = nonzeros.chunk(2) 1240s 1240s with self.create_zarr_target() as store: 1240s zeros.to_zarr( 1240s store, 1240s consolidated=consolidated, 1240s compute=compute, 1240s encoding={"u": dict(chunks=2)}, 1240s **self.version_kwargs, 1240s ) 1240s if compute: 1240s with xr.open_zarr( 1240s store, consolidated=consolidated, **self.version_kwargs 1240s ) as actual: 1240s assert_identical(actual, zeros) 1240s for i in range(0, 10, 2): 1240s region = {"x": slice(i, i + 2)} 1240s > nonzeros.isel(region).to_zarr( 1240s store, 1240s region=region, 1240s consolidated=consolidated, 1240s write_empty_chunks=write_empty, 1240s **self.version_kwargs, 1240s ) 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1240s return to_zarr( # type: ignore[call-overload,misc] 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1240s dump_to_store(dataset, zstore, writer, encoding=encoding) 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1240s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1240s k: self.open_store_variable(name=k) for k in existing_variable_names 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'u' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s ________ TestZarrDictStore.test_write_region[3-False-False-False-None] _________ 1240s 1240s self = 1240s consolidated = None, compute = False, use_dask = False, write_empty = False 1240s 1240s @pytest.mark.parametrize("consolidated", [False, True, None]) 1240s @pytest.mark.parametrize("compute", [False, True]) 1240s @pytest.mark.parametrize("use_dask", [False, True]) 1240s @pytest.mark.parametrize("write_empty", [False, True, None]) 1240s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1240s if (use_dask or not compute) and not has_dask: 1240s pytest.skip("requires dask") 1240s 1240s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1240s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1240s 1240s if use_dask: 1240s zeros = zeros.chunk(2) 1240s nonzeros = nonzeros.chunk(2) 1240s 1240s with self.create_zarr_target() as store: 1240s zeros.to_zarr( 1240s store, 1240s consolidated=consolidated, 1240s compute=compute, 1240s encoding={"u": dict(chunks=2)}, 1240s **self.version_kwargs, 1240s ) 1240s if compute: 1240s with xr.open_zarr( 1240s store, consolidated=consolidated, **self.version_kwargs 1240s ) as actual: 1240s assert_identical(actual, zeros) 1240s for i in range(0, 10, 2): 1240s region = {"x": slice(i, i + 2)} 1240s > nonzeros.isel(region).to_zarr( 1240s store, 1240s region=region, 1240s consolidated=consolidated, 1240s write_empty_chunks=write_empty, 1240s **self.version_kwargs, 1240s ) 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1240s return to_zarr( # type: ignore[call-overload,misc] 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1240s dump_to_store(dataset, zstore, writer, encoding=encoding) 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1240s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1240s k: self.open_store_variable(name=k) for k in existing_variable_names 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'u' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s ________ TestZarrDictStore.test_write_region[3-False-False-True-False] _________ 1240s 1240s self = 1240s consolidated = False, compute = True, use_dask = False, write_empty = False 1240s 1240s @pytest.mark.parametrize("consolidated", [False, True, None]) 1240s @pytest.mark.parametrize("compute", [False, True]) 1240s @pytest.mark.parametrize("use_dask", [False, True]) 1240s @pytest.mark.parametrize("write_empty", [False, True, None]) 1240s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1240s if (use_dask or not compute) and not has_dask: 1240s pytest.skip("requires dask") 1240s 1240s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1240s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1240s 1240s if use_dask: 1240s zeros = zeros.chunk(2) 1240s nonzeros = nonzeros.chunk(2) 1240s 1240s with self.create_zarr_target() as store: 1240s zeros.to_zarr( 1240s store, 1240s consolidated=consolidated, 1240s compute=compute, 1240s encoding={"u": dict(chunks=2)}, 1240s **self.version_kwargs, 1240s ) 1240s if compute: 1240s > with xr.open_zarr( 1240s store, consolidated=consolidated, **self.version_kwargs 1240s ) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1240s ds = open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'u' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s _________ TestZarrDictStore.test_write_region[3-False-False-True-True] _________ 1240s 1240s self = 1240s consolidated = True, compute = True, use_dask = False, write_empty = False 1240s 1240s @pytest.mark.parametrize("consolidated", [False, True, None]) 1240s @pytest.mark.parametrize("compute", [False, True]) 1240s @pytest.mark.parametrize("use_dask", [False, True]) 1240s @pytest.mark.parametrize("write_empty", [False, True, None]) 1240s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1240s if (use_dask or not compute) and not has_dask: 1240s pytest.skip("requires dask") 1240s 1240s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1240s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1240s 1240s if use_dask: 1240s zeros = zeros.chunk(2) 1240s nonzeros = nonzeros.chunk(2) 1240s 1240s with self.create_zarr_target() as store: 1240s zeros.to_zarr( 1240s store, 1240s consolidated=consolidated, 1240s compute=compute, 1240s encoding={"u": dict(chunks=2)}, 1240s **self.version_kwargs, 1240s ) 1240s if compute: 1240s > with xr.open_zarr( 1240s store, consolidated=consolidated, **self.version_kwargs 1240s ) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1240s ds = open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'u' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s _________ TestZarrDictStore.test_write_region[3-False-False-True-None] _________ 1240s 1240s self = 1240s consolidated = None, compute = True, use_dask = False, write_empty = False 1240s 1240s @pytest.mark.parametrize("consolidated", [False, True, None]) 1240s @pytest.mark.parametrize("compute", [False, True]) 1240s @pytest.mark.parametrize("use_dask", [False, True]) 1240s @pytest.mark.parametrize("write_empty", [False, True, None]) 1240s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1240s if (use_dask or not compute) and not has_dask: 1240s pytest.skip("requires dask") 1240s 1240s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1240s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1240s 1240s if use_dask: 1240s zeros = zeros.chunk(2) 1240s nonzeros = nonzeros.chunk(2) 1240s 1240s with self.create_zarr_target() as store: 1240s zeros.to_zarr( 1240s store, 1240s consolidated=consolidated, 1240s compute=compute, 1240s encoding={"u": dict(chunks=2)}, 1240s **self.version_kwargs, 1240s ) 1240s if compute: 1240s > with xr.open_zarr( 1240s store, consolidated=consolidated, **self.version_kwargs 1240s ) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1240s ds = open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'u' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s ________ TestZarrDictStore.test_write_region[3-False-True-False-False] _________ 1240s 1240s self = 1240s consolidated = False, compute = False, use_dask = True, write_empty = False 1240s 1240s @pytest.mark.parametrize("consolidated", [False, True, None]) 1240s @pytest.mark.parametrize("compute", [False, True]) 1240s @pytest.mark.parametrize("use_dask", [False, True]) 1240s @pytest.mark.parametrize("write_empty", [False, True, None]) 1240s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1240s if (use_dask or not compute) and not has_dask: 1240s pytest.skip("requires dask") 1240s 1240s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1240s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1240s 1240s if use_dask: 1240s zeros = zeros.chunk(2) 1240s nonzeros = nonzeros.chunk(2) 1240s 1240s with self.create_zarr_target() as store: 1240s zeros.to_zarr( 1240s store, 1240s consolidated=consolidated, 1240s compute=compute, 1240s encoding={"u": dict(chunks=2)}, 1240s **self.version_kwargs, 1240s ) 1240s if compute: 1240s with xr.open_zarr( 1240s store, consolidated=consolidated, **self.version_kwargs 1240s ) as actual: 1240s assert_identical(actual, zeros) 1240s for i in range(0, 10, 2): 1240s region = {"x": slice(i, i + 2)} 1240s > nonzeros.isel(region).to_zarr( 1240s store, 1240s region=region, 1240s consolidated=consolidated, 1240s write_empty_chunks=write_empty, 1240s **self.version_kwargs, 1240s ) 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1240s return to_zarr( # type: ignore[call-overload,misc] 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1240s dump_to_store(dataset, zstore, writer, encoding=encoding) 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1240s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1240s k: self.open_store_variable(name=k) for k in existing_variable_names 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'u' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s _________ TestZarrDictStore.test_write_region[3-False-True-False-True] _________ 1240s 1240s self = 1240s consolidated = True, compute = False, use_dask = True, write_empty = False 1240s 1240s @pytest.mark.parametrize("consolidated", [False, True, None]) 1240s @pytest.mark.parametrize("compute", [False, True]) 1240s @pytest.mark.parametrize("use_dask", [False, True]) 1240s @pytest.mark.parametrize("write_empty", [False, True, None]) 1240s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1240s if (use_dask or not compute) and not has_dask: 1240s pytest.skip("requires dask") 1240s 1240s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1240s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1240s 1240s if use_dask: 1240s zeros = zeros.chunk(2) 1240s nonzeros = nonzeros.chunk(2) 1240s 1240s with self.create_zarr_target() as store: 1240s zeros.to_zarr( 1240s store, 1240s consolidated=consolidated, 1240s compute=compute, 1240s encoding={"u": dict(chunks=2)}, 1240s **self.version_kwargs, 1240s ) 1240s if compute: 1240s with xr.open_zarr( 1240s store, consolidated=consolidated, **self.version_kwargs 1240s ) as actual: 1240s assert_identical(actual, zeros) 1240s for i in range(0, 10, 2): 1240s region = {"x": slice(i, i + 2)} 1240s > nonzeros.isel(region).to_zarr( 1240s store, 1240s region=region, 1240s consolidated=consolidated, 1240s write_empty_chunks=write_empty, 1240s **self.version_kwargs, 1240s ) 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1240s return to_zarr( # type: ignore[call-overload,misc] 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1240s dump_to_store(dataset, zstore, writer, encoding=encoding) 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1240s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1240s k: self.open_store_variable(name=k) for k in existing_variable_names 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'u' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s _________ TestZarrDictStore.test_write_region[3-False-True-False-None] _________ 1240s 1240s self = 1240s consolidated = None, compute = False, use_dask = True, write_empty = False 1240s 1240s @pytest.mark.parametrize("consolidated", [False, True, None]) 1240s @pytest.mark.parametrize("compute", [False, True]) 1240s @pytest.mark.parametrize("use_dask", [False, True]) 1240s @pytest.mark.parametrize("write_empty", [False, True, None]) 1240s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1240s if (use_dask or not compute) and not has_dask: 1240s pytest.skip("requires dask") 1240s 1240s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1240s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1240s 1240s if use_dask: 1240s zeros = zeros.chunk(2) 1240s nonzeros = nonzeros.chunk(2) 1240s 1240s with self.create_zarr_target() as store: 1240s zeros.to_zarr( 1240s store, 1240s consolidated=consolidated, 1240s compute=compute, 1240s encoding={"u": dict(chunks=2)}, 1240s **self.version_kwargs, 1240s ) 1240s if compute: 1240s with xr.open_zarr( 1240s store, consolidated=consolidated, **self.version_kwargs 1240s ) as actual: 1240s assert_identical(actual, zeros) 1240s for i in range(0, 10, 2): 1240s region = {"x": slice(i, i + 2)} 1240s > nonzeros.isel(region).to_zarr( 1240s store, 1240s region=region, 1240s consolidated=consolidated, 1240s write_empty_chunks=write_empty, 1240s **self.version_kwargs, 1240s ) 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1240s return to_zarr( # type: ignore[call-overload,misc] 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1240s dump_to_store(dataset, zstore, writer, encoding=encoding) 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1240s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1240s k: self.open_store_variable(name=k) for k in existing_variable_names 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'u' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s _________ TestZarrDictStore.test_write_region[3-False-True-True-False] _________ 1240s 1240s self = 1240s consolidated = False, compute = True, use_dask = True, write_empty = False 1240s 1240s @pytest.mark.parametrize("consolidated", [False, True, None]) 1240s @pytest.mark.parametrize("compute", [False, True]) 1240s @pytest.mark.parametrize("use_dask", [False, True]) 1240s @pytest.mark.parametrize("write_empty", [False, True, None]) 1240s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1240s if (use_dask or not compute) and not has_dask: 1240s pytest.skip("requires dask") 1240s 1240s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1240s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1240s 1240s if use_dask: 1240s zeros = zeros.chunk(2) 1240s nonzeros = nonzeros.chunk(2) 1240s 1240s with self.create_zarr_target() as store: 1240s zeros.to_zarr( 1240s store, 1240s consolidated=consolidated, 1240s compute=compute, 1240s encoding={"u": dict(chunks=2)}, 1240s **self.version_kwargs, 1240s ) 1240s if compute: 1240s > with xr.open_zarr( 1240s store, consolidated=consolidated, **self.version_kwargs 1240s ) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1240s ds = open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'u' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s _________ TestZarrDictStore.test_write_region[3-False-True-True-True] __________ 1240s 1240s self = 1240s consolidated = True, compute = True, use_dask = True, write_empty = False 1240s 1240s @pytest.mark.parametrize("consolidated", [False, True, None]) 1240s @pytest.mark.parametrize("compute", [False, True]) 1240s @pytest.mark.parametrize("use_dask", [False, True]) 1240s @pytest.mark.parametrize("write_empty", [False, True, None]) 1240s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1240s if (use_dask or not compute) and not has_dask: 1240s pytest.skip("requires dask") 1240s 1240s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1240s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1240s 1240s if use_dask: 1240s zeros = zeros.chunk(2) 1240s nonzeros = nonzeros.chunk(2) 1240s 1240s with self.create_zarr_target() as store: 1240s zeros.to_zarr( 1240s store, 1240s consolidated=consolidated, 1240s compute=compute, 1240s encoding={"u": dict(chunks=2)}, 1240s **self.version_kwargs, 1240s ) 1240s if compute: 1240s > with xr.open_zarr( 1240s store, consolidated=consolidated, **self.version_kwargs 1240s ) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1240s ds = open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'u' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s _________ TestZarrDictStore.test_write_region[3-False-True-True-None] __________ 1240s 1240s self = 1240s consolidated = None, compute = True, use_dask = True, write_empty = False 1240s 1240s @pytest.mark.parametrize("consolidated", [False, True, None]) 1240s @pytest.mark.parametrize("compute", [False, True]) 1240s @pytest.mark.parametrize("use_dask", [False, True]) 1240s @pytest.mark.parametrize("write_empty", [False, True, None]) 1240s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1240s if (use_dask or not compute) and not has_dask: 1240s pytest.skip("requires dask") 1240s 1240s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1240s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1240s 1240s if use_dask: 1240s zeros = zeros.chunk(2) 1240s nonzeros = nonzeros.chunk(2) 1240s 1240s with self.create_zarr_target() as store: 1240s zeros.to_zarr( 1240s store, 1240s consolidated=consolidated, 1240s compute=compute, 1240s encoding={"u": dict(chunks=2)}, 1240s **self.version_kwargs, 1240s ) 1240s if compute: 1240s > with xr.open_zarr( 1240s store, consolidated=consolidated, **self.version_kwargs 1240s ) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1240s ds = open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'u' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s ________ TestZarrDictStore.test_write_region[3-True-False-False-False] _________ 1240s 1240s self = 1240s consolidated = False, compute = False, use_dask = False, write_empty = True 1240s 1240s @pytest.mark.parametrize("consolidated", [False, True, None]) 1240s @pytest.mark.parametrize("compute", [False, True]) 1240s @pytest.mark.parametrize("use_dask", [False, True]) 1240s @pytest.mark.parametrize("write_empty", [False, True, None]) 1240s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1240s if (use_dask or not compute) and not has_dask: 1240s pytest.skip("requires dask") 1240s 1240s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1240s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1240s 1240s if use_dask: 1240s zeros = zeros.chunk(2) 1240s nonzeros = nonzeros.chunk(2) 1240s 1240s with self.create_zarr_target() as store: 1240s zeros.to_zarr( 1240s store, 1240s consolidated=consolidated, 1240s compute=compute, 1240s encoding={"u": dict(chunks=2)}, 1240s **self.version_kwargs, 1240s ) 1240s if compute: 1240s with xr.open_zarr( 1240s store, consolidated=consolidated, **self.version_kwargs 1240s ) as actual: 1240s assert_identical(actual, zeros) 1240s for i in range(0, 10, 2): 1240s region = {"x": slice(i, i + 2)} 1240s > nonzeros.isel(region).to_zarr( 1240s store, 1240s region=region, 1240s consolidated=consolidated, 1240s write_empty_chunks=write_empty, 1240s **self.version_kwargs, 1240s ) 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1240s return to_zarr( # type: ignore[call-overload,misc] 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1240s dump_to_store(dataset, zstore, writer, encoding=encoding) 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1240s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1240s k: self.open_store_variable(name=k) for k in existing_variable_names 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'u' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s _________ TestZarrDictStore.test_write_region[3-True-False-False-True] _________ 1240s 1240s self = 1240s consolidated = True, compute = False, use_dask = False, write_empty = True 1240s 1240s @pytest.mark.parametrize("consolidated", [False, True, None]) 1240s @pytest.mark.parametrize("compute", [False, True]) 1240s @pytest.mark.parametrize("use_dask", [False, True]) 1240s @pytest.mark.parametrize("write_empty", [False, True, None]) 1240s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1240s if (use_dask or not compute) and not has_dask: 1240s pytest.skip("requires dask") 1240s 1240s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1240s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1240s 1240s if use_dask: 1240s zeros = zeros.chunk(2) 1240s nonzeros = nonzeros.chunk(2) 1240s 1240s with self.create_zarr_target() as store: 1240s zeros.to_zarr( 1240s store, 1240s consolidated=consolidated, 1240s compute=compute, 1240s encoding={"u": dict(chunks=2)}, 1240s **self.version_kwargs, 1240s ) 1240s if compute: 1240s with xr.open_zarr( 1240s store, consolidated=consolidated, **self.version_kwargs 1240s ) as actual: 1240s assert_identical(actual, zeros) 1240s for i in range(0, 10, 2): 1240s region = {"x": slice(i, i + 2)} 1240s > nonzeros.isel(region).to_zarr( 1240s store, 1240s region=region, 1240s consolidated=consolidated, 1240s write_empty_chunks=write_empty, 1240s **self.version_kwargs, 1240s ) 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1240s return to_zarr( # type: ignore[call-overload,misc] 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1240s dump_to_store(dataset, zstore, writer, encoding=encoding) 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1240s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1240s k: self.open_store_variable(name=k) for k in existing_variable_names 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'u' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s _________ TestZarrDictStore.test_write_region[3-True-False-False-None] _________ 1240s 1240s self = 1240s consolidated = None, compute = False, use_dask = False, write_empty = True 1240s 1240s @pytest.mark.parametrize("consolidated", [False, True, None]) 1240s @pytest.mark.parametrize("compute", [False, True]) 1240s @pytest.mark.parametrize("use_dask", [False, True]) 1240s @pytest.mark.parametrize("write_empty", [False, True, None]) 1240s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1240s if (use_dask or not compute) and not has_dask: 1240s pytest.skip("requires dask") 1240s 1240s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1240s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1240s 1240s if use_dask: 1240s zeros = zeros.chunk(2) 1240s nonzeros = nonzeros.chunk(2) 1240s 1240s with self.create_zarr_target() as store: 1240s zeros.to_zarr( 1240s store, 1240s consolidated=consolidated, 1240s compute=compute, 1240s encoding={"u": dict(chunks=2)}, 1240s **self.version_kwargs, 1240s ) 1240s if compute: 1240s with xr.open_zarr( 1240s store, consolidated=consolidated, **self.version_kwargs 1240s ) as actual: 1240s assert_identical(actual, zeros) 1240s for i in range(0, 10, 2): 1240s region = {"x": slice(i, i + 2)} 1240s > nonzeros.isel(region).to_zarr( 1240s store, 1240s region=region, 1240s consolidated=consolidated, 1240s write_empty_chunks=write_empty, 1240s **self.version_kwargs, 1240s ) 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1240s return to_zarr( # type: ignore[call-overload,misc] 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1240s dump_to_store(dataset, zstore, writer, encoding=encoding) 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1240s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1240s k: self.open_store_variable(name=k) for k in existing_variable_names 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'u' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s _________ TestZarrDictStore.test_write_region[3-True-False-True-False] _________ 1240s 1240s self = 1240s consolidated = False, compute = True, use_dask = False, write_empty = True 1240s 1240s @pytest.mark.parametrize("consolidated", [False, True, None]) 1240s @pytest.mark.parametrize("compute", [False, True]) 1240s @pytest.mark.parametrize("use_dask", [False, True]) 1240s @pytest.mark.parametrize("write_empty", [False, True, None]) 1240s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1240s if (use_dask or not compute) and not has_dask: 1240s pytest.skip("requires dask") 1240s 1240s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1240s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1240s 1240s if use_dask: 1240s zeros = zeros.chunk(2) 1240s nonzeros = nonzeros.chunk(2) 1240s 1240s with self.create_zarr_target() as store: 1240s zeros.to_zarr( 1240s store, 1240s consolidated=consolidated, 1240s compute=compute, 1240s encoding={"u": dict(chunks=2)}, 1240s **self.version_kwargs, 1240s ) 1240s if compute: 1240s > with xr.open_zarr( 1240s store, consolidated=consolidated, **self.version_kwargs 1240s ) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1240s ds = open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'u' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s _________ TestZarrDictStore.test_write_region[3-True-False-True-True] __________ 1240s 1240s self = 1240s consolidated = True, compute = True, use_dask = False, write_empty = True 1240s 1240s @pytest.mark.parametrize("consolidated", [False, True, None]) 1240s @pytest.mark.parametrize("compute", [False, True]) 1240s @pytest.mark.parametrize("use_dask", [False, True]) 1240s @pytest.mark.parametrize("write_empty", [False, True, None]) 1240s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1240s if (use_dask or not compute) and not has_dask: 1240s pytest.skip("requires dask") 1240s 1240s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1240s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1240s 1240s if use_dask: 1240s zeros = zeros.chunk(2) 1240s nonzeros = nonzeros.chunk(2) 1240s 1240s with self.create_zarr_target() as store: 1240s zeros.to_zarr( 1240s store, 1240s consolidated=consolidated, 1240s compute=compute, 1240s encoding={"u": dict(chunks=2)}, 1240s **self.version_kwargs, 1240s ) 1240s if compute: 1240s > with xr.open_zarr( 1240s store, consolidated=consolidated, **self.version_kwargs 1240s ) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1240s ds = open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'u' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s _________ TestZarrDictStore.test_write_region[3-True-False-True-None] __________ 1240s 1240s self = 1240s consolidated = None, compute = True, use_dask = False, write_empty = True 1240s 1240s @pytest.mark.parametrize("consolidated", [False, True, None]) 1240s @pytest.mark.parametrize("compute", [False, True]) 1240s @pytest.mark.parametrize("use_dask", [False, True]) 1240s @pytest.mark.parametrize("write_empty", [False, True, None]) 1240s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1240s if (use_dask or not compute) and not has_dask: 1240s pytest.skip("requires dask") 1240s 1240s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1240s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1240s 1240s if use_dask: 1240s zeros = zeros.chunk(2) 1240s nonzeros = nonzeros.chunk(2) 1240s 1240s with self.create_zarr_target() as store: 1240s zeros.to_zarr( 1240s store, 1240s consolidated=consolidated, 1240s compute=compute, 1240s encoding={"u": dict(chunks=2)}, 1240s **self.version_kwargs, 1240s ) 1240s if compute: 1240s > with xr.open_zarr( 1240s store, consolidated=consolidated, **self.version_kwargs 1240s ) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1240s ds = open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'u' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s _________ TestZarrDictStore.test_write_region[3-True-True-False-False] _________ 1240s 1240s self = 1240s consolidated = False, compute = False, use_dask = True, write_empty = True 1240s 1240s @pytest.mark.parametrize("consolidated", [False, True, None]) 1240s @pytest.mark.parametrize("compute", [False, True]) 1240s @pytest.mark.parametrize("use_dask", [False, True]) 1240s @pytest.mark.parametrize("write_empty", [False, True, None]) 1240s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1240s if (use_dask or not compute) and not has_dask: 1240s pytest.skip("requires dask") 1240s 1240s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1240s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1240s 1240s if use_dask: 1240s zeros = zeros.chunk(2) 1240s nonzeros = nonzeros.chunk(2) 1240s 1240s with self.create_zarr_target() as store: 1240s zeros.to_zarr( 1240s store, 1240s consolidated=consolidated, 1240s compute=compute, 1240s encoding={"u": dict(chunks=2)}, 1240s **self.version_kwargs, 1240s ) 1240s if compute: 1240s with xr.open_zarr( 1240s store, consolidated=consolidated, **self.version_kwargs 1240s ) as actual: 1240s assert_identical(actual, zeros) 1240s for i in range(0, 10, 2): 1240s region = {"x": slice(i, i + 2)} 1240s > nonzeros.isel(region).to_zarr( 1240s store, 1240s region=region, 1240s consolidated=consolidated, 1240s write_empty_chunks=write_empty, 1240s **self.version_kwargs, 1240s ) 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1240s return to_zarr( # type: ignore[call-overload,misc] 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1240s dump_to_store(dataset, zstore, writer, encoding=encoding) 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1240s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1240s k: self.open_store_variable(name=k) for k in existing_variable_names 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'u' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s _________ TestZarrDictStore.test_write_region[3-True-True-False-True] __________ 1240s 1240s self = 1240s consolidated = True, compute = False, use_dask = True, write_empty = True 1240s 1240s @pytest.mark.parametrize("consolidated", [False, True, None]) 1240s @pytest.mark.parametrize("compute", [False, True]) 1240s @pytest.mark.parametrize("use_dask", [False, True]) 1240s @pytest.mark.parametrize("write_empty", [False, True, None]) 1240s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1240s if (use_dask or not compute) and not has_dask: 1240s pytest.skip("requires dask") 1240s 1240s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1240s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1240s 1240s if use_dask: 1240s zeros = zeros.chunk(2) 1240s nonzeros = nonzeros.chunk(2) 1240s 1240s with self.create_zarr_target() as store: 1240s zeros.to_zarr( 1240s store, 1240s consolidated=consolidated, 1240s compute=compute, 1240s encoding={"u": dict(chunks=2)}, 1240s **self.version_kwargs, 1240s ) 1240s if compute: 1240s with xr.open_zarr( 1240s store, consolidated=consolidated, **self.version_kwargs 1240s ) as actual: 1240s assert_identical(actual, zeros) 1240s for i in range(0, 10, 2): 1240s region = {"x": slice(i, i + 2)} 1240s > nonzeros.isel(region).to_zarr( 1240s store, 1240s region=region, 1240s consolidated=consolidated, 1240s write_empty_chunks=write_empty, 1240s **self.version_kwargs, 1240s ) 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1240s return to_zarr( # type: ignore[call-overload,misc] 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1240s dump_to_store(dataset, zstore, writer, encoding=encoding) 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1240s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1240s k: self.open_store_variable(name=k) for k in existing_variable_names 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'u' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s _________ TestZarrDictStore.test_write_region[3-True-True-False-None] __________ 1240s 1240s self = 1240s consolidated = None, compute = False, use_dask = True, write_empty = True 1240s 1240s @pytest.mark.parametrize("consolidated", [False, True, None]) 1240s @pytest.mark.parametrize("compute", [False, True]) 1240s @pytest.mark.parametrize("use_dask", [False, True]) 1240s @pytest.mark.parametrize("write_empty", [False, True, None]) 1240s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1240s if (use_dask or not compute) and not has_dask: 1240s pytest.skip("requires dask") 1240s 1240s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1240s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1240s 1240s if use_dask: 1240s zeros = zeros.chunk(2) 1240s nonzeros = nonzeros.chunk(2) 1240s 1240s with self.create_zarr_target() as store: 1240s zeros.to_zarr( 1240s store, 1240s consolidated=consolidated, 1240s compute=compute, 1240s encoding={"u": dict(chunks=2)}, 1240s **self.version_kwargs, 1240s ) 1240s if compute: 1240s with xr.open_zarr( 1240s store, consolidated=consolidated, **self.version_kwargs 1240s ) as actual: 1240s assert_identical(actual, zeros) 1240s for i in range(0, 10, 2): 1240s region = {"x": slice(i, i + 2)} 1240s > nonzeros.isel(region).to_zarr( 1240s store, 1240s region=region, 1240s consolidated=consolidated, 1240s write_empty_chunks=write_empty, 1240s **self.version_kwargs, 1240s ) 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1240s return to_zarr( # type: ignore[call-overload,misc] 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1240s dump_to_store(dataset, zstore, writer, encoding=encoding) 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1240s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1240s k: self.open_store_variable(name=k) for k in existing_variable_names 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'u' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s _________ TestZarrDictStore.test_write_region[3-True-True-True-False] __________ 1240s 1240s self = 1240s consolidated = False, compute = True, use_dask = True, write_empty = True 1240s 1240s @pytest.mark.parametrize("consolidated", [False, True, None]) 1240s @pytest.mark.parametrize("compute", [False, True]) 1240s @pytest.mark.parametrize("use_dask", [False, True]) 1240s @pytest.mark.parametrize("write_empty", [False, True, None]) 1240s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1240s if (use_dask or not compute) and not has_dask: 1240s pytest.skip("requires dask") 1240s 1240s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1240s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1240s 1240s if use_dask: 1240s zeros = zeros.chunk(2) 1240s nonzeros = nonzeros.chunk(2) 1240s 1240s with self.create_zarr_target() as store: 1240s zeros.to_zarr( 1240s store, 1240s consolidated=consolidated, 1240s compute=compute, 1240s encoding={"u": dict(chunks=2)}, 1240s **self.version_kwargs, 1240s ) 1240s if compute: 1240s > with xr.open_zarr( 1240s store, consolidated=consolidated, **self.version_kwargs 1240s ) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1240s ds = open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'u' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s __________ TestZarrDictStore.test_write_region[3-True-True-True-True] __________ 1240s 1240s self = 1240s consolidated = True, compute = True, use_dask = True, write_empty = True 1240s 1240s @pytest.mark.parametrize("consolidated", [False, True, None]) 1240s @pytest.mark.parametrize("compute", [False, True]) 1240s @pytest.mark.parametrize("use_dask", [False, True]) 1240s @pytest.mark.parametrize("write_empty", [False, True, None]) 1240s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1240s if (use_dask or not compute) and not has_dask: 1240s pytest.skip("requires dask") 1240s 1240s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1240s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1240s 1240s if use_dask: 1240s zeros = zeros.chunk(2) 1240s nonzeros = nonzeros.chunk(2) 1240s 1240s with self.create_zarr_target() as store: 1240s zeros.to_zarr( 1240s store, 1240s consolidated=consolidated, 1240s compute=compute, 1240s encoding={"u": dict(chunks=2)}, 1240s **self.version_kwargs, 1240s ) 1240s if compute: 1240s > with xr.open_zarr( 1240s store, consolidated=consolidated, **self.version_kwargs 1240s ) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1240s ds = open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'u' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s __________ TestZarrDictStore.test_write_region[3-True-True-True-None] __________ 1240s 1240s self = 1240s consolidated = None, compute = True, use_dask = True, write_empty = True 1240s 1240s @pytest.mark.parametrize("consolidated", [False, True, None]) 1240s @pytest.mark.parametrize("compute", [False, True]) 1240s @pytest.mark.parametrize("use_dask", [False, True]) 1240s @pytest.mark.parametrize("write_empty", [False, True, None]) 1240s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1240s if (use_dask or not compute) and not has_dask: 1240s pytest.skip("requires dask") 1240s 1240s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1240s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1240s 1240s if use_dask: 1240s zeros = zeros.chunk(2) 1240s nonzeros = nonzeros.chunk(2) 1240s 1240s with self.create_zarr_target() as store: 1240s zeros.to_zarr( 1240s store, 1240s consolidated=consolidated, 1240s compute=compute, 1240s encoding={"u": dict(chunks=2)}, 1240s **self.version_kwargs, 1240s ) 1240s if compute: 1240s > with xr.open_zarr( 1240s store, consolidated=consolidated, **self.version_kwargs 1240s ) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1240s ds = open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'u' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s ________ TestZarrDictStore.test_write_region[3-None-False-False-False] _________ 1240s 1240s self = 1240s consolidated = False, compute = False, use_dask = False, write_empty = None 1240s 1240s @pytest.mark.parametrize("consolidated", [False, True, None]) 1240s @pytest.mark.parametrize("compute", [False, True]) 1240s @pytest.mark.parametrize("use_dask", [False, True]) 1240s @pytest.mark.parametrize("write_empty", [False, True, None]) 1240s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1240s if (use_dask or not compute) and not has_dask: 1240s pytest.skip("requires dask") 1240s 1240s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1240s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1240s 1240s if use_dask: 1240s zeros = zeros.chunk(2) 1240s nonzeros = nonzeros.chunk(2) 1240s 1240s with self.create_zarr_target() as store: 1240s zeros.to_zarr( 1240s store, 1240s consolidated=consolidated, 1240s compute=compute, 1240s encoding={"u": dict(chunks=2)}, 1240s **self.version_kwargs, 1240s ) 1240s if compute: 1240s with xr.open_zarr( 1240s store, consolidated=consolidated, **self.version_kwargs 1240s ) as actual: 1240s assert_identical(actual, zeros) 1240s for i in range(0, 10, 2): 1240s region = {"x": slice(i, i + 2)} 1240s > nonzeros.isel(region).to_zarr( 1240s store, 1240s region=region, 1240s consolidated=consolidated, 1240s write_empty_chunks=write_empty, 1240s **self.version_kwargs, 1240s ) 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1240s return to_zarr( # type: ignore[call-overload,misc] 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1240s dump_to_store(dataset, zstore, writer, encoding=encoding) 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1240s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1240s k: self.open_store_variable(name=k) for k in existing_variable_names 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'u' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s _________ TestZarrDictStore.test_write_region[3-None-False-False-True] _________ 1240s 1240s self = 1240s consolidated = True, compute = False, use_dask = False, write_empty = None 1240s 1240s @pytest.mark.parametrize("consolidated", [False, True, None]) 1240s @pytest.mark.parametrize("compute", [False, True]) 1240s @pytest.mark.parametrize("use_dask", [False, True]) 1240s @pytest.mark.parametrize("write_empty", [False, True, None]) 1240s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1240s if (use_dask or not compute) and not has_dask: 1240s pytest.skip("requires dask") 1240s 1240s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1240s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1240s 1240s if use_dask: 1240s zeros = zeros.chunk(2) 1240s nonzeros = nonzeros.chunk(2) 1240s 1240s with self.create_zarr_target() as store: 1240s zeros.to_zarr( 1240s store, 1240s consolidated=consolidated, 1240s compute=compute, 1240s encoding={"u": dict(chunks=2)}, 1240s **self.version_kwargs, 1240s ) 1240s if compute: 1240s with xr.open_zarr( 1240s store, consolidated=consolidated, **self.version_kwargs 1240s ) as actual: 1240s assert_identical(actual, zeros) 1240s for i in range(0, 10, 2): 1240s region = {"x": slice(i, i + 2)} 1240s > nonzeros.isel(region).to_zarr( 1240s store, 1240s region=region, 1240s consolidated=consolidated, 1240s write_empty_chunks=write_empty, 1240s **self.version_kwargs, 1240s ) 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1240s return to_zarr( # type: ignore[call-overload,misc] 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1240s dump_to_store(dataset, zstore, writer, encoding=encoding) 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1240s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1240s k: self.open_store_variable(name=k) for k in existing_variable_names 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'u' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s _________ TestZarrDictStore.test_write_region[3-None-False-False-None] _________ 1240s 1240s self = 1240s consolidated = None, compute = False, use_dask = False, write_empty = None 1240s 1240s @pytest.mark.parametrize("consolidated", [False, True, None]) 1240s @pytest.mark.parametrize("compute", [False, True]) 1240s @pytest.mark.parametrize("use_dask", [False, True]) 1240s @pytest.mark.parametrize("write_empty", [False, True, None]) 1240s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1240s if (use_dask or not compute) and not has_dask: 1240s pytest.skip("requires dask") 1240s 1240s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1240s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1240s 1240s if use_dask: 1240s zeros = zeros.chunk(2) 1240s nonzeros = nonzeros.chunk(2) 1240s 1240s with self.create_zarr_target() as store: 1240s zeros.to_zarr( 1240s store, 1240s consolidated=consolidated, 1240s compute=compute, 1240s encoding={"u": dict(chunks=2)}, 1240s **self.version_kwargs, 1240s ) 1240s if compute: 1240s with xr.open_zarr( 1240s store, consolidated=consolidated, **self.version_kwargs 1240s ) as actual: 1240s assert_identical(actual, zeros) 1240s for i in range(0, 10, 2): 1240s region = {"x": slice(i, i + 2)} 1240s > nonzeros.isel(region).to_zarr( 1240s store, 1240s region=region, 1240s consolidated=consolidated, 1240s write_empty_chunks=write_empty, 1240s **self.version_kwargs, 1240s ) 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1240s return to_zarr( # type: ignore[call-overload,misc] 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1240s dump_to_store(dataset, zstore, writer, encoding=encoding) 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1240s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1240s k: self.open_store_variable(name=k) for k in existing_variable_names 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'u' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s _________ TestZarrDictStore.test_write_region[3-None-False-True-False] _________ 1240s 1240s self = 1240s consolidated = False, compute = True, use_dask = False, write_empty = None 1240s 1240s @pytest.mark.parametrize("consolidated", [False, True, None]) 1240s @pytest.mark.parametrize("compute", [False, True]) 1240s @pytest.mark.parametrize("use_dask", [False, True]) 1240s @pytest.mark.parametrize("write_empty", [False, True, None]) 1240s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1240s if (use_dask or not compute) and not has_dask: 1240s pytest.skip("requires dask") 1240s 1240s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1240s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1240s 1240s if use_dask: 1240s zeros = zeros.chunk(2) 1240s nonzeros = nonzeros.chunk(2) 1240s 1240s with self.create_zarr_target() as store: 1240s zeros.to_zarr( 1240s store, 1240s consolidated=consolidated, 1240s compute=compute, 1240s encoding={"u": dict(chunks=2)}, 1240s **self.version_kwargs, 1240s ) 1240s if compute: 1240s > with xr.open_zarr( 1240s store, consolidated=consolidated, **self.version_kwargs 1240s ) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1240s ds = open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'u' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s _________ TestZarrDictStore.test_write_region[3-None-False-True-True] __________ 1240s 1240s self = 1240s consolidated = True, compute = True, use_dask = False, write_empty = None 1240s 1240s @pytest.mark.parametrize("consolidated", [False, True, None]) 1240s @pytest.mark.parametrize("compute", [False, True]) 1240s @pytest.mark.parametrize("use_dask", [False, True]) 1240s @pytest.mark.parametrize("write_empty", [False, True, None]) 1240s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1240s if (use_dask or not compute) and not has_dask: 1240s pytest.skip("requires dask") 1240s 1240s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1240s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1240s 1240s if use_dask: 1240s zeros = zeros.chunk(2) 1240s nonzeros = nonzeros.chunk(2) 1240s 1240s with self.create_zarr_target() as store: 1240s zeros.to_zarr( 1240s store, 1240s consolidated=consolidated, 1240s compute=compute, 1240s encoding={"u": dict(chunks=2)}, 1240s **self.version_kwargs, 1240s ) 1240s if compute: 1240s > with xr.open_zarr( 1240s store, consolidated=consolidated, **self.version_kwargs 1240s ) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1240s ds = open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'u' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s _________ TestZarrDictStore.test_write_region[3-None-False-True-None] __________ 1240s 1240s self = 1240s consolidated = None, compute = True, use_dask = False, write_empty = None 1240s 1240s @pytest.mark.parametrize("consolidated", [False, True, None]) 1240s @pytest.mark.parametrize("compute", [False, True]) 1240s @pytest.mark.parametrize("use_dask", [False, True]) 1240s @pytest.mark.parametrize("write_empty", [False, True, None]) 1240s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1240s if (use_dask or not compute) and not has_dask: 1240s pytest.skip("requires dask") 1240s 1240s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1240s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1240s 1240s if use_dask: 1240s zeros = zeros.chunk(2) 1240s nonzeros = nonzeros.chunk(2) 1240s 1240s with self.create_zarr_target() as store: 1240s zeros.to_zarr( 1240s store, 1240s consolidated=consolidated, 1240s compute=compute, 1240s encoding={"u": dict(chunks=2)}, 1240s **self.version_kwargs, 1240s ) 1240s if compute: 1240s > with xr.open_zarr( 1240s store, consolidated=consolidated, **self.version_kwargs 1240s ) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1240s ds = open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'u' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s _________ TestZarrDictStore.test_write_region[3-None-True-False-False] _________ 1240s 1240s self = 1240s consolidated = False, compute = False, use_dask = True, write_empty = None 1240s 1240s @pytest.mark.parametrize("consolidated", [False, True, None]) 1240s @pytest.mark.parametrize("compute", [False, True]) 1240s @pytest.mark.parametrize("use_dask", [False, True]) 1240s @pytest.mark.parametrize("write_empty", [False, True, None]) 1240s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1240s if (use_dask or not compute) and not has_dask: 1240s pytest.skip("requires dask") 1240s 1240s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1240s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1240s 1240s if use_dask: 1240s zeros = zeros.chunk(2) 1240s nonzeros = nonzeros.chunk(2) 1240s 1240s with self.create_zarr_target() as store: 1240s zeros.to_zarr( 1240s store, 1240s consolidated=consolidated, 1240s compute=compute, 1240s encoding={"u": dict(chunks=2)}, 1240s **self.version_kwargs, 1240s ) 1240s if compute: 1240s with xr.open_zarr( 1240s store, consolidated=consolidated, **self.version_kwargs 1240s ) as actual: 1240s assert_identical(actual, zeros) 1240s for i in range(0, 10, 2): 1240s region = {"x": slice(i, i + 2)} 1240s > nonzeros.isel(region).to_zarr( 1240s store, 1240s region=region, 1240s consolidated=consolidated, 1240s write_empty_chunks=write_empty, 1240s **self.version_kwargs, 1240s ) 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1240s return to_zarr( # type: ignore[call-overload,misc] 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1240s dump_to_store(dataset, zstore, writer, encoding=encoding) 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1240s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1240s k: self.open_store_variable(name=k) for k in existing_variable_names 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'u' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s _________ TestZarrDictStore.test_write_region[3-None-True-False-True] __________ 1240s 1240s self = 1240s consolidated = True, compute = False, use_dask = True, write_empty = None 1240s 1240s @pytest.mark.parametrize("consolidated", [False, True, None]) 1240s @pytest.mark.parametrize("compute", [False, True]) 1240s @pytest.mark.parametrize("use_dask", [False, True]) 1240s @pytest.mark.parametrize("write_empty", [False, True, None]) 1240s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1240s if (use_dask or not compute) and not has_dask: 1240s pytest.skip("requires dask") 1240s 1240s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1240s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1240s 1240s if use_dask: 1240s zeros = zeros.chunk(2) 1240s nonzeros = nonzeros.chunk(2) 1240s 1240s with self.create_zarr_target() as store: 1240s zeros.to_zarr( 1240s store, 1240s consolidated=consolidated, 1240s compute=compute, 1240s encoding={"u": dict(chunks=2)}, 1240s **self.version_kwargs, 1240s ) 1240s if compute: 1240s with xr.open_zarr( 1240s store, consolidated=consolidated, **self.version_kwargs 1240s ) as actual: 1240s assert_identical(actual, zeros) 1240s for i in range(0, 10, 2): 1240s region = {"x": slice(i, i + 2)} 1240s > nonzeros.isel(region).to_zarr( 1240s store, 1240s region=region, 1240s consolidated=consolidated, 1240s write_empty_chunks=write_empty, 1240s **self.version_kwargs, 1240s ) 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1240s return to_zarr( # type: ignore[call-overload,misc] 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1240s dump_to_store(dataset, zstore, writer, encoding=encoding) 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1240s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1240s k: self.open_store_variable(name=k) for k in existing_variable_names 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'u' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s _________ TestZarrDictStore.test_write_region[3-None-True-False-None] __________ 1240s 1240s self = 1240s consolidated = None, compute = False, use_dask = True, write_empty = None 1240s 1240s @pytest.mark.parametrize("consolidated", [False, True, None]) 1240s @pytest.mark.parametrize("compute", [False, True]) 1240s @pytest.mark.parametrize("use_dask", [False, True]) 1240s @pytest.mark.parametrize("write_empty", [False, True, None]) 1240s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1240s if (use_dask or not compute) and not has_dask: 1240s pytest.skip("requires dask") 1240s 1240s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1240s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1240s 1240s if use_dask: 1240s zeros = zeros.chunk(2) 1240s nonzeros = nonzeros.chunk(2) 1240s 1240s with self.create_zarr_target() as store: 1240s zeros.to_zarr( 1240s store, 1240s consolidated=consolidated, 1240s compute=compute, 1240s encoding={"u": dict(chunks=2)}, 1240s **self.version_kwargs, 1240s ) 1240s if compute: 1240s with xr.open_zarr( 1240s store, consolidated=consolidated, **self.version_kwargs 1240s ) as actual: 1240s assert_identical(actual, zeros) 1240s for i in range(0, 10, 2): 1240s region = {"x": slice(i, i + 2)} 1240s > nonzeros.isel(region).to_zarr( 1240s store, 1240s region=region, 1240s consolidated=consolidated, 1240s write_empty_chunks=write_empty, 1240s **self.version_kwargs, 1240s ) 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1240s return to_zarr( # type: ignore[call-overload,misc] 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1240s dump_to_store(dataset, zstore, writer, encoding=encoding) 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1240s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1240s k: self.open_store_variable(name=k) for k in existing_variable_names 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'u' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s _________ TestZarrDictStore.test_write_region[3-None-True-True-False] __________ 1240s 1240s self = 1240s consolidated = False, compute = True, use_dask = True, write_empty = None 1240s 1240s @pytest.mark.parametrize("consolidated", [False, True, None]) 1240s @pytest.mark.parametrize("compute", [False, True]) 1240s @pytest.mark.parametrize("use_dask", [False, True]) 1240s @pytest.mark.parametrize("write_empty", [False, True, None]) 1240s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1240s if (use_dask or not compute) and not has_dask: 1240s pytest.skip("requires dask") 1240s 1240s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1240s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1240s 1240s if use_dask: 1240s zeros = zeros.chunk(2) 1240s nonzeros = nonzeros.chunk(2) 1240s 1240s with self.create_zarr_target() as store: 1240s zeros.to_zarr( 1240s store, 1240s consolidated=consolidated, 1240s compute=compute, 1240s encoding={"u": dict(chunks=2)}, 1240s **self.version_kwargs, 1240s ) 1240s if compute: 1240s > with xr.open_zarr( 1240s store, consolidated=consolidated, **self.version_kwargs 1240s ) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1240s ds = open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'u' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s __________ TestZarrDictStore.test_write_region[3-None-True-True-True] __________ 1240s 1240s self = 1240s consolidated = True, compute = True, use_dask = True, write_empty = None 1240s 1240s @pytest.mark.parametrize("consolidated", [False, True, None]) 1240s @pytest.mark.parametrize("compute", [False, True]) 1240s @pytest.mark.parametrize("use_dask", [False, True]) 1240s @pytest.mark.parametrize("write_empty", [False, True, None]) 1240s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1240s if (use_dask or not compute) and not has_dask: 1240s pytest.skip("requires dask") 1240s 1240s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1240s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1240s 1240s if use_dask: 1240s zeros = zeros.chunk(2) 1240s nonzeros = nonzeros.chunk(2) 1240s 1240s with self.create_zarr_target() as store: 1240s zeros.to_zarr( 1240s store, 1240s consolidated=consolidated, 1240s compute=compute, 1240s encoding={"u": dict(chunks=2)}, 1240s **self.version_kwargs, 1240s ) 1240s if compute: 1240s > with xr.open_zarr( 1240s store, consolidated=consolidated, **self.version_kwargs 1240s ) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1240s ds = open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'u' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s __________ TestZarrDictStore.test_write_region[3-None-True-True-None] __________ 1240s 1240s self = 1240s consolidated = None, compute = True, use_dask = True, write_empty = None 1240s 1240s @pytest.mark.parametrize("consolidated", [False, True, None]) 1240s @pytest.mark.parametrize("compute", [False, True]) 1240s @pytest.mark.parametrize("use_dask", [False, True]) 1240s @pytest.mark.parametrize("write_empty", [False, True, None]) 1240s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1240s if (use_dask or not compute) and not has_dask: 1240s pytest.skip("requires dask") 1240s 1240s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1240s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1240s 1240s if use_dask: 1240s zeros = zeros.chunk(2) 1240s nonzeros = nonzeros.chunk(2) 1240s 1240s with self.create_zarr_target() as store: 1240s zeros.to_zarr( 1240s store, 1240s consolidated=consolidated, 1240s compute=compute, 1240s encoding={"u": dict(chunks=2)}, 1240s **self.version_kwargs, 1240s ) 1240s if compute: 1240s > with xr.open_zarr( 1240s store, consolidated=consolidated, **self.version_kwargs 1240s ) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1240s ds = open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'u' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s _______________ TestZarrDictStore.test_write_region_mode[3-None] _______________ 1240s 1240s self = 1240s mode = None 1240s 1240s @pytest.mark.parametrize("mode", [None, "r+", "a"]) 1240s def test_write_region_mode(self, mode) -> None: 1240s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1240s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1240s with self.create_zarr_target() as store: 1240s zeros.to_zarr(store, **self.version_kwargs) 1240s for region in [{"x": slice(5)}, {"x": slice(5, 10)}]: 1240s > nonzeros.isel(region).to_zarr( 1240s store, region=region, mode=mode, **self.version_kwargs 1240s ) 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3065: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1240s return to_zarr( # type: ignore[call-overload,misc] 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1240s dump_to_store(dataset, zstore, writer, encoding=encoding) 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1240s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1240s k: self.open_store_variable(name=k) for k in existing_variable_names 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'u' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s ________________ TestZarrDictStore.test_write_region_mode[3-r+] ________________ 1240s 1240s self = 1240s mode = 'r+' 1240s 1240s @pytest.mark.parametrize("mode", [None, "r+", "a"]) 1240s def test_write_region_mode(self, mode) -> None: 1240s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1240s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1240s with self.create_zarr_target() as store: 1240s zeros.to_zarr(store, **self.version_kwargs) 1240s for region in [{"x": slice(5)}, {"x": slice(5, 10)}]: 1240s > nonzeros.isel(region).to_zarr( 1240s store, region=region, mode=mode, **self.version_kwargs 1240s ) 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3065: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1240s return to_zarr( # type: ignore[call-overload,misc] 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1240s dump_to_store(dataset, zstore, writer, encoding=encoding) 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1240s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1240s k: self.open_store_variable(name=k) for k in existing_variable_names 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'u' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s ________________ TestZarrDictStore.test_write_region_mode[3-a] _________________ 1240s 1240s self = 1240s mode = 'a' 1240s 1240s @pytest.mark.parametrize("mode", [None, "r+", "a"]) 1240s def test_write_region_mode(self, mode) -> None: 1240s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1240s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1240s with self.create_zarr_target() as store: 1240s zeros.to_zarr(store, **self.version_kwargs) 1240s for region in [{"x": slice(5)}, {"x": slice(5, 10)}]: 1240s > nonzeros.isel(region).to_zarr( 1240s store, region=region, mode=mode, **self.version_kwargs 1240s ) 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3065: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1240s return to_zarr( # type: ignore[call-overload,misc] 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1240s dump_to_store(dataset, zstore, writer, encoding=encoding) 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1240s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1240s k: self.open_store_variable(name=k) for k in existing_variable_names 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'u' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s ________ TestZarrDictStore.test_write_preexisting_override_metadata[3] _________ 1240s 1240s self = 1240s 1240s @requires_dask 1240s def test_write_preexisting_override_metadata(self) -> None: 1240s """Metadata should be overridden if mode="a" but not in mode="r+".""" 1240s original = Dataset( 1240s {"u": (("x",), np.zeros(10), {"variable": "original"})}, 1240s attrs={"global": "original"}, 1240s ) 1240s both_modified = Dataset( 1240s {"u": (("x",), np.ones(10), {"variable": "modified"})}, 1240s attrs={"global": "modified"}, 1240s ) 1240s global_modified = Dataset( 1240s {"u": (("x",), np.ones(10), {"variable": "original"})}, 1240s attrs={"global": "modified"}, 1240s ) 1240s only_new_data = Dataset( 1240s {"u": (("x",), np.ones(10), {"variable": "original"})}, 1240s attrs={"global": "original"}, 1240s ) 1240s 1240s with self.create_zarr_target() as store: 1240s original.to_zarr(store, compute=False, **self.version_kwargs) 1240s > both_modified.to_zarr(store, mode="a", **self.version_kwargs) 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3093: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1240s return to_zarr( # type: ignore[call-overload,misc] 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1240s dump_to_store(dataset, zstore, writer, encoding=encoding) 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1240s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1240s k: self.open_store_variable(name=k) for k in existing_variable_names 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'u' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s ________________ TestZarrDictStore.test_encoding_chunksizes[3] _________________ 1240s 1240s self = 1240s 1240s @requires_dask 1240s def test_encoding_chunksizes(self) -> None: 1240s # regression test for GH2278 1240s # see also test_encoding_chunksizes_unlimited 1240s nx, ny, nt = 4, 4, 5 1240s original = xr.Dataset( 1240s {}, 1240s coords={ 1240s "x": np.arange(nx), 1240s "y": np.arange(ny), 1240s "t": np.arange(nt), 1240s }, 1240s ) 1240s original["v"] = xr.Variable(("x", "y", "t"), np.zeros((nx, ny, nt))) 1240s original = original.chunk({"t": 1, "x": 2, "y": 2}) 1240s 1240s > with self.roundtrip(original) as ds1: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3207: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1240s with self.open(store_target, **open_kwargs) as ds: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'v' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s ______ TestZarrDictStore.test_chunk_encoding_with_partial_dask_chunks[3] _______ 1240s 1240s self = 1240s 1240s @requires_dask 1240s def test_chunk_encoding_with_partial_dask_chunks(self) -> None: 1240s original = xr.Dataset( 1240s {"x": xr.DataArray(np.random.random(size=(6, 8)), dims=("a", "b"))} 1240s ).chunk({"a": 3}) 1240s 1240s > with self.roundtrip( 1240s original, save_kwargs={"encoding": {"x": {"chunks": [3, 2]}}} 1240s ) as ds1: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3218: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1240s with self.open(store_target, **open_kwargs) as ds: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'x' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s ________________ TestZarrDictStore.test_open_zarr_use_cftime[3] ________________ 1240s 1240s self = 1240s 1240s @requires_cftime 1240s def test_open_zarr_use_cftime(self) -> None: 1240s ds = create_test_data() 1240s with self.create_zarr_target() as store_target: 1240s ds.to_zarr(store_target, **self.version_kwargs) 1240s > ds_a = xr.open_zarr(store_target, **self.version_kwargs) 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3237: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1240s ds = open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'dim2' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s ______________ TestZarrDictStore.test_write_read_select_write[3] _______________ 1240s 1240s self = 1240s 1240s def test_write_read_select_write(self) -> None: 1240s # Test for https://github.com/pydata/xarray/issues/4084 1240s ds = create_test_data() 1240s 1240s # NOTE: using self.roundtrip, which uses open_dataset, will not trigger the bug. 1240s with self.create_zarr_target() as initial_store: 1240s ds.to_zarr(initial_store, mode="w", **self.version_kwargs) 1240s > ds1 = xr.open_zarr(initial_store, **self.version_kwargs) 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3252: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1240s ds = open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'dim2' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s __________________ TestZarrDictStore.test_attributes[3-obj1] ___________________ 1240s 1240s self = 1240s obj = Size: 8B 1240s array(nan) 1240s Attributes: 1240s good: {'key': 'value'} 1240s 1240s @pytest.mark.parametrize("obj", [Dataset(), DataArray(name="foo")]) 1240s def test_attributes(self, obj) -> None: 1240s obj = obj.copy() 1240s 1240s obj.attrs["good"] = {"key": "value"} 1240s ds = obj if isinstance(obj, Dataset) else obj.to_dataset() 1240s with self.create_zarr_target() as store_target: 1240s ds.to_zarr(store_target, **self.version_kwargs) 1240s > assert_identical(ds, xr.open_zarr(store_target, **self.version_kwargs)) 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3267: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1240s ds = open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'foo' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s __ TestZarrDictStore.test_chunked_datetime64_or_timedelta64[3-datetime64[ns]] __ 1240s 1240s self = 1240s dtype = 'datetime64[ns]' 1240s 1240s @requires_dask 1240s @pytest.mark.parametrize("dtype", ["datetime64[ns]", "timedelta64[ns]"]) 1240s def test_chunked_datetime64_or_timedelta64(self, dtype) -> None: 1240s # Generalized from @malmans2's test in PR #8253 1240s original = create_test_data().astype(dtype).chunk(1) 1240s > with self.roundtrip( 1240s original, 1240s open_kwargs={ 1240s "chunks": {}, 1240s "decode_timedelta": CFTimedeltaCoder(time_unit="ns"), 1240s }, 1240s ) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3280: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1240s with self.open(store_target, **open_kwargs) as ds: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'dim2' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s _ TestZarrDictStore.test_chunked_datetime64_or_timedelta64[3-timedelta64[ns]] __ 1240s 1240s self = 1240s dtype = 'timedelta64[ns]' 1240s 1240s @requires_dask 1240s @pytest.mark.parametrize("dtype", ["datetime64[ns]", "timedelta64[ns]"]) 1240s def test_chunked_datetime64_or_timedelta64(self, dtype) -> None: 1240s # Generalized from @malmans2's test in PR #8253 1240s original = create_test_data().astype(dtype).chunk(1) 1240s > with self.roundtrip( 1240s original, 1240s open_kwargs={ 1240s "chunks": {}, 1240s "decode_timedelta": CFTimedeltaCoder(time_unit="ns"), 1240s }, 1240s ) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3280: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1240s with self.open(store_target, **open_kwargs) as ds: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'dim2' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s ___________ TestZarrDictStore.test_zarr_fill_value_setting[3-float] ____________ 1240s 1240s self = 1240s dtype = 1240s 1240s @requires_dask 1240s @pytest.mark.parametrize("dtype", [int, float]) 1240s def test_zarr_fill_value_setting(self, dtype): 1240s # When zarr_format=2, _FillValue sets fill_value 1240s # When zarr_format=3, fill_value is set independently 1240s # We test this by writing a dask array with compute=False, 1240s # on read we should receive chunks filled with `fill_value` 1240s fv = -1 1240s ds = xr.Dataset( 1240s {"foo": ("x", dask.array.from_array(np.array([0, 0, 0], dtype=dtype)))} 1240s ) 1240s expected = xr.Dataset({"foo": ("x", [fv] * 3)}) 1240s 1240s zarr_format_2 = ( 1240s has_zarr_v3 and zarr.config.get("default_zarr_format") == 2 1240s ) or not has_zarr_v3 1240s if zarr_format_2: 1240s attr = "_FillValue" 1240s expected.foo.attrs[attr] = fv 1240s else: 1240s attr = "fill_value" 1240s if dtype is float: 1240s # for floats, Xarray inserts a default `np.nan` 1240s expected.foo.attrs["_FillValue"] = np.nan 1240s 1240s # turn off all decoding so we see what Zarr returns to us. 1240s # Since chunks, are not written, we should receive on `fill_value` 1240s open_kwargs = { 1240s "mask_and_scale": False, 1240s "consolidated": False, 1240s "use_zarr_fill_value_as_mask": False, 1240s } 1240s save_kwargs = dict(compute=False, consolidated=False) 1240s > with self.roundtrip( 1240s ds, 1240s save_kwargs=ChainMap(save_kwargs, dict(encoding={"foo": {attr: fv}})), 1240s open_kwargs=open_kwargs, 1240s ) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3374: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1240s with self.open(store_target, **open_kwargs) as ds: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'foo' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s ___________ TestZarrDirectoryStore.test_zero_dimensional_variable[3] ___________ 1240s 1240s self = 1240s 1240s def test_zero_dimensional_variable(self) -> None: 1240s expected = create_test_data() 1240s expected["float_var"] = ([], 1.0e9, {"units": "units of awesome"}) 1240s expected["bytes_var"] = ([], b"foobar") 1240s expected["string_var"] = ([], "foobar") 1240s > with self.roundtrip(expected) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:408: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1240s with self.open(store_target, **open_kwargs) as ds: 1240s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1240s return next(self.gen) 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1240s with xr.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1240s backend_ds = backend.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1240s ds = store_entrypoint.open_dataset( 1240s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1240s vars, attrs = filename_or_obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'dim2' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1240s "chunks": zarr_array.chunks, 1240s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1240s } 1240s 1240s if _zarr_v3(): 1240s encoding.update( 1240s { 1240s "compressors": zarr_array.compressors, 1240s "filters": zarr_array.filters, 1240s "shards": zarr_array.shards, 1240s } 1240s ) 1240s if self.zarr_group.metadata.zarr_format == 3: 1240s encoding.update({"serializer": zarr_array.serializer}) 1240s else: 1240s encoding.update( 1240s { 1240s "compressor": zarr_array.compressor, 1240s "filters": zarr_array.filters, 1240s } 1240s ) 1240s 1240s if self._use_zarr_fill_value_as_mask: 1240s # Setting this attribute triggers CF decoding for missing values 1240s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1240s if zarr_array.fill_value is not None: 1240s attributes["_FillValue"] = zarr_array.fill_value 1240s elif "_FillValue" in attributes: 1240s original_zarr_dtype = zarr_array.metadata.data_type 1240s attributes["_FillValue"] = FillValueCoder.decode( 1240s > attributes["_FillValue"], original_zarr_dtype.value 1240s ) 1240s E AttributeError: 'Float64' object has no attribute 'value' 1240s 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1240s __________________ TestZarrDirectoryStore.test_write_store[3] __________________ 1240s 1240s self = 1240s 1240s def test_write_store(self) -> None: 1240s expected = create_test_data() 1240s with self.create_store() as store: 1240s expected.dump_to_store(store) 1240s # we need to cf decode the store because it has time and 1240s # non-dimension coordinates 1240s > with xr.decode_cf(store) as actual: 1240s 1240s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:417: 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s /usr/lib/python3/dist-packages/xarray/conventions.py:570: in decode_cf 1240s vars, attrs = obj.load() 1240s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1240s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1240s return Frozen(dict(*args, **kwargs)) 1240s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1240s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1240s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1240s 1240s self = , name = 'dim2' 1240s 1240s def open_store_variable(self, name): 1240s zarr_array = self.members[name] 1240s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1240s try_nczarr = self._mode == "r" 1240s dimensions, attributes = _get_zarr_dims_and_attrs( 1240s zarr_array, DIMENSION_KEY, try_nczarr 1240s ) 1240s attributes = dict(attributes) 1240s 1240s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ______________ TestZarrDirectoryStore.test_roundtrip_test_data[3] ______________ 1241s 1241s self = 1241s 1241s def test_roundtrip_test_data(self) -> None: 1241s expected = create_test_data() 1241s > with self.roundtrip(expected) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:441: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _____________________ TestZarrDirectoryStore.test_load[3] ______________________ 1241s 1241s self = 1241s 1241s def test_load(self) -> None: 1241s expected = create_test_data() 1241s 1241s @contextlib.contextmanager 1241s def assert_loads(vars=None): 1241s if vars is None: 1241s vars = expected 1241s with self.roundtrip(expected) as actual: 1241s for k, v in actual.variables.items(): 1241s # IndexVariables are eagerly loaded into memory 1241s assert v._in_memory == (k in actual.dims) 1241s yield actual 1241s for k, v in actual.variables.items(): 1241s if k in vars: 1241s assert v._in_memory 1241s assert_identical(expected, actual) 1241s 1241s with pytest.raises(AssertionError): 1241s # make sure the contextmanager works! 1241s > with assert_loads() as ds: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:464: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:452: in assert_loads 1241s with self.roundtrip(expected) as actual: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ________________ TestZarrDirectoryStore.test_dataset_compute[3] ________________ 1241s 1241s self = 1241s 1241s def test_dataset_compute(self) -> None: 1241s expected = create_test_data() 1241s 1241s > with self.roundtrip(expected) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:481: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ____________ TestZarrDirectoryStore.test_roundtrip_object_dtype[3] _____________ 1241s 1241s self = 1241s 1241s def test_roundtrip_object_dtype(self) -> None: 1241s floats = np.array([0.0, 0.0, 1.0, 2.0, 3.0], dtype=object) 1241s floats_nans = np.array([np.nan, np.nan, 1.0, 2.0, 3.0], dtype=object) 1241s bytes_ = np.array([b"ab", b"cdef", b"g"], dtype=object) 1241s bytes_nans = np.array([b"ab", b"cdef", np.nan], dtype=object) 1241s strings = np.array(["ab", "cdef", "g"], dtype=object) 1241s strings_nans = np.array(["ab", "cdef", np.nan], dtype=object) 1241s all_nans = np.array([np.nan, np.nan], dtype=object) 1241s original = Dataset( 1241s { 1241s "floats": ("a", floats), 1241s "floats_nans": ("a", floats_nans), 1241s "bytes": ("b", bytes_), 1241s "bytes_nans": ("b", bytes_nans), 1241s "strings": ("b", strings), 1241s "strings_nans": ("b", strings_nans), 1241s "all_nans": ("c", all_nans), 1241s "nan": ([], np.nan), 1241s } 1241s ) 1241s expected = original.copy(deep=True) 1241s > with self.roundtrip(original) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:558: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'nan' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ____________ TestZarrDirectoryStore.test_roundtrip_float64_data[3] _____________ 1241s 1241s self = 1241s 1241s def test_roundtrip_float64_data(self) -> None: 1241s expected = Dataset({"x": ("y", np.array([1.0, 2.0, np.pi], dtype="float64"))}) 1241s > with self.roundtrip(expected) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:646: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'x' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ______________ TestZarrDirectoryStore.test_orthogonal_indexing[3] ______________ 1241s 1241s self = 1241s 1241s def test_orthogonal_indexing(self) -> None: 1241s in_memory = create_test_data() 1241s > with self.roundtrip(in_memory) as on_disk: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:713: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ______________ TestZarrDirectoryStore.test_vectorized_indexing[3] ______________ 1241s 1241s self = 1241s 1241s def test_vectorized_indexing(self) -> None: 1241s in_memory = create_test_data() 1241s > with self.roundtrip(in_memory) as on_disk: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:727: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _______ TestZarrDirectoryStore.test_vectorized_indexing_negative_step[3] _______ 1241s 1241s self = 1241s 1241s def test_vectorized_indexing_negative_step(self) -> None: 1241s # use dask explicitly when present 1241s open_kwargs: dict[str, Any] | None 1241s if has_dask: 1241s open_kwargs = {"chunks": {}} 1241s else: 1241s open_kwargs = None 1241s in_memory = create_test_data() 1241s 1241s def multiple_indexing(indexers): 1241s # make sure a sequence of lazy indexings certainly works. 1241s with self.roundtrip(in_memory, open_kwargs=open_kwargs) as on_disk: 1241s actual = on_disk["var3"] 1241s expected = in_memory["var3"] 1241s for ind in indexers: 1241s actual = actual.isel(ind) 1241s expected = expected.isel(ind) 1241s # make sure the array is not yet loaded into memory 1241s assert not actual.variable._in_memory 1241s assert_identical(expected, actual.load()) 1241s 1241s # with negative step slice. 1241s indexers = [ 1241s { 1241s "dim1": DataArray([[0, 7], [2, 6], [3, 5]], dims=["a", "b"]), 1241s "dim3": slice(-1, 1, -1), 1241s } 1241s ] 1241s > multiple_indexing(indexers) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:817: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:800: in multiple_indexing 1241s with self.roundtrip(in_memory, open_kwargs=open_kwargs) as on_disk: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ____________ TestZarrDirectoryStore.test_outer_indexing_reversed[3] ____________ 1241s 1241s self = 1241s 1241s def test_outer_indexing_reversed(self) -> None: 1241s # regression test for GH6560 1241s ds = xr.Dataset( 1241s {"z": (("t", "p", "y", "x"), np.ones((1, 1, 31, 40)))}, 1241s ) 1241s 1241s > with self.roundtrip(ds) as on_disk: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:834: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'z' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ________________ TestZarrDirectoryStore.test_isel_dataarray[3] _________________ 1241s 1241s self = 1241s 1241s def test_isel_dataarray(self) -> None: 1241s # Make sure isel works lazily. GH:issue:1688 1241s in_memory = create_test_data() 1241s > with self.roundtrip(in_memory) as on_disk: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:841: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ___________ TestZarrDirectoryStore.test_array_type_after_indexing[3] ___________ 1241s 1241s self = 1241s 1241s def test_array_type_after_indexing(self) -> None: 1241s in_memory = create_test_data() 1241s > with self.roundtrip(in_memory) as on_disk: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:868: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ____________________ TestZarrDirectoryStore.test_dropna[3] _____________________ 1241s 1241s self = 1241s 1241s def test_dropna(self) -> None: 1241s # regression test for GH:issue:1694 1241s a = np.random.randn(4, 3) 1241s a[1, 1] = np.nan 1241s in_memory = xr.Dataset( 1241s {"a": (("y", "x"), a)}, coords={"y": np.arange(4), "x": np.arange(3)} 1241s ) 1241s 1241s assert_identical( 1241s in_memory.dropna(dim="x"), in_memory.isel(x=slice(None, None, 2)) 1241s ) 1241s 1241s > with self.roundtrip(in_memory) as on_disk: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:893: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'a' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ______________ TestZarrDirectoryStore.test_ondisk_after_print[3] _______________ 1241s 1241s self = 1241s 1241s def test_ondisk_after_print(self) -> None: 1241s """Make sure print does not load file into memory""" 1241s in_memory = create_test_data() 1241s > with self.roundtrip(in_memory) as on_disk: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:902: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ________ TestZarrDirectoryStore.test_roundtrip_bytes_with_fill_value[3] ________ 1241s 1241s self = 1241s 1241s def test_roundtrip_bytes_with_fill_value(self) -> None: 1241s values = np.array([b"ab", b"cdef", np.nan], dtype=object) 1241s encoding = {"_FillValue": b"X", "dtype": "S1"} 1241s original = Dataset({"x": ("t", values, {}, encoding)}) 1241s expected = original.copy(deep=True) 1241s > with self.roundtrip(original) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:913: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'x' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'NullTerminatedBytes' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _____ TestZarrDirectoryStore.test_roundtrip_unsigned[3-fill_value0-False] ______ 1241s 1241s self = 1241s fill_value = np.int8(-1), exp_fill_warning = False 1241s 1241s @pytest.mark.parametrize( 1241s ("fill_value", "exp_fill_warning"), 1241s [ 1241s (np.int8(-1), False), 1241s (np.uint8(255), True), 1241s (-1, False), 1241s (255, True), 1241s ], 1241s ) 1241s def test_roundtrip_unsigned(self, fill_value, exp_fill_warning): 1241s @contextlib.contextmanager 1241s def _roundtrip_with_warnings(*args, **kwargs): 1241s is_np2 = module_available("numpy", minversion="2.0.0.dev0") 1241s if exp_fill_warning and is_np2: 1241s warn_checker: contextlib.AbstractContextManager = pytest.warns( 1241s SerializationWarning, 1241s match="_FillValue attribute can't be represented", 1241s ) 1241s else: 1241s warn_checker = contextlib.nullcontext() 1241s with warn_checker: 1241s with self.roundtrip(*args, **kwargs) as actual: 1241s yield actual 1241s 1241s # regression/numpy2 test for 1241s encoding = { 1241s "_FillValue": fill_value, 1241s "_Unsigned": "true", 1241s "dtype": "i1", 1241s } 1241s x = np.array([0, 1, 127, 128, 254, np.nan], dtype=np.float32) 1241s decoded = Dataset({"x": ("t", x, {}, encoding)}) 1241s 1241s attributes = { 1241s "_FillValue": fill_value, 1241s "_Unsigned": "true", 1241s } 1241s # Create unsigned data corresponding to [0, 1, 127, 128, 255] unsigned 1241s sb = np.asarray([0, 1, 127, -128, -2, -1], dtype="i1") 1241s encoded = Dataset({"x": ("t", sb, attributes)}) 1241s unsigned_dtype = np.dtype(f"u{sb.dtype.itemsize}") 1241s 1241s > with _roundtrip_with_warnings(decoded) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1066: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1045: in _roundtrip_with_warnings 1241s with self.roundtrip(*args, **kwargs) as actual: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'x' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Int8' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ______ TestZarrDirectoryStore.test_roundtrip_unsigned[3-fill_value1-True] ______ 1241s 1241s self = 1241s fill_value = np.uint8(255), exp_fill_warning = True 1241s 1241s @pytest.mark.parametrize( 1241s ("fill_value", "exp_fill_warning"), 1241s [ 1241s (np.int8(-1), False), 1241s (np.uint8(255), True), 1241s (-1, False), 1241s (255, True), 1241s ], 1241s ) 1241s def test_roundtrip_unsigned(self, fill_value, exp_fill_warning): 1241s @contextlib.contextmanager 1241s def _roundtrip_with_warnings(*args, **kwargs): 1241s is_np2 = module_available("numpy", minversion="2.0.0.dev0") 1241s if exp_fill_warning and is_np2: 1241s warn_checker: contextlib.AbstractContextManager = pytest.warns( 1241s SerializationWarning, 1241s match="_FillValue attribute can't be represented", 1241s ) 1241s else: 1241s warn_checker = contextlib.nullcontext() 1241s with warn_checker: 1241s with self.roundtrip(*args, **kwargs) as actual: 1241s yield actual 1241s 1241s # regression/numpy2 test for 1241s encoding = { 1241s "_FillValue": fill_value, 1241s "_Unsigned": "true", 1241s "dtype": "i1", 1241s } 1241s x = np.array([0, 1, 127, 128, 254, np.nan], dtype=np.float32) 1241s decoded = Dataset({"x": ("t", x, {}, encoding)}) 1241s 1241s attributes = { 1241s "_FillValue": fill_value, 1241s "_Unsigned": "true", 1241s } 1241s # Create unsigned data corresponding to [0, 1, 127, 128, 255] unsigned 1241s sb = np.asarray([0, 1, 127, -128, -2, -1], dtype="i1") 1241s encoded = Dataset({"x": ("t", sb, attributes)}) 1241s unsigned_dtype = np.dtype(f"u{sb.dtype.itemsize}") 1241s 1241s > with _roundtrip_with_warnings(decoded) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1066: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1045: in _roundtrip_with_warnings 1241s with self.roundtrip(*args, **kwargs) as actual: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'x' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Int8' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s __________ TestZarrDirectoryStore.test_roundtrip_unsigned[3--1-False] __________ 1241s 1241s self = 1241s fill_value = -1, exp_fill_warning = False 1241s 1241s @pytest.mark.parametrize( 1241s ("fill_value", "exp_fill_warning"), 1241s [ 1241s (np.int8(-1), False), 1241s (np.uint8(255), True), 1241s (-1, False), 1241s (255, True), 1241s ], 1241s ) 1241s def test_roundtrip_unsigned(self, fill_value, exp_fill_warning): 1241s @contextlib.contextmanager 1241s def _roundtrip_with_warnings(*args, **kwargs): 1241s is_np2 = module_available("numpy", minversion="2.0.0.dev0") 1241s if exp_fill_warning and is_np2: 1241s warn_checker: contextlib.AbstractContextManager = pytest.warns( 1241s SerializationWarning, 1241s match="_FillValue attribute can't be represented", 1241s ) 1241s else: 1241s warn_checker = contextlib.nullcontext() 1241s with warn_checker: 1241s with self.roundtrip(*args, **kwargs) as actual: 1241s yield actual 1241s 1241s # regression/numpy2 test for 1241s encoding = { 1241s "_FillValue": fill_value, 1241s "_Unsigned": "true", 1241s "dtype": "i1", 1241s } 1241s x = np.array([0, 1, 127, 128, 254, np.nan], dtype=np.float32) 1241s decoded = Dataset({"x": ("t", x, {}, encoding)}) 1241s 1241s attributes = { 1241s "_FillValue": fill_value, 1241s "_Unsigned": "true", 1241s } 1241s # Create unsigned data corresponding to [0, 1, 127, 128, 255] unsigned 1241s sb = np.asarray([0, 1, 127, -128, -2, -1], dtype="i1") 1241s encoded = Dataset({"x": ("t", sb, attributes)}) 1241s unsigned_dtype = np.dtype(f"u{sb.dtype.itemsize}") 1241s 1241s > with _roundtrip_with_warnings(decoded) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1066: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1045: in _roundtrip_with_warnings 1241s with self.roundtrip(*args, **kwargs) as actual: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'x' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Int8' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s __________ TestZarrDirectoryStore.test_roundtrip_unsigned[3-255-True] __________ 1241s 1241s self = 1241s fill_value = 255, exp_fill_warning = True 1241s 1241s @pytest.mark.parametrize( 1241s ("fill_value", "exp_fill_warning"), 1241s [ 1241s (np.int8(-1), False), 1241s (np.uint8(255), True), 1241s (-1, False), 1241s (255, True), 1241s ], 1241s ) 1241s def test_roundtrip_unsigned(self, fill_value, exp_fill_warning): 1241s @contextlib.contextmanager 1241s def _roundtrip_with_warnings(*args, **kwargs): 1241s is_np2 = module_available("numpy", minversion="2.0.0.dev0") 1241s if exp_fill_warning and is_np2: 1241s warn_checker: contextlib.AbstractContextManager = pytest.warns( 1241s SerializationWarning, 1241s match="_FillValue attribute can't be represented", 1241s ) 1241s else: 1241s warn_checker = contextlib.nullcontext() 1241s with warn_checker: 1241s with self.roundtrip(*args, **kwargs) as actual: 1241s yield actual 1241s 1241s # regression/numpy2 test for 1241s encoding = { 1241s "_FillValue": fill_value, 1241s "_Unsigned": "true", 1241s "dtype": "i1", 1241s } 1241s x = np.array([0, 1, 127, 128, 254, np.nan], dtype=np.float32) 1241s decoded = Dataset({"x": ("t", x, {}, encoding)}) 1241s 1241s attributes = { 1241s "_FillValue": fill_value, 1241s "_Unsigned": "true", 1241s } 1241s # Create unsigned data corresponding to [0, 1, 127, 128, 255] unsigned 1241s sb = np.asarray([0, 1, 127, -128, -2, -1], dtype="i1") 1241s encoded = Dataset({"x": ("t", sb, attributes)}) 1241s unsigned_dtype = np.dtype(f"u{sb.dtype.itemsize}") 1241s 1241s > with _roundtrip_with_warnings(decoded) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1066: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1045: in _roundtrip_with_warnings 1241s with self.roundtrip(*args, **kwargs) as actual: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'x' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Int8' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _ TestZarrDirectoryStore.test_grid_mapping_and_bounds_are_not_coordinates_in_file[3] _ 1241s 1241s self = 1241s 1241s def test_grid_mapping_and_bounds_are_not_coordinates_in_file(self) -> None: 1241s original = self._create_cf_dataset() 1241s > with self.roundtrip(original, open_kwargs={"decode_coords": False}) as ds: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1142: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = 1241s name = 'det_lim' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _ TestZarrDirectoryStore.test_coordinate_variables_after_dataset_roundtrip[3] __ 1241s 1241s self = 1241s 1241s def test_coordinate_variables_after_dataset_roundtrip(self) -> None: 1241s original = self._create_cf_dataset() 1241s > with self.roundtrip(original, open_kwargs={"decode_coords": "all"}) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1150: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = 1241s name = 'det_lim' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _ TestZarrDirectoryStore.test_grid_mapping_and_bounds_are_coordinates_after_dataarray_roundtrip[3] _ 1241s 1241s self = 1241s 1241s def test_grid_mapping_and_bounds_are_coordinates_after_dataarray_roundtrip( 1241s self, 1241s ) -> None: 1241s original = self._create_cf_dataset() 1241s # The DataArray roundtrip should have the same warnings as the 1241s # Dataset, but we already tested for those, so just go for the 1241s # new warnings. It would appear that there is no way to tell 1241s # pytest "This warning and also this warning should both be 1241s # present". 1241s # xarray/tests/test_conventions.py::TestCFEncodedDataStore 1241s # needs the to_dataset. The other backends should be fine 1241s # without it. 1241s with pytest.warns( 1241s UserWarning, 1241s match=( 1241s r"Variable\(s\) referenced in bounds not in variables: " 1241s r"\['l(at|ong)itude_bnds'\]" 1241s ), 1241s ): 1241s > with self.roundtrip( 1241s original["variable"].to_dataset(), open_kwargs={"decode_coords": "all"} 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1182: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'ln_p' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s 1241s During handling of the above exception, another exception occurred: 1241s 1241s self = 1241s 1241s def test_grid_mapping_and_bounds_are_coordinates_after_dataarray_roundtrip( 1241s self, 1241s ) -> None: 1241s original = self._create_cf_dataset() 1241s # The DataArray roundtrip should have the same warnings as the 1241s # Dataset, but we already tested for those, so just go for the 1241s # new warnings. It would appear that there is no way to tell 1241s # pytest "This warning and also this warning should both be 1241s # present". 1241s # xarray/tests/test_conventions.py::TestCFEncodedDataStore 1241s # needs the to_dataset. The other backends should be fine 1241s # without it. 1241s > with pytest.warns( 1241s UserWarning, 1241s match=( 1241s r"Variable\(s\) referenced in bounds not in variables: " 1241s r"\['l(at|ong)itude_bnds'\]" 1241s ), 1241s ): 1241s E Failed: DID NOT WARN. No warnings of type (,) matching the regex were emitted. 1241s E Regex: Variable\(s\) referenced in bounds not in variables: \['l(at|ong)itude_bnds'\] 1241s E Emitted warnings: [ ZarrUserWarning('Consolidated metadata is currently not part in the Zarr format 3 specification. It may not be supported by other zarr implementations and may change in the future.')]. 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1175: Failed 1241s ________________ TestZarrDirectoryStore.test_encoding_kwarg[3] _________________ 1241s 1241s self = 1241s 1241s def test_encoding_kwarg(self) -> None: 1241s ds = Dataset({"x": ("y", np.arange(10.0))}) 1241s 1241s kwargs: dict[str, Any] = dict(encoding={"x": {"dtype": "f4"}}) 1241s > with self.roundtrip(ds, save_kwargs=kwargs) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1277: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'x' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float32' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ______________ TestZarrDirectoryStore.test_default_fill_value[3] _______________ 1241s 1241s self = 1241s 1241s def test_default_fill_value(self) -> None: 1241s # Test default encoding for float: 1241s ds = Dataset({"x": ("y", np.arange(10.0))}) 1241s kwargs = dict(encoding={"x": {"dtype": "f4"}}) 1241s > with self.roundtrip(ds, save_kwargs=kwargs) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1319: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'x' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float32' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ______ TestZarrDirectoryStore.test_explicitly_omit_fill_value_in_coord[3] ______ 1241s 1241s self = 1241s 1241s def test_explicitly_omit_fill_value_in_coord(self) -> None: 1241s ds = Dataset({"x": ("y", [np.pi, -np.pi])}, coords={"y": [0.0, 1.0]}) 1241s ds.y.encoding["_FillValue"] = None 1241s > with self.roundtrip(ds) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1355: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'x' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _ TestZarrDirectoryStore.test_explicitly_omit_fill_value_in_coord_via_encoding_kwarg[3] _ 1241s 1241s self = 1241s 1241s def test_explicitly_omit_fill_value_in_coord_via_encoding_kwarg(self) -> None: 1241s ds = Dataset({"x": ("y", [np.pi, -np.pi])}, coords={"y": [0.0, 1.0]}) 1241s kwargs = dict(encoding={"y": {"_FillValue": None}}) 1241s > with self.roundtrip(ds, save_kwargs=kwargs) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1361: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'x' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ______________ TestZarrDirectoryStore.test_encoding_same_dtype[3] ______________ 1241s 1241s self = 1241s 1241s def test_encoding_same_dtype(self) -> None: 1241s ds = Dataset({"x": ("y", np.arange(10.0, dtype="f4"))}) 1241s kwargs = dict(encoding={"x": {"dtype": "f4"}}) 1241s > with self.roundtrip(ds, save_kwargs=kwargs) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1368: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'x' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float32' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ____________ TestZarrDirectoryStore.test_append_overwrite_values[3] ____________ 1241s 1241s self = 1241s 1241s def test_append_overwrite_values(self) -> None: 1241s # regression for GH1215 1241s data = create_test_data() 1241s with create_tmp_file(allow_cleanup_failure=False) as tmp_file: 1241s self.save(data, tmp_file, mode="w") 1241s data["var2"][:] = -999 1241s data["var9"] = data["var2"] * 3 1241s > self.save(data[["var2", "var9"]], tmp_file, mode="a") 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1387: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2296: in save 1241s return dataset.to_zarr(store=store_target, **kwargs, **self.version_kwargs) 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _________ TestZarrDirectoryStore.test_roundtrip_consolidated[3-False] __________ 1241s 1241s self = 1241s consolidated = False 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s def test_roundtrip_consolidated(self, consolidated) -> None: 1241s expected = create_test_data() 1241s > with self.roundtrip( 1241s expected, 1241s save_kwargs={"consolidated": consolidated}, 1241s open_kwargs={"backend_kwargs": {"consolidated": consolidated}}, 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2321: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s __________ TestZarrDirectoryStore.test_roundtrip_consolidated[3-True] __________ 1241s 1241s self = 1241s consolidated = True 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s def test_roundtrip_consolidated(self, consolidated) -> None: 1241s expected = create_test_data() 1241s > with self.roundtrip( 1241s expected, 1241s save_kwargs={"consolidated": consolidated}, 1241s open_kwargs={"backend_kwargs": {"consolidated": consolidated}}, 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2321: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s __________ TestZarrDirectoryStore.test_roundtrip_consolidated[3-None] __________ 1241s 1241s self = 1241s consolidated = None 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s def test_roundtrip_consolidated(self, consolidated) -> None: 1241s expected = create_test_data() 1241s > with self.roundtrip( 1241s expected, 1241s save_kwargs={"consolidated": consolidated}, 1241s open_kwargs={"backend_kwargs": {"consolidated": consolidated}}, 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2321: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _________ TestZarrDirectoryStore.test_read_non_consolidated_warning[3] _________ 1241s 1241s self = 1241s 1241s def test_read_non_consolidated_warning(self) -> None: 1241s expected = create_test_data() 1241s with self.create_zarr_target() as store: 1241s self.save( 1241s expected, store_target=store, consolidated=False, **self.version_kwargs 1241s ) 1241s with pytest.warns( 1241s RuntimeWarning, 1241s match="Failed to open Zarr store with consolidated", 1241s ): 1241s > with xr.open_zarr(store, **self.version_kwargs) as ds: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2339: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1241s ds = open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ______________ TestZarrDirectoryStore.test_non_existent_store[3] _______________ 1241s 1241s self = 1241s 1241s def test_non_existent_store(self) -> None: 1241s with pytest.raises( 1241s FileNotFoundError, match="(No such file or directory|Unable to find group)" 1241s ): 1241s > xr.open_zarr(f"{uuid.uuid4()}") 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2346: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1241s ds = open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1608: in open_dataset 1241s store = ZarrStore.open_group( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:732: in open_group 1241s ) = _get_open_params( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1811: in _get_open_params 1241s zarr_root_group = zarr.open_consolidated(store, **open_kwargs) 1241s /usr/lib/python3/dist-packages/zarr/api/synchronous.py:231: in open_consolidated 1241s sync(async_api.open_consolidated(*args, use_consolidated=use_consolidated, **kwargs)) 1241s /usr/lib/python3/dist-packages/zarr/core/sync.py:163: in sync 1241s raise return_result 1241s /usr/lib/python3/dist-packages/zarr/core/sync.py:119: in _runner 1241s return await coro 1241s /usr/lib/python3/dist-packages/zarr/api/asynchronous.py:408: in open_consolidated 1241s return await open_group(*args, use_consolidated=use_consolidated, **kwargs) 1241s /usr/lib/python3/dist-packages/zarr/api/asynchronous.py:851: in open_group 1241s store_path = await make_store_path(store, mode=mode, storage_options=storage_options, path=path) 1241s /usr/lib/python3/dist-packages/zarr/storage/_common.py:418: in make_store_path 1241s store = await make_store(store_like, mode=mode, storage_options=storage_options) 1241s /usr/lib/python3/dist-packages/zarr/storage/_common.py:349: in make_store 1241s return await make_store(Path(store_like), mode=mode, storage_options=storage_options) 1241s /usr/lib/python3/dist-packages/zarr/storage/_common.py:339: in make_store 1241s return await LocalStore.open(root=store_like, mode=mode, read_only=_read_only) 1241s /usr/lib/python3/dist-packages/zarr/storage/_local.py:160: in open 1241s await store._open() 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = LocalStore('file:///tmp/autopkgtest.cdpOi4/autopkgtest_tmp/build/dddce352-73ba-4258-9c14-432060fa33c5') 1241s 1241s async def _open(self, *, mode: AccessModeLiteral | None = None) -> None: 1241s if not self.read_only: 1241s self.root.mkdir(parents=True, exist_ok=True) 1241s 1241s if not self.root.exists(): 1241s > raise FileNotFoundError(f"{self.root} does not exist") 1241s E FileNotFoundError: /tmp/autopkgtest.cdpOi4/autopkgtest_tmp/build/dddce352-73ba-4258-9c14-432060fa33c5 does not exist 1241s 1241s /usr/lib/python3/dist-packages/zarr/storage/_local.py:172: FileNotFoundError 1241s 1241s During handling of the above exception, another exception occurred: 1241s 1241s self = 1241s 1241s def test_non_existent_store(self) -> None: 1241s > with pytest.raises( 1241s FileNotFoundError, match="(No such file or directory|Unable to find group)" 1241s ): 1241s E AssertionError: Regex pattern did not match. 1241s E Regex: '(No such file or directory|Unable to find group)' 1241s E Input: '/tmp/autopkgtest.cdpOi4/autopkgtest_tmp/build/dddce352-73ba-4258-9c14-432060fa33c5 does not exist' 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2343: AssertionError 1241s __________________ TestZarrDirectoryStore.test_auto_chunk[3] ___________________ 1241s 1241s self = 1241s 1241s @requires_dask 1241s def test_auto_chunk(self) -> None: 1241s original = create_test_data().chunk() 1241s 1241s > with self.roundtrip(original, open_kwargs={"chunks": None}) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2367: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _________________ TestZarrDirectoryStore.test_manual_chunk[3] __________________ 1241s 1241s self = 1241s 1241s @requires_dask 1241s @pytest.mark.filterwarnings("ignore:The specified chunks separate:UserWarning") 1241s def test_manual_chunk(self) -> None: 1241s original = create_test_data().chunk({"dim1": 3, "dim2": 4, "dim3": 3}) 1241s 1241s # Using chunks = None should return non-chunked arrays 1241s open_kwargs: dict[str, Any] = {"chunks": None} 1241s > with self.roundtrip(original, open_kwargs=open_kwargs) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2388: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _____________ TestZarrDirectoryStore.test_warning_on_bad_chunks[3] _____________ 1241s 1241s self = 1241s 1241s @requires_dask 1241s def test_warning_on_bad_chunks(self) -> None: 1241s original = create_test_data().chunk({"dim1": 4, "dim2": 3, "dim3": 3}) 1241s 1241s bad_chunks = (2, {"dim2": (3, 3, 2, 1)}) 1241s for chunks in bad_chunks: 1241s kwargs = {"chunks": chunks} 1241s with pytest.warns(UserWarning): 1241s > with self.roundtrip(original, open_kwargs=kwargs) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2433: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ___________ TestZarrDirectoryStore.test_write_uneven_dask_chunks[3] ____________ 1241s 1241s self = 1241s 1241s @requires_dask 1241s def test_write_uneven_dask_chunks(self) -> None: 1241s # regression for GH#2225 1241s original = create_test_data().chunk({"dim1": 3, "dim2": 4, "dim3": 3}) 1241s > with self.roundtrip(original, open_kwargs={"chunks": {}}) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2476: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ________________ TestZarrDirectoryStore.test_chunk_encoding[3] _________________ 1241s 1241s self = 1241s 1241s def test_chunk_encoding(self) -> None: 1241s # These datasets have no dask chunks. All chunking specified in 1241s # encoding 1241s data = create_test_data() 1241s chunks = (5, 5) 1241s data["var2"].encoding.update({"chunks": chunks}) 1241s 1241s > with self.roundtrip(data) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2487: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ________________ TestZarrDirectoryStore.test_shard_encoding[3] _________________ 1241s 1241s self = 1241s 1241s def test_shard_encoding(self) -> None: 1241s # These datasets have no dask chunks. All chunking/sharding specified in 1241s # encoding 1241s if has_zarr_v3 and zarr.config.config["default_zarr_format"] == 3: 1241s data = create_test_data() 1241s chunks = (1, 1) 1241s shards = (5, 5) 1241s data["var2"].encoding.update({"chunks": chunks}) 1241s data["var2"].encoding.update({"shards": shards}) 1241s > with self.roundtrip(data) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2505: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _________ TestZarrDirectoryStore.test_write_persistence_modes[3-None] __________ 1241s 1241s self = 1241s group = None 1241s 1241s @pytest.mark.parametrize("group", [None, "group1"]) 1241s def test_write_persistence_modes(self, group) -> None: 1241s original = create_test_data() 1241s 1241s # overwrite mode 1241s > with self.roundtrip( 1241s original, 1241s save_kwargs={"mode": "w", "group": group}, 1241s open_kwargs={"group": group}, 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2650: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ________ TestZarrDirectoryStore.test_write_persistence_modes[3-group1] _________ 1241s 1241s self = 1241s group = 'group1' 1241s 1241s @pytest.mark.parametrize("group", [None, "group1"]) 1241s def test_write_persistence_modes(self, group) -> None: 1241s original = create_test_data() 1241s 1241s # overwrite mode 1241s > with self.roundtrip( 1241s original, 1241s save_kwargs={"mode": "w", "group": group}, 1241s open_kwargs={"group": group}, 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2650: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ______________ TestZarrDirectoryStore.test_compressor_encoding[3] ______________ 1241s 1241s self = 1241s 1241s def test_compressor_encoding(self) -> None: 1241s # specify a custom compressor 1241s original = create_test_data() 1241s if has_zarr_v3 and zarr.config.config["default_zarr_format"] == 3: 1241s encoding_key = "compressors" 1241s # all parameters need to be explicitly specified in order for the comparison to pass below 1241s encoding = { 1241s "serializer": zarr.codecs.BytesCodec(endian="little"), 1241s encoding_key: ( 1241s zarr.codecs.BloscCodec( 1241s cname="zstd", 1241s clevel=3, 1241s shuffle="shuffle", 1241s typesize=8, 1241s blocksize=0, 1241s ), 1241s ), 1241s } 1241s else: 1241s from numcodecs.blosc import Blosc 1241s 1241s encoding_key = "compressors" if has_zarr_v3 else "compressor" 1241s comp = Blosc(cname="zstd", clevel=3, shuffle=2) 1241s encoding = {encoding_key: (comp,) if has_zarr_v3 else comp} 1241s 1241s save_kwargs = dict(encoding={"var1": encoding}) 1241s 1241s > with self.roundtrip(original, save_kwargs=save_kwargs) as ds: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2723: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _____________________ TestZarrDirectoryStore.test_group[3] _____________________ 1241s 1241s self = 1241s 1241s def test_group(self) -> None: 1241s original = create_test_data() 1241s group = "some/random/path" 1241s > with self.roundtrip( 1241s original, save_kwargs={"group": group}, open_kwargs={"group": group} 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2730: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _________________ TestZarrDirectoryStore.test_append_write[3] __________________ 1241s 1241s self = 1241s 1241s def test_append_write(self) -> None: 1241s > super().test_append_write() 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2762: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1377: in test_append_write 1241s with self.roundtrip_append(data) as actual: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:388: in roundtrip_append 1241s self.save(data[[key]], path, mode=mode, **save_kwargs) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2296: in save 1241s return dataset.to_zarr(store=store_target, **kwargs, **self.version_kwargs) 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _____ TestZarrDirectoryStore.test_append_with_append_dim_not_set_raises[3] _____ 1241s 1241s self = 1241s 1241s def test_append_with_append_dim_not_set_raises(self) -> None: 1241s ds, ds_to_append, _ = create_append_test_data() 1241s with self.create_zarr_target() as store_target: 1241s ds.to_zarr(store_target, mode="w", **self.version_kwargs) 1241s with pytest.raises(ValueError, match="different dimension sizes"): 1241s > ds_to_append.to_zarr(store_target, mode="a", **self.version_kwargs) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2809: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'da' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _____ TestZarrDirectoryStore.test_append_string_length_mismatch_works[3-U] _____ 1241s 1241s self = 1241s dtype = 'U' 1241s 1241s @pytest.mark.parametrize("dtype", ["U", "S"]) 1241s def test_append_string_length_mismatch_works(self, dtype) -> None: 1241s skip_if_zarr_format_2("This doesn't work with Zarr format 2") 1241s # ...but it probably would if we used object dtype 1241s ds, ds_to_append = create_append_string_length_mismatch_test_data(dtype) 1241s expected = xr.concat([ds, ds_to_append], dim="time") 1241s with self.create_zarr_target() as store_target: 1241s ds.to_zarr(store_target, mode="w", **self.version_kwargs) 1241s > ds_to_append.to_zarr(store_target, append_dim="time", **self.version_kwargs) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2851: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1018: in store 1241s _validate_datatypes_for_zarr_append( 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s vname = 'temperature' 1241s existing_var = Size: 24B 1241s [3 values with dtype= Size: 60B 1241s array(['abc', 'def', 'ghijk'], dtype=' raise ValueError( 1241s f"Mismatched dtypes for variable {vname} between Zarr store on disk " 1241s f"and dataset to append. Store has dtype {existing_var.dtype} but " 1241s f"dataset to append has dtype {new_var.dtype}." 1241s ) 1241s E ValueError: Mismatched dtypes for variable temperature between Zarr store on disk and dataset to append. Store has dtype 1241s dtype = 'S' 1241s 1241s @pytest.mark.parametrize("dtype", ["U", "S"]) 1241s def test_append_string_length_mismatch_works(self, dtype) -> None: 1241s skip_if_zarr_format_2("This doesn't work with Zarr format 2") 1241s # ...but it probably would if we used object dtype 1241s ds, ds_to_append = create_append_string_length_mismatch_test_data(dtype) 1241s expected = xr.concat([ds, ds_to_append], dim="time") 1241s with self.create_zarr_target() as store_target: 1241s ds.to_zarr(store_target, mode="w", **self.version_kwargs) 1241s > ds_to_append.to_zarr(store_target, append_dim="time", **self.version_kwargs) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2851: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1018: in store 1241s _validate_datatypes_for_zarr_append( 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s vname = 'temperature' 1241s existing_var = Size: 6B 1241s [3 values with dtype=|S2] 1241s new_var = Size: 9B 1241s array([b'aaa', b'bbb', b'ccc'], dtype='|S3') 1241s 1241s def _validate_datatypes_for_zarr_append(vname, existing_var, new_var): 1241s """If variable exists in the store, confirm dtype of the data to append is compatible with 1241s existing dtype. 1241s """ 1241s if ( 1241s np.issubdtype(new_var.dtype, np.number) 1241s or np.issubdtype(new_var.dtype, np.datetime64) 1241s or np.issubdtype(new_var.dtype, np.bool_) 1241s or new_var.dtype == object 1241s or (new_var.dtype.kind in ("S", "U") and existing_var.dtype == object) 1241s ): 1241s # We can skip dtype equality checks under two conditions: (1) if the var to append is 1241s # new to the dataset, because in this case there is no existing var to compare it to; 1241s # or (2) if var to append's dtype is known to be easy-to-append, because in this case 1241s # we can be confident appending won't cause problems. Examples of dtypes which are not 1241s # easy-to-append include length-specified strings of type `|S*` or ` raise ValueError( 1241s f"Mismatched dtypes for variable {vname} between Zarr store on disk " 1241s f"and dataset to append. Store has dtype {existing_var.dtype} but " 1241s f"dataset to append has dtype {new_var.dtype}." 1241s ) 1241s E ValueError: Mismatched dtypes for variable temperature between Zarr store on disk and dataset to append. Store has dtype |S2 but dataset to append has dtype |S3. 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:566: ValueError 1241s ___ TestZarrDirectoryStore.test_check_encoding_is_consistent_after_append[3] ___ 1241s 1241s self = 1241s 1241s def test_check_encoding_is_consistent_after_append(self) -> None: 1241s ds, ds_to_append, _ = create_append_test_data() 1241s 1241s # check encoding consistency 1241s with self.create_zarr_target() as store_target: 1241s import numcodecs 1241s 1241s encoding_value: Any 1241s if has_zarr_v3 and zarr.config.config["default_zarr_format"] == 3: 1241s compressor = zarr.codecs.BloscCodec() 1241s else: 1241s compressor = numcodecs.Blosc() 1241s encoding_key = "compressors" if has_zarr_v3 else "compressor" 1241s encoding_value = (compressor,) if has_zarr_v3 else compressor 1241s 1241s encoding = {"da": {encoding_key: encoding_value}} 1241s ds.to_zarr(store_target, mode="w", encoding=encoding, **self.version_kwargs) 1241s > original_ds = xr.open_dataset( 1241s store_target, engine="zarr", **self.version_kwargs 1241s ) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2872: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'da' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ___________ TestZarrDirectoryStore.test_append_with_new_variable[3] ____________ 1241s 1241s self = 1241s 1241s def test_append_with_new_variable(self) -> None: 1241s ds, ds_to_append, ds_with_new_var = create_append_test_data() 1241s 1241s # check append mode for new variable 1241s with self.create_zarr_target() as store_target: 1241s combined = xr.concat([ds, ds_to_append], dim="time") 1241s combined.to_zarr(store_target, mode="w", **self.version_kwargs) 1241s assert_identical( 1241s combined, 1241s > xr.open_dataset(store_target, engine="zarr", **self.version_kwargs), 1241s ) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2899: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'da' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ______ TestZarrDirectoryStore.test_append_with_append_dim_no_overwrite[3] ______ 1241s 1241s self = 1241s 1241s def test_append_with_append_dim_no_overwrite(self) -> None: 1241s ds, ds_to_append, _ = create_append_test_data() 1241s with self.create_zarr_target() as store_target: 1241s ds.to_zarr(store_target, mode="w", **self.version_kwargs) 1241s original = xr.concat([ds, ds_to_append], dim="time") 1241s original2 = xr.concat([original, ds_to_append], dim="time") 1241s 1241s # overwrite a coordinate; 1241s # for mode='a-', this will not get written to the store 1241s # because it does not have the append_dim as a dim 1241s lon = ds_to_append.lon.to_numpy().copy() 1241s lon[:] = -999 1241s ds_to_append["lon"] = lon 1241s > ds_to_append.to_zarr( 1241s store_target, mode="a-", append_dim="time", **self.version_kwargs 1241s ) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2922: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'da' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ________ TestZarrDirectoryStore.test_to_zarr_compute_false_roundtrip[3] ________ 1241s 1241s self = 1241s 1241s @requires_dask 1241s def test_to_zarr_compute_false_roundtrip(self) -> None: 1241s from dask.delayed import Delayed 1241s 1241s original = create_test_data().chunk() 1241s 1241s with self.create_zarr_target() as store: 1241s delayed_obj = self.save(original, store, compute=False) 1241s assert isinstance(delayed_obj, Delayed) 1241s 1241s # make sure target store has not been written to yet 1241s with pytest.raises(AssertionError): 1241s > with self.open(store) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2948: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ____ TestZarrDirectoryStore.test_to_zarr_append_compute_false_roundtrip[3] _____ 1241s 1241s self = 1241s 1241s @requires_dask 1241s def test_to_zarr_append_compute_false_roundtrip(self) -> None: 1241s from dask.delayed import Delayed 1241s 1241s ds, ds_to_append, _ = create_append_test_data() 1241s ds, ds_to_append = ds.chunk(), ds_to_append.chunk() 1241s 1241s with pytest.warns(SerializationWarning): 1241s with self.create_zarr_target() as store: 1241s delayed_obj = self.save(ds, store, compute=False, mode="w") 1241s assert isinstance(delayed_obj, Delayed) 1241s 1241s with pytest.raises(AssertionError): 1241s > with self.open(store) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2969: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'da' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ______________ TestZarrDirectoryStore.test_save_emptydim[3-False] ______________ 1241s 1241s self = 1241s chunk = False 1241s 1241s @pytest.mark.parametrize("chunk", [False, True]) 1241s def test_save_emptydim(self, chunk) -> None: 1241s if chunk and not has_dask: 1241s pytest.skip("requires dask") 1241s ds = Dataset({"x": (("a", "b"), np.empty((5, 0))), "y": ("a", [1, 2, 5, 8, 9])}) 1241s if chunk: 1241s ds = ds.chunk({}) # chunk dataset to save dask array 1241s > with self.roundtrip(ds) as ds_reload: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3000: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'x' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ______________ TestZarrDirectoryStore.test_save_emptydim[3-True] _______________ 1241s 1241s self = 1241s chunk = True 1241s 1241s @pytest.mark.parametrize("chunk", [False, True]) 1241s def test_save_emptydim(self, chunk) -> None: 1241s if chunk and not has_dask: 1241s pytest.skip("requires dask") 1241s ds = Dataset({"x": (("a", "b"), np.empty((5, 0))), "y": ("a", [1, 2, 5, 8, 9])}) 1241s if chunk: 1241s ds = ds.chunk({}) # chunk dataset to save dask array 1241s > with self.roundtrip(ds) as ds_reload: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3000: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'x' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ___ TestZarrDirectoryStore.test_no_warning_from_open_emptydim_with_chunks[3] ___ 1241s 1241s self = 1241s 1241s @requires_dask 1241s def test_no_warning_from_open_emptydim_with_chunks(self) -> None: 1241s ds = Dataset({"x": (("a", "b"), np.empty((5, 0)))}).chunk({"a": 1}) 1241s with assert_no_warnings(): 1241s with warnings.catch_warnings(): 1241s warnings.filterwarnings( 1241s "ignore", 1241s message=".*Zarr format 3 specification.*", 1241s category=UserWarning, 1241s ) 1241s > with self.roundtrip(ds, open_kwargs=dict(chunks={"a": 1})) as ds_reload: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3013: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'x' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _____ TestZarrDirectoryStore.test_write_region[3-False-False-False-False] ______ 1241s 1241s self = 1241s consolidated = False, compute = False, use_dask = False, write_empty = False 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s assert_identical(actual, zeros) 1241s for i in range(0, 10, 2): 1241s region = {"x": slice(i, i + 2)} 1241s > nonzeros.isel(region).to_zarr( 1241s store, 1241s region=region, 1241s consolidated=consolidated, 1241s write_empty_chunks=write_empty, 1241s **self.version_kwargs, 1241s ) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ______ TestZarrDirectoryStore.test_write_region[3-False-False-False-True] ______ 1241s 1241s self = 1241s consolidated = True, compute = False, use_dask = False, write_empty = False 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s assert_identical(actual, zeros) 1241s for i in range(0, 10, 2): 1241s region = {"x": slice(i, i + 2)} 1241s > nonzeros.isel(region).to_zarr( 1241s store, 1241s region=region, 1241s consolidated=consolidated, 1241s write_empty_chunks=write_empty, 1241s **self.version_kwargs, 1241s ) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ______ TestZarrDirectoryStore.test_write_region[3-False-False-False-None] ______ 1241s 1241s self = 1241s consolidated = None, compute = False, use_dask = False, write_empty = False 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s assert_identical(actual, zeros) 1241s for i in range(0, 10, 2): 1241s region = {"x": slice(i, i + 2)} 1241s > nonzeros.isel(region).to_zarr( 1241s store, 1241s region=region, 1241s consolidated=consolidated, 1241s write_empty_chunks=write_empty, 1241s **self.version_kwargs, 1241s ) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ______ TestZarrDirectoryStore.test_write_region[3-False-False-True-False] ______ 1241s 1241s self = 1241s consolidated = False, compute = True, use_dask = False, write_empty = False 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s > with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1241s ds = open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ______ TestZarrDirectoryStore.test_write_region[3-False-False-True-True] _______ 1241s 1241s self = 1241s consolidated = True, compute = True, use_dask = False, write_empty = False 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s > with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1241s ds = open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ______ TestZarrDirectoryStore.test_write_region[3-False-False-True-None] _______ 1241s 1241s self = 1241s consolidated = None, compute = True, use_dask = False, write_empty = False 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s > with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1241s ds = open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ______ TestZarrDirectoryStore.test_write_region[3-False-True-False-False] ______ 1241s 1241s self = 1241s consolidated = False, compute = False, use_dask = True, write_empty = False 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s assert_identical(actual, zeros) 1241s for i in range(0, 10, 2): 1241s region = {"x": slice(i, i + 2)} 1241s > nonzeros.isel(region).to_zarr( 1241s store, 1241s region=region, 1241s consolidated=consolidated, 1241s write_empty_chunks=write_empty, 1241s **self.version_kwargs, 1241s ) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ______ TestZarrDirectoryStore.test_write_region[3-False-True-False-True] _______ 1241s 1241s self = 1241s consolidated = True, compute = False, use_dask = True, write_empty = False 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s assert_identical(actual, zeros) 1241s for i in range(0, 10, 2): 1241s region = {"x": slice(i, i + 2)} 1241s > nonzeros.isel(region).to_zarr( 1241s store, 1241s region=region, 1241s consolidated=consolidated, 1241s write_empty_chunks=write_empty, 1241s **self.version_kwargs, 1241s ) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ______ TestZarrDirectoryStore.test_write_region[3-False-True-False-None] _______ 1241s 1241s self = 1241s consolidated = None, compute = False, use_dask = True, write_empty = False 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s assert_identical(actual, zeros) 1241s for i in range(0, 10, 2): 1241s region = {"x": slice(i, i + 2)} 1241s > nonzeros.isel(region).to_zarr( 1241s store, 1241s region=region, 1241s consolidated=consolidated, 1241s write_empty_chunks=write_empty, 1241s **self.version_kwargs, 1241s ) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ______ TestZarrDirectoryStore.test_write_region[3-False-True-True-False] _______ 1241s 1241s self = 1241s consolidated = False, compute = True, use_dask = True, write_empty = False 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s > with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1241s ds = open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _______ TestZarrDirectoryStore.test_write_region[3-False-True-True-True] _______ 1241s 1241s self = 1241s consolidated = True, compute = True, use_dask = True, write_empty = False 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s > with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1241s ds = open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _______ TestZarrDirectoryStore.test_write_region[3-False-True-True-None] _______ 1241s 1241s self = 1241s consolidated = None, compute = True, use_dask = True, write_empty = False 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s > with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1241s ds = open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ______ TestZarrDirectoryStore.test_write_region[3-True-False-False-False] ______ 1241s 1241s self = 1241s consolidated = False, compute = False, use_dask = False, write_empty = True 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s assert_identical(actual, zeros) 1241s for i in range(0, 10, 2): 1241s region = {"x": slice(i, i + 2)} 1241s > nonzeros.isel(region).to_zarr( 1241s store, 1241s region=region, 1241s consolidated=consolidated, 1241s write_empty_chunks=write_empty, 1241s **self.version_kwargs, 1241s ) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ______ TestZarrDirectoryStore.test_write_region[3-True-False-False-True] _______ 1241s 1241s self = 1241s consolidated = True, compute = False, use_dask = False, write_empty = True 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s assert_identical(actual, zeros) 1241s for i in range(0, 10, 2): 1241s region = {"x": slice(i, i + 2)} 1241s > nonzeros.isel(region).to_zarr( 1241s store, 1241s region=region, 1241s consolidated=consolidated, 1241s write_empty_chunks=write_empty, 1241s **self.version_kwargs, 1241s ) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ______ TestZarrDirectoryStore.test_write_region[3-True-False-False-None] _______ 1241s 1241s self = 1241s consolidated = None, compute = False, use_dask = False, write_empty = True 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s assert_identical(actual, zeros) 1241s for i in range(0, 10, 2): 1241s region = {"x": slice(i, i + 2)} 1241s > nonzeros.isel(region).to_zarr( 1241s store, 1241s region=region, 1241s consolidated=consolidated, 1241s write_empty_chunks=write_empty, 1241s **self.version_kwargs, 1241s ) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ______ TestZarrDirectoryStore.test_write_region[3-True-False-True-False] _______ 1241s 1241s self = 1241s consolidated = False, compute = True, use_dask = False, write_empty = True 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s > with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1241s ds = open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _______ TestZarrDirectoryStore.test_write_region[3-True-False-True-True] _______ 1241s 1241s self = 1241s consolidated = True, compute = True, use_dask = False, write_empty = True 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s > with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1241s ds = open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _______ TestZarrDirectoryStore.test_write_region[3-True-False-True-None] _______ 1241s 1241s self = 1241s consolidated = None, compute = True, use_dask = False, write_empty = True 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s > with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1241s ds = open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ______ TestZarrDirectoryStore.test_write_region[3-True-True-False-False] _______ 1241s 1241s self = 1241s consolidated = False, compute = False, use_dask = True, write_empty = True 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s assert_identical(actual, zeros) 1241s for i in range(0, 10, 2): 1241s region = {"x": slice(i, i + 2)} 1241s > nonzeros.isel(region).to_zarr( 1241s store, 1241s region=region, 1241s consolidated=consolidated, 1241s write_empty_chunks=write_empty, 1241s **self.version_kwargs, 1241s ) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _______ TestZarrDirectoryStore.test_write_region[3-True-True-False-True] _______ 1241s 1241s self = 1241s consolidated = True, compute = False, use_dask = True, write_empty = True 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s assert_identical(actual, zeros) 1241s for i in range(0, 10, 2): 1241s region = {"x": slice(i, i + 2)} 1241s > nonzeros.isel(region).to_zarr( 1241s store, 1241s region=region, 1241s consolidated=consolidated, 1241s write_empty_chunks=write_empty, 1241s **self.version_kwargs, 1241s ) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _______ TestZarrDirectoryStore.test_write_region[3-True-True-False-None] _______ 1241s 1241s self = 1241s consolidated = None, compute = False, use_dask = True, write_empty = True 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s assert_identical(actual, zeros) 1241s for i in range(0, 10, 2): 1241s region = {"x": slice(i, i + 2)} 1241s > nonzeros.isel(region).to_zarr( 1241s store, 1241s region=region, 1241s consolidated=consolidated, 1241s write_empty_chunks=write_empty, 1241s **self.version_kwargs, 1241s ) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _______ TestZarrDirectoryStore.test_write_region[3-True-True-True-False] _______ 1241s 1241s self = 1241s consolidated = False, compute = True, use_dask = True, write_empty = True 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s > with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1241s ds = open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _______ TestZarrDirectoryStore.test_write_region[3-True-True-True-True] ________ 1241s 1241s self = 1241s consolidated = True, compute = True, use_dask = True, write_empty = True 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s > with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1241s ds = open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _______ TestZarrDirectoryStore.test_write_region[3-True-True-True-None] ________ 1241s 1241s self = 1241s consolidated = None, compute = True, use_dask = True, write_empty = True 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s > with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1241s ds = open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ______ TestZarrDirectoryStore.test_write_region[3-None-False-False-False] ______ 1241s 1241s self = 1241s consolidated = False, compute = False, use_dask = False, write_empty = None 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s assert_identical(actual, zeros) 1241s for i in range(0, 10, 2): 1241s region = {"x": slice(i, i + 2)} 1241s > nonzeros.isel(region).to_zarr( 1241s store, 1241s region=region, 1241s consolidated=consolidated, 1241s write_empty_chunks=write_empty, 1241s **self.version_kwargs, 1241s ) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ______ TestZarrDirectoryStore.test_write_region[3-None-False-False-True] _______ 1241s 1241s self = 1241s consolidated = True, compute = False, use_dask = False, write_empty = None 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s assert_identical(actual, zeros) 1241s for i in range(0, 10, 2): 1241s region = {"x": slice(i, i + 2)} 1241s > nonzeros.isel(region).to_zarr( 1241s store, 1241s region=region, 1241s consolidated=consolidated, 1241s write_empty_chunks=write_empty, 1241s **self.version_kwargs, 1241s ) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ______ TestZarrDirectoryStore.test_write_region[3-None-False-False-None] _______ 1241s 1241s self = 1241s consolidated = None, compute = False, use_dask = False, write_empty = None 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s assert_identical(actual, zeros) 1241s for i in range(0, 10, 2): 1241s region = {"x": slice(i, i + 2)} 1241s > nonzeros.isel(region).to_zarr( 1241s store, 1241s region=region, 1241s consolidated=consolidated, 1241s write_empty_chunks=write_empty, 1241s **self.version_kwargs, 1241s ) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ______ TestZarrDirectoryStore.test_write_region[3-None-False-True-False] _______ 1241s 1241s self = 1241s consolidated = False, compute = True, use_dask = False, write_empty = None 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s > with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1241s ds = open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _______ TestZarrDirectoryStore.test_write_region[3-None-False-True-True] _______ 1241s 1241s self = 1241s consolidated = True, compute = True, use_dask = False, write_empty = None 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s > with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1241s ds = open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _______ TestZarrDirectoryStore.test_write_region[3-None-False-True-None] _______ 1241s 1241s self = 1241s consolidated = None, compute = True, use_dask = False, write_empty = None 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s > with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1241s ds = open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ______ TestZarrDirectoryStore.test_write_region[3-None-True-False-False] _______ 1241s 1241s self = 1241s consolidated = False, compute = False, use_dask = True, write_empty = None 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s assert_identical(actual, zeros) 1241s for i in range(0, 10, 2): 1241s region = {"x": slice(i, i + 2)} 1241s > nonzeros.isel(region).to_zarr( 1241s store, 1241s region=region, 1241s consolidated=consolidated, 1241s write_empty_chunks=write_empty, 1241s **self.version_kwargs, 1241s ) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _______ TestZarrDirectoryStore.test_write_region[3-None-True-False-True] _______ 1241s 1241s self = 1241s consolidated = True, compute = False, use_dask = True, write_empty = None 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s assert_identical(actual, zeros) 1241s for i in range(0, 10, 2): 1241s region = {"x": slice(i, i + 2)} 1241s > nonzeros.isel(region).to_zarr( 1241s store, 1241s region=region, 1241s consolidated=consolidated, 1241s write_empty_chunks=write_empty, 1241s **self.version_kwargs, 1241s ) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _______ TestZarrDirectoryStore.test_write_region[3-None-True-False-None] _______ 1241s 1241s self = 1241s consolidated = None, compute = False, use_dask = True, write_empty = None 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s assert_identical(actual, zeros) 1241s for i in range(0, 10, 2): 1241s region = {"x": slice(i, i + 2)} 1241s > nonzeros.isel(region).to_zarr( 1241s store, 1241s region=region, 1241s consolidated=consolidated, 1241s write_empty_chunks=write_empty, 1241s **self.version_kwargs, 1241s ) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _______ TestZarrDirectoryStore.test_write_region[3-None-True-True-False] _______ 1241s 1241s self = 1241s consolidated = False, compute = True, use_dask = True, write_empty = None 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s > with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1241s ds = open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _______ TestZarrDirectoryStore.test_write_region[3-None-True-True-True] ________ 1241s 1241s self = 1241s consolidated = True, compute = True, use_dask = True, write_empty = None 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s > with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1241s ds = open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _______ TestZarrDirectoryStore.test_write_region[3-None-True-True-None] ________ 1241s 1241s self = 1241s consolidated = None, compute = True, use_dask = True, write_empty = None 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s > with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1241s ds = open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ____________ TestZarrDirectoryStore.test_write_region_mode[3-None] _____________ 1241s 1241s self = 1241s mode = None 1241s 1241s @pytest.mark.parametrize("mode", [None, "r+", "a"]) 1241s def test_write_region_mode(self, mode) -> None: 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr(store, **self.version_kwargs) 1241s for region in [{"x": slice(5)}, {"x": slice(5, 10)}]: 1241s > nonzeros.isel(region).to_zarr( 1241s store, region=region, mode=mode, **self.version_kwargs 1241s ) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3065: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _____________ TestZarrDirectoryStore.test_write_region_mode[3-r+] ______________ 1241s 1241s self = 1241s mode = 'r+' 1241s 1241s @pytest.mark.parametrize("mode", [None, "r+", "a"]) 1241s def test_write_region_mode(self, mode) -> None: 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr(store, **self.version_kwargs) 1241s for region in [{"x": slice(5)}, {"x": slice(5, 10)}]: 1241s > nonzeros.isel(region).to_zarr( 1241s store, region=region, mode=mode, **self.version_kwargs 1241s ) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3065: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ______________ TestZarrDirectoryStore.test_write_region_mode[3-a] ______________ 1241s 1241s self = 1241s mode = 'a' 1241s 1241s @pytest.mark.parametrize("mode", [None, "r+", "a"]) 1241s def test_write_region_mode(self, mode) -> None: 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr(store, **self.version_kwargs) 1241s for region in [{"x": slice(5)}, {"x": slice(5, 10)}]: 1241s > nonzeros.isel(region).to_zarr( 1241s store, region=region, mode=mode, **self.version_kwargs 1241s ) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3065: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ______ TestZarrDirectoryStore.test_write_preexisting_override_metadata[3] ______ 1241s 1241s self = 1241s 1241s @requires_dask 1241s def test_write_preexisting_override_metadata(self) -> None: 1241s """Metadata should be overridden if mode="a" but not in mode="r+".""" 1241s original = Dataset( 1241s {"u": (("x",), np.zeros(10), {"variable": "original"})}, 1241s attrs={"global": "original"}, 1241s ) 1241s both_modified = Dataset( 1241s {"u": (("x",), np.ones(10), {"variable": "modified"})}, 1241s attrs={"global": "modified"}, 1241s ) 1241s global_modified = Dataset( 1241s {"u": (("x",), np.ones(10), {"variable": "original"})}, 1241s attrs={"global": "modified"}, 1241s ) 1241s only_new_data = Dataset( 1241s {"u": (("x",), np.ones(10), {"variable": "original"})}, 1241s attrs={"global": "original"}, 1241s ) 1241s 1241s with self.create_zarr_target() as store: 1241s original.to_zarr(store, compute=False, **self.version_kwargs) 1241s > both_modified.to_zarr(store, mode="a", **self.version_kwargs) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3093: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ______________ TestZarrDirectoryStore.test_encoding_chunksizes[3] ______________ 1241s 1241s self = 1241s 1241s @requires_dask 1241s def test_encoding_chunksizes(self) -> None: 1241s # regression test for GH2278 1241s # see also test_encoding_chunksizes_unlimited 1241s nx, ny, nt = 4, 4, 5 1241s original = xr.Dataset( 1241s {}, 1241s coords={ 1241s "x": np.arange(nx), 1241s "y": np.arange(ny), 1241s "t": np.arange(nt), 1241s }, 1241s ) 1241s original["v"] = xr.Variable(("x", "y", "t"), np.zeros((nx, ny, nt))) 1241s original = original.chunk({"t": 1, "x": 2, "y": 2}) 1241s 1241s > with self.roundtrip(original) as ds1: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3207: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'v' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ____ TestZarrDirectoryStore.test_chunk_encoding_with_partial_dask_chunks[3] ____ 1241s 1241s self = 1241s 1241s @requires_dask 1241s def test_chunk_encoding_with_partial_dask_chunks(self) -> None: 1241s original = xr.Dataset( 1241s {"x": xr.DataArray(np.random.random(size=(6, 8)), dims=("a", "b"))} 1241s ).chunk({"a": 3}) 1241s 1241s > with self.roundtrip( 1241s original, save_kwargs={"encoding": {"x": {"chunks": [3, 2]}}} 1241s ) as ds1: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3218: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'x' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _____________ TestZarrDirectoryStore.test_open_zarr_use_cftime[3] ______________ 1241s 1241s self = 1241s 1241s @requires_cftime 1241s def test_open_zarr_use_cftime(self) -> None: 1241s ds = create_test_data() 1241s with self.create_zarr_target() as store_target: 1241s ds.to_zarr(store_target, **self.version_kwargs) 1241s > ds_a = xr.open_zarr(store_target, **self.version_kwargs) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3237: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1241s ds = open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ____________ TestZarrDirectoryStore.test_write_read_select_write[3] ____________ 1241s 1241s self = 1241s 1241s def test_write_read_select_write(self) -> None: 1241s # Test for https://github.com/pydata/xarray/issues/4084 1241s ds = create_test_data() 1241s 1241s # NOTE: using self.roundtrip, which uses open_dataset, will not trigger the bug. 1241s with self.create_zarr_target() as initial_store: 1241s ds.to_zarr(initial_store, mode="w", **self.version_kwargs) 1241s > ds1 = xr.open_zarr(initial_store, **self.version_kwargs) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3252: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1241s ds = open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ________________ TestZarrDirectoryStore.test_attributes[3-obj1] ________________ 1241s 1241s self = 1241s obj = Size: 8B 1241s array(nan) 1241s Attributes: 1241s good: {'key': 'value'} 1241s 1241s @pytest.mark.parametrize("obj", [Dataset(), DataArray(name="foo")]) 1241s def test_attributes(self, obj) -> None: 1241s obj = obj.copy() 1241s 1241s obj.attrs["good"] = {"key": "value"} 1241s ds = obj if isinstance(obj, Dataset) else obj.to_dataset() 1241s with self.create_zarr_target() as store_target: 1241s ds.to_zarr(store_target, **self.version_kwargs) 1241s > assert_identical(ds, xr.open_zarr(store_target, **self.version_kwargs)) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3267: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1241s ds = open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'foo' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _ TestZarrDirectoryStore.test_chunked_datetime64_or_timedelta64[3-datetime64[ns]] _ 1241s 1241s self = 1241s dtype = 'datetime64[ns]' 1241s 1241s @requires_dask 1241s @pytest.mark.parametrize("dtype", ["datetime64[ns]", "timedelta64[ns]"]) 1241s def test_chunked_datetime64_or_timedelta64(self, dtype) -> None: 1241s # Generalized from @malmans2's test in PR #8253 1241s original = create_test_data().astype(dtype).chunk(1) 1241s > with self.roundtrip( 1241s original, 1241s open_kwargs={ 1241s "chunks": {}, 1241s "decode_timedelta": CFTimedeltaCoder(time_unit="ns"), 1241s }, 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3280: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _ TestZarrDirectoryStore.test_chunked_datetime64_or_timedelta64[3-timedelta64[ns]] _ 1241s 1241s self = 1241s dtype = 'timedelta64[ns]' 1241s 1241s @requires_dask 1241s @pytest.mark.parametrize("dtype", ["datetime64[ns]", "timedelta64[ns]"]) 1241s def test_chunked_datetime64_or_timedelta64(self, dtype) -> None: 1241s # Generalized from @malmans2's test in PR #8253 1241s original = create_test_data().astype(dtype).chunk(1) 1241s > with self.roundtrip( 1241s original, 1241s open_kwargs={ 1241s "chunks": {}, 1241s "decode_timedelta": CFTimedeltaCoder(time_unit="ns"), 1241s }, 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3280: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _________ TestZarrDirectoryStore.test_zarr_fill_value_setting[3-float] _________ 1241s 1241s self = 1241s dtype = 1241s 1241s @requires_dask 1241s @pytest.mark.parametrize("dtype", [int, float]) 1241s def test_zarr_fill_value_setting(self, dtype): 1241s # When zarr_format=2, _FillValue sets fill_value 1241s # When zarr_format=3, fill_value is set independently 1241s # We test this by writing a dask array with compute=False, 1241s # on read we should receive chunks filled with `fill_value` 1241s fv = -1 1241s ds = xr.Dataset( 1241s {"foo": ("x", dask.array.from_array(np.array([0, 0, 0], dtype=dtype)))} 1241s ) 1241s expected = xr.Dataset({"foo": ("x", [fv] * 3)}) 1241s 1241s zarr_format_2 = ( 1241s has_zarr_v3 and zarr.config.get("default_zarr_format") == 2 1241s ) or not has_zarr_v3 1241s if zarr_format_2: 1241s attr = "_FillValue" 1241s expected.foo.attrs[attr] = fv 1241s else: 1241s attr = "fill_value" 1241s if dtype is float: 1241s # for floats, Xarray inserts a default `np.nan` 1241s expected.foo.attrs["_FillValue"] = np.nan 1241s 1241s # turn off all decoding so we see what Zarr returns to us. 1241s # Since chunks, are not written, we should receive on `fill_value` 1241s open_kwargs = { 1241s "mask_and_scale": False, 1241s "consolidated": False, 1241s "use_zarr_fill_value_as_mask": False, 1241s } 1241s save_kwargs = dict(compute=False, consolidated=False) 1241s > with self.roundtrip( 1241s ds, 1241s save_kwargs=ChainMap(save_kwargs, dict(encoding={"foo": {attr: fv}})), 1241s open_kwargs=open_kwargs, 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3374: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'foo' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _____________ TestZarrWriteEmpty.test_zero_dimensional_variable[3] _____________ 1241s 1241s self = 1241s 1241s def test_zero_dimensional_variable(self) -> None: 1241s expected = create_test_data() 1241s expected["float_var"] = ([], 1.0e9, {"units": "units of awesome"}) 1241s expected["bytes_var"] = ([], b"foobar") 1241s expected["string_var"] = ([], "foobar") 1241s > with self.roundtrip(expected) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:408: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ____________________ TestZarrWriteEmpty.test_write_store[3] ____________________ 1241s 1241s self = 1241s 1241s def test_write_store(self) -> None: 1241s expected = create_test_data() 1241s with self.create_store() as store: 1241s expected.dump_to_store(store) 1241s # we need to cf decode the store because it has time and 1241s # non-dimension coordinates 1241s > with xr.decode_cf(store) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:417: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/conventions.py:570: in decode_cf 1241s vars, attrs = obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'var2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ________________ TestZarrWriteEmpty.test_roundtrip_test_data[3] ________________ 1241s 1241s self = 1241s 1241s def test_roundtrip_test_data(self) -> None: 1241s expected = create_test_data() 1241s > with self.roundtrip(expected) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:441: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _______________________ TestZarrWriteEmpty.test_load[3] ________________________ 1241s 1241s self = 1241s 1241s def test_load(self) -> None: 1241s expected = create_test_data() 1241s 1241s @contextlib.contextmanager 1241s def assert_loads(vars=None): 1241s if vars is None: 1241s vars = expected 1241s with self.roundtrip(expected) as actual: 1241s for k, v in actual.variables.items(): 1241s # IndexVariables are eagerly loaded into memory 1241s assert v._in_memory == (k in actual.dims) 1241s yield actual 1241s for k, v in actual.variables.items(): 1241s if k in vars: 1241s assert v._in_memory 1241s assert_identical(expected, actual) 1241s 1241s with pytest.raises(AssertionError): 1241s # make sure the contextmanager works! 1241s > with assert_loads() as ds: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:464: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:452: in assert_loads 1241s with self.roundtrip(expected) as actual: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s __________________ TestZarrWriteEmpty.test_dataset_compute[3] __________________ 1241s 1241s self = 1241s 1241s def test_dataset_compute(self) -> None: 1241s expected = create_test_data() 1241s 1241s > with self.roundtrip(expected) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:481: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ______________ TestZarrWriteEmpty.test_roundtrip_object_dtype[3] _______________ 1241s 1241s self = 1241s 1241s def test_roundtrip_object_dtype(self) -> None: 1241s floats = np.array([0.0, 0.0, 1.0, 2.0, 3.0], dtype=object) 1241s floats_nans = np.array([np.nan, np.nan, 1.0, 2.0, 3.0], dtype=object) 1241s bytes_ = np.array([b"ab", b"cdef", b"g"], dtype=object) 1241s bytes_nans = np.array([b"ab", b"cdef", np.nan], dtype=object) 1241s strings = np.array(["ab", "cdef", "g"], dtype=object) 1241s strings_nans = np.array(["ab", "cdef", np.nan], dtype=object) 1241s all_nans = np.array([np.nan, np.nan], dtype=object) 1241s original = Dataset( 1241s { 1241s "floats": ("a", floats), 1241s "floats_nans": ("a", floats_nans), 1241s "bytes": ("b", bytes_), 1241s "bytes_nans": ("b", bytes_nans), 1241s "strings": ("b", strings), 1241s "strings_nans": ("b", strings_nans), 1241s "all_nans": ("c", all_nans), 1241s "nan": ([], np.nan), 1241s } 1241s ) 1241s expected = original.copy(deep=True) 1241s > with self.roundtrip(original) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:558: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'nan' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ______________ TestZarrWriteEmpty.test_roundtrip_float64_data[3] _______________ 1241s 1241s self = 1241s 1241s def test_roundtrip_float64_data(self) -> None: 1241s expected = Dataset({"x": ("y", np.array([1.0, 2.0, np.pi], dtype="float64"))}) 1241s > with self.roundtrip(expected) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:646: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'x' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ________________ TestZarrWriteEmpty.test_orthogonal_indexing[3] ________________ 1241s 1241s self = 1241s 1241s def test_orthogonal_indexing(self) -> None: 1241s in_memory = create_test_data() 1241s > with self.roundtrip(in_memory) as on_disk: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:713: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ________________ TestZarrWriteEmpty.test_vectorized_indexing[3] ________________ 1241s 1241s self = 1241s 1241s def test_vectorized_indexing(self) -> None: 1241s in_memory = create_test_data() 1241s > with self.roundtrip(in_memory) as on_disk: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:727: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _________ TestZarrWriteEmpty.test_vectorized_indexing_negative_step[3] _________ 1241s 1241s self = 1241s 1241s def test_vectorized_indexing_negative_step(self) -> None: 1241s # use dask explicitly when present 1241s open_kwargs: dict[str, Any] | None 1241s if has_dask: 1241s open_kwargs = {"chunks": {}} 1241s else: 1241s open_kwargs = None 1241s in_memory = create_test_data() 1241s 1241s def multiple_indexing(indexers): 1241s # make sure a sequence of lazy indexings certainly works. 1241s with self.roundtrip(in_memory, open_kwargs=open_kwargs) as on_disk: 1241s actual = on_disk["var3"] 1241s expected = in_memory["var3"] 1241s for ind in indexers: 1241s actual = actual.isel(ind) 1241s expected = expected.isel(ind) 1241s # make sure the array is not yet loaded into memory 1241s assert not actual.variable._in_memory 1241s assert_identical(expected, actual.load()) 1241s 1241s # with negative step slice. 1241s indexers = [ 1241s { 1241s "dim1": DataArray([[0, 7], [2, 6], [3, 5]], dims=["a", "b"]), 1241s "dim3": slice(-1, 1, -1), 1241s } 1241s ] 1241s > multiple_indexing(indexers) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:817: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:800: in multiple_indexing 1241s with self.roundtrip(in_memory, open_kwargs=open_kwargs) as on_disk: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ______________ TestZarrWriteEmpty.test_outer_indexing_reversed[3] ______________ 1241s 1241s self = 1241s 1241s def test_outer_indexing_reversed(self) -> None: 1241s # regression test for GH6560 1241s ds = xr.Dataset( 1241s {"z": (("t", "p", "y", "x"), np.ones((1, 1, 31, 40)))}, 1241s ) 1241s 1241s > with self.roundtrip(ds) as on_disk: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:834: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'z' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s __________________ TestZarrWriteEmpty.test_isel_dataarray[3] ___________________ 1241s 1241s self = 1241s 1241s def test_isel_dataarray(self) -> None: 1241s # Make sure isel works lazily. GH:issue:1688 1241s in_memory = create_test_data() 1241s > with self.roundtrip(in_memory) as on_disk: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:841: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _____________ TestZarrWriteEmpty.test_array_type_after_indexing[3] _____________ 1241s 1241s self = 1241s 1241s def test_array_type_after_indexing(self) -> None: 1241s in_memory = create_test_data() 1241s > with self.roundtrip(in_memory) as on_disk: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:868: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ______________________ TestZarrWriteEmpty.test_dropna[3] _______________________ 1241s 1241s self = 1241s 1241s def test_dropna(self) -> None: 1241s # regression test for GH:issue:1694 1241s a = np.random.randn(4, 3) 1241s a[1, 1] = np.nan 1241s in_memory = xr.Dataset( 1241s {"a": (("y", "x"), a)}, coords={"y": np.arange(4), "x": np.arange(3)} 1241s ) 1241s 1241s assert_identical( 1241s in_memory.dropna(dim="x"), in_memory.isel(x=slice(None, None, 2)) 1241s ) 1241s 1241s > with self.roundtrip(in_memory) as on_disk: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:893: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'a' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ________________ TestZarrWriteEmpty.test_ondisk_after_print[3] _________________ 1241s 1241s self = 1241s 1241s def test_ondisk_after_print(self) -> None: 1241s """Make sure print does not load file into memory""" 1241s in_memory = create_test_data() 1241s > with self.roundtrip(in_memory) as on_disk: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:902: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s __________ TestZarrWriteEmpty.test_roundtrip_bytes_with_fill_value[3] __________ 1241s 1241s self = 1241s 1241s def test_roundtrip_bytes_with_fill_value(self) -> None: 1241s values = np.array([b"ab", b"cdef", np.nan], dtype=object) 1241s encoding = {"_FillValue": b"X", "dtype": "S1"} 1241s original = Dataset({"x": ("t", values, {}, encoding)}) 1241s expected = original.copy(deep=True) 1241s > with self.roundtrip(original) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:913: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'x' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'NullTerminatedBytes' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _______ TestZarrWriteEmpty.test_roundtrip_unsigned[3-fill_value0-False] ________ 1241s 1241s self = 1241s fill_value = np.int8(-1), exp_fill_warning = False 1241s 1241s @pytest.mark.parametrize( 1241s ("fill_value", "exp_fill_warning"), 1241s [ 1241s (np.int8(-1), False), 1241s (np.uint8(255), True), 1241s (-1, False), 1241s (255, True), 1241s ], 1241s ) 1241s def test_roundtrip_unsigned(self, fill_value, exp_fill_warning): 1241s @contextlib.contextmanager 1241s def _roundtrip_with_warnings(*args, **kwargs): 1241s is_np2 = module_available("numpy", minversion="2.0.0.dev0") 1241s if exp_fill_warning and is_np2: 1241s warn_checker: contextlib.AbstractContextManager = pytest.warns( 1241s SerializationWarning, 1241s match="_FillValue attribute can't be represented", 1241s ) 1241s else: 1241s warn_checker = contextlib.nullcontext() 1241s with warn_checker: 1241s with self.roundtrip(*args, **kwargs) as actual: 1241s yield actual 1241s 1241s # regression/numpy2 test for 1241s encoding = { 1241s "_FillValue": fill_value, 1241s "_Unsigned": "true", 1241s "dtype": "i1", 1241s } 1241s x = np.array([0, 1, 127, 128, 254, np.nan], dtype=np.float32) 1241s decoded = Dataset({"x": ("t", x, {}, encoding)}) 1241s 1241s attributes = { 1241s "_FillValue": fill_value, 1241s "_Unsigned": "true", 1241s } 1241s # Create unsigned data corresponding to [0, 1, 127, 128, 255] unsigned 1241s sb = np.asarray([0, 1, 127, -128, -2, -1], dtype="i1") 1241s encoded = Dataset({"x": ("t", sb, attributes)}) 1241s unsigned_dtype = np.dtype(f"u{sb.dtype.itemsize}") 1241s 1241s > with _roundtrip_with_warnings(decoded) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1066: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1045: in _roundtrip_with_warnings 1241s with self.roundtrip(*args, **kwargs) as actual: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'x' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Int8' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ________ TestZarrWriteEmpty.test_roundtrip_unsigned[3-fill_value1-True] ________ 1241s 1241s self = 1241s fill_value = np.uint8(255), exp_fill_warning = True 1241s 1241s @pytest.mark.parametrize( 1241s ("fill_value", "exp_fill_warning"), 1241s [ 1241s (np.int8(-1), False), 1241s (np.uint8(255), True), 1241s (-1, False), 1241s (255, True), 1241s ], 1241s ) 1241s def test_roundtrip_unsigned(self, fill_value, exp_fill_warning): 1241s @contextlib.contextmanager 1241s def _roundtrip_with_warnings(*args, **kwargs): 1241s is_np2 = module_available("numpy", minversion="2.0.0.dev0") 1241s if exp_fill_warning and is_np2: 1241s warn_checker: contextlib.AbstractContextManager = pytest.warns( 1241s SerializationWarning, 1241s match="_FillValue attribute can't be represented", 1241s ) 1241s else: 1241s warn_checker = contextlib.nullcontext() 1241s with warn_checker: 1241s with self.roundtrip(*args, **kwargs) as actual: 1241s yield actual 1241s 1241s # regression/numpy2 test for 1241s encoding = { 1241s "_FillValue": fill_value, 1241s "_Unsigned": "true", 1241s "dtype": "i1", 1241s } 1241s x = np.array([0, 1, 127, 128, 254, np.nan], dtype=np.float32) 1241s decoded = Dataset({"x": ("t", x, {}, encoding)}) 1241s 1241s attributes = { 1241s "_FillValue": fill_value, 1241s "_Unsigned": "true", 1241s } 1241s # Create unsigned data corresponding to [0, 1, 127, 128, 255] unsigned 1241s sb = np.asarray([0, 1, 127, -128, -2, -1], dtype="i1") 1241s encoded = Dataset({"x": ("t", sb, attributes)}) 1241s unsigned_dtype = np.dtype(f"u{sb.dtype.itemsize}") 1241s 1241s > with _roundtrip_with_warnings(decoded) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1066: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1045: in _roundtrip_with_warnings 1241s with self.roundtrip(*args, **kwargs) as actual: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'x' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Int8' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ____________ TestZarrWriteEmpty.test_roundtrip_unsigned[3--1-False] ____________ 1241s 1241s self = 1241s fill_value = -1, exp_fill_warning = False 1241s 1241s @pytest.mark.parametrize( 1241s ("fill_value", "exp_fill_warning"), 1241s [ 1241s (np.int8(-1), False), 1241s (np.uint8(255), True), 1241s (-1, False), 1241s (255, True), 1241s ], 1241s ) 1241s def test_roundtrip_unsigned(self, fill_value, exp_fill_warning): 1241s @contextlib.contextmanager 1241s def _roundtrip_with_warnings(*args, **kwargs): 1241s is_np2 = module_available("numpy", minversion="2.0.0.dev0") 1241s if exp_fill_warning and is_np2: 1241s warn_checker: contextlib.AbstractContextManager = pytest.warns( 1241s SerializationWarning, 1241s match="_FillValue attribute can't be represented", 1241s ) 1241s else: 1241s warn_checker = contextlib.nullcontext() 1241s with warn_checker: 1241s with self.roundtrip(*args, **kwargs) as actual: 1241s yield actual 1241s 1241s # regression/numpy2 test for 1241s encoding = { 1241s "_FillValue": fill_value, 1241s "_Unsigned": "true", 1241s "dtype": "i1", 1241s } 1241s x = np.array([0, 1, 127, 128, 254, np.nan], dtype=np.float32) 1241s decoded = Dataset({"x": ("t", x, {}, encoding)}) 1241s 1241s attributes = { 1241s "_FillValue": fill_value, 1241s "_Unsigned": "true", 1241s } 1241s # Create unsigned data corresponding to [0, 1, 127, 128, 255] unsigned 1241s sb = np.asarray([0, 1, 127, -128, -2, -1], dtype="i1") 1241s encoded = Dataset({"x": ("t", sb, attributes)}) 1241s unsigned_dtype = np.dtype(f"u{sb.dtype.itemsize}") 1241s 1241s > with _roundtrip_with_warnings(decoded) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1066: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1045: in _roundtrip_with_warnings 1241s with self.roundtrip(*args, **kwargs) as actual: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'x' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Int8' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ____________ TestZarrWriteEmpty.test_roundtrip_unsigned[3-255-True] ____________ 1241s 1241s self = 1241s fill_value = 255, exp_fill_warning = True 1241s 1241s @pytest.mark.parametrize( 1241s ("fill_value", "exp_fill_warning"), 1241s [ 1241s (np.int8(-1), False), 1241s (np.uint8(255), True), 1241s (-1, False), 1241s (255, True), 1241s ], 1241s ) 1241s def test_roundtrip_unsigned(self, fill_value, exp_fill_warning): 1241s @contextlib.contextmanager 1241s def _roundtrip_with_warnings(*args, **kwargs): 1241s is_np2 = module_available("numpy", minversion="2.0.0.dev0") 1241s if exp_fill_warning and is_np2: 1241s warn_checker: contextlib.AbstractContextManager = pytest.warns( 1241s SerializationWarning, 1241s match="_FillValue attribute can't be represented", 1241s ) 1241s else: 1241s warn_checker = contextlib.nullcontext() 1241s with warn_checker: 1241s with self.roundtrip(*args, **kwargs) as actual: 1241s yield actual 1241s 1241s # regression/numpy2 test for 1241s encoding = { 1241s "_FillValue": fill_value, 1241s "_Unsigned": "true", 1241s "dtype": "i1", 1241s } 1241s x = np.array([0, 1, 127, 128, 254, np.nan], dtype=np.float32) 1241s decoded = Dataset({"x": ("t", x, {}, encoding)}) 1241s 1241s attributes = { 1241s "_FillValue": fill_value, 1241s "_Unsigned": "true", 1241s } 1241s # Create unsigned data corresponding to [0, 1, 127, 128, 255] unsigned 1241s sb = np.asarray([0, 1, 127, -128, -2, -1], dtype="i1") 1241s encoded = Dataset({"x": ("t", sb, attributes)}) 1241s unsigned_dtype = np.dtype(f"u{sb.dtype.itemsize}") 1241s 1241s > with _roundtrip_with_warnings(decoded) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1066: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1045: in _roundtrip_with_warnings 1241s with self.roundtrip(*args, **kwargs) as actual: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'x' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Int8' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _ TestZarrWriteEmpty.test_grid_mapping_and_bounds_are_not_coordinates_in_file[3] _ 1241s 1241s self = 1241s 1241s def test_grid_mapping_and_bounds_are_not_coordinates_in_file(self) -> None: 1241s original = self._create_cf_dataset() 1241s > with self.roundtrip(original, open_kwargs={"decode_coords": False}) as ds: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1142: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = 1241s name = 'det_lim' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ___ TestZarrWriteEmpty.test_coordinate_variables_after_dataset_roundtrip[3] ____ 1241s 1241s self = 1241s 1241s def test_coordinate_variables_after_dataset_roundtrip(self) -> None: 1241s original = self._create_cf_dataset() 1241s > with self.roundtrip(original, open_kwargs={"decode_coords": "all"}) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1150: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = 1241s name = 'det_lim' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _ TestZarrWriteEmpty.test_grid_mapping_and_bounds_are_coordinates_after_dataarray_roundtrip[3] _ 1241s 1241s self = 1241s 1241s def test_grid_mapping_and_bounds_are_coordinates_after_dataarray_roundtrip( 1241s self, 1241s ) -> None: 1241s original = self._create_cf_dataset() 1241s # The DataArray roundtrip should have the same warnings as the 1241s # Dataset, but we already tested for those, so just go for the 1241s # new warnings. It would appear that there is no way to tell 1241s # pytest "This warning and also this warning should both be 1241s # present". 1241s # xarray/tests/test_conventions.py::TestCFEncodedDataStore 1241s # needs the to_dataset. The other backends should be fine 1241s # without it. 1241s with pytest.warns( 1241s UserWarning, 1241s match=( 1241s r"Variable\(s\) referenced in bounds not in variables: " 1241s r"\['l(at|ong)itude_bnds'\]" 1241s ), 1241s ): 1241s > with self.roundtrip( 1241s original["variable"].to_dataset(), open_kwargs={"decode_coords": "all"} 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1182: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'ln_p' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s 1241s During handling of the above exception, another exception occurred: 1241s 1241s self = 1241s 1241s def test_grid_mapping_and_bounds_are_coordinates_after_dataarray_roundtrip( 1241s self, 1241s ) -> None: 1241s original = self._create_cf_dataset() 1241s # The DataArray roundtrip should have the same warnings as the 1241s # Dataset, but we already tested for those, so just go for the 1241s # new warnings. It would appear that there is no way to tell 1241s # pytest "This warning and also this warning should both be 1241s # present". 1241s # xarray/tests/test_conventions.py::TestCFEncodedDataStore 1241s # needs the to_dataset. The other backends should be fine 1241s # without it. 1241s > with pytest.warns( 1241s UserWarning, 1241s match=( 1241s r"Variable\(s\) referenced in bounds not in variables: " 1241s r"\['l(at|ong)itude_bnds'\]" 1241s ), 1241s ): 1241s E Failed: DID NOT WARN. No warnings of type (,) matching the regex were emitted. 1241s E Regex: Variable\(s\) referenced in bounds not in variables: \['l(at|ong)itude_bnds'\] 1241s E Emitted warnings: [ ZarrUserWarning('Consolidated metadata is currently not part in the Zarr format 3 specification. It may not be supported by other zarr implementations and may change in the future.')]. 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1175: Failed 1241s __________________ TestZarrWriteEmpty.test_encoding_kwarg[3] ___________________ 1241s 1241s self = 1241s 1241s def test_encoding_kwarg(self) -> None: 1241s ds = Dataset({"x": ("y", np.arange(10.0))}) 1241s 1241s kwargs: dict[str, Any] = dict(encoding={"x": {"dtype": "f4"}}) 1241s > with self.roundtrip(ds, save_kwargs=kwargs) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1277: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'x' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float32' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ________________ TestZarrWriteEmpty.test_default_fill_value[3] _________________ 1241s 1241s self = 1241s 1241s def test_default_fill_value(self) -> None: 1241s # Test default encoding for float: 1241s ds = Dataset({"x": ("y", np.arange(10.0))}) 1241s kwargs = dict(encoding={"x": {"dtype": "f4"}}) 1241s > with self.roundtrip(ds, save_kwargs=kwargs) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1319: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'x' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float32' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ________ TestZarrWriteEmpty.test_explicitly_omit_fill_value_in_coord[3] ________ 1241s 1241s self = 1241s 1241s def test_explicitly_omit_fill_value_in_coord(self) -> None: 1241s ds = Dataset({"x": ("y", [np.pi, -np.pi])}, coords={"y": [0.0, 1.0]}) 1241s ds.y.encoding["_FillValue"] = None 1241s > with self.roundtrip(ds) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1355: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'x' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _ TestZarrWriteEmpty.test_explicitly_omit_fill_value_in_coord_via_encoding_kwarg[3] _ 1241s 1241s self = 1241s 1241s def test_explicitly_omit_fill_value_in_coord_via_encoding_kwarg(self) -> None: 1241s ds = Dataset({"x": ("y", [np.pi, -np.pi])}, coords={"y": [0.0, 1.0]}) 1241s kwargs = dict(encoding={"y": {"_FillValue": None}}) 1241s > with self.roundtrip(ds, save_kwargs=kwargs) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1361: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'x' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ________________ TestZarrWriteEmpty.test_encoding_same_dtype[3] ________________ 1241s 1241s self = 1241s 1241s def test_encoding_same_dtype(self) -> None: 1241s ds = Dataset({"x": ("y", np.arange(10.0, dtype="f4"))}) 1241s kwargs = dict(encoding={"x": {"dtype": "f4"}}) 1241s > with self.roundtrip(ds, save_kwargs=kwargs) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1368: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'x' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float32' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ______________ TestZarrWriteEmpty.test_append_overwrite_values[3] ______________ 1241s 1241s self = 1241s 1241s def test_append_overwrite_values(self) -> None: 1241s # regression for GH1215 1241s data = create_test_data() 1241s with create_tmp_file(allow_cleanup_failure=False) as tmp_file: 1241s self.save(data, tmp_file, mode="w") 1241s data["var2"][:] = -999 1241s data["var9"] = data["var2"] * 3 1241s > self.save(data[["var2", "var9"]], tmp_file, mode="a") 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1387: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2296: in save 1241s return dataset.to_zarr(store=store_target, **kwargs, **self.version_kwargs) 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ___________ TestZarrWriteEmpty.test_roundtrip_consolidated[3-False] ____________ 1241s 1241s self = 1241s consolidated = False 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s def test_roundtrip_consolidated(self, consolidated) -> None: 1241s expected = create_test_data() 1241s > with self.roundtrip( 1241s expected, 1241s save_kwargs={"consolidated": consolidated}, 1241s open_kwargs={"backend_kwargs": {"consolidated": consolidated}}, 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2321: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ____________ TestZarrWriteEmpty.test_roundtrip_consolidated[3-True] ____________ 1241s 1241s self = 1241s consolidated = True 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s def test_roundtrip_consolidated(self, consolidated) -> None: 1241s expected = create_test_data() 1241s > with self.roundtrip( 1241s expected, 1241s save_kwargs={"consolidated": consolidated}, 1241s open_kwargs={"backend_kwargs": {"consolidated": consolidated}}, 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2321: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ____________ TestZarrWriteEmpty.test_roundtrip_consolidated[3-None] ____________ 1241s 1241s self = 1241s consolidated = None 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s def test_roundtrip_consolidated(self, consolidated) -> None: 1241s expected = create_test_data() 1241s > with self.roundtrip( 1241s expected, 1241s save_kwargs={"consolidated": consolidated}, 1241s open_kwargs={"backend_kwargs": {"consolidated": consolidated}}, 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2321: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ___________ TestZarrWriteEmpty.test_read_non_consolidated_warning[3] ___________ 1241s 1241s self = 1241s 1241s def test_read_non_consolidated_warning(self) -> None: 1241s expected = create_test_data() 1241s with self.create_zarr_target() as store: 1241s self.save( 1241s expected, store_target=store, consolidated=False, **self.version_kwargs 1241s ) 1241s with pytest.warns( 1241s RuntimeWarning, 1241s match="Failed to open Zarr store with consolidated", 1241s ): 1241s > with xr.open_zarr(store, **self.version_kwargs) as ds: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2339: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1241s ds = open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'var3' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ________________ TestZarrWriteEmpty.test_non_existent_store[3] _________________ 1241s 1241s self = 1241s 1241s def test_non_existent_store(self) -> None: 1241s with pytest.raises( 1241s FileNotFoundError, match="(No such file or directory|Unable to find group)" 1241s ): 1241s > xr.open_zarr(f"{uuid.uuid4()}") 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2346: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1241s ds = open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1608: in open_dataset 1241s store = ZarrStore.open_group( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:732: in open_group 1241s ) = _get_open_params( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1811: in _get_open_params 1241s zarr_root_group = zarr.open_consolidated(store, **open_kwargs) 1241s /usr/lib/python3/dist-packages/zarr/api/synchronous.py:231: in open_consolidated 1241s sync(async_api.open_consolidated(*args, use_consolidated=use_consolidated, **kwargs)) 1241s /usr/lib/python3/dist-packages/zarr/core/sync.py:163: in sync 1241s raise return_result 1241s /usr/lib/python3/dist-packages/zarr/core/sync.py:119: in _runner 1241s return await coro 1241s /usr/lib/python3/dist-packages/zarr/api/asynchronous.py:408: in open_consolidated 1241s return await open_group(*args, use_consolidated=use_consolidated, **kwargs) 1241s /usr/lib/python3/dist-packages/zarr/api/asynchronous.py:851: in open_group 1241s store_path = await make_store_path(store, mode=mode, storage_options=storage_options, path=path) 1241s /usr/lib/python3/dist-packages/zarr/storage/_common.py:418: in make_store_path 1241s store = await make_store(store_like, mode=mode, storage_options=storage_options) 1241s /usr/lib/python3/dist-packages/zarr/storage/_common.py:349: in make_store 1241s return await make_store(Path(store_like), mode=mode, storage_options=storage_options) 1241s /usr/lib/python3/dist-packages/zarr/storage/_common.py:339: in make_store 1241s return await LocalStore.open(root=store_like, mode=mode, read_only=_read_only) 1241s /usr/lib/python3/dist-packages/zarr/storage/_local.py:160: in open 1241s await store._open() 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = LocalStore('file:///tmp/autopkgtest.cdpOi4/autopkgtest_tmp/build/b888e4df-e3e8-4eca-b615-2e0d9e60d347') 1241s 1241s async def _open(self, *, mode: AccessModeLiteral | None = None) -> None: 1241s if not self.read_only: 1241s self.root.mkdir(parents=True, exist_ok=True) 1241s 1241s if not self.root.exists(): 1241s > raise FileNotFoundError(f"{self.root} does not exist") 1241s E FileNotFoundError: /tmp/autopkgtest.cdpOi4/autopkgtest_tmp/build/b888e4df-e3e8-4eca-b615-2e0d9e60d347 does not exist 1241s 1241s /usr/lib/python3/dist-packages/zarr/storage/_local.py:172: FileNotFoundError 1241s 1241s During handling of the above exception, another exception occurred: 1241s 1241s self = 1241s 1241s def test_non_existent_store(self) -> None: 1241s > with pytest.raises( 1241s FileNotFoundError, match="(No such file or directory|Unable to find group)" 1241s ): 1241s E AssertionError: Regex pattern did not match. 1241s E Regex: '(No such file or directory|Unable to find group)' 1241s E Input: '/tmp/autopkgtest.cdpOi4/autopkgtest_tmp/build/b888e4df-e3e8-4eca-b615-2e0d9e60d347 does not exist' 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2343: AssertionError 1241s ____________________ TestZarrWriteEmpty.test_auto_chunk[3] _____________________ 1241s 1241s self = 1241s 1241s @requires_dask 1241s def test_auto_chunk(self) -> None: 1241s original = create_test_data().chunk() 1241s 1241s > with self.roundtrip(original, open_kwargs={"chunks": None}) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2367: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ___________________ TestZarrWriteEmpty.test_manual_chunk[3] ____________________ 1241s 1241s self = 1241s 1241s @requires_dask 1241s @pytest.mark.filterwarnings("ignore:The specified chunks separate:UserWarning") 1241s def test_manual_chunk(self) -> None: 1241s original = create_test_data().chunk({"dim1": 3, "dim2": 4, "dim3": 3}) 1241s 1241s # Using chunks = None should return non-chunked arrays 1241s open_kwargs: dict[str, Any] = {"chunks": None} 1241s > with self.roundtrip(original, open_kwargs=open_kwargs) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2388: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _______________ TestZarrWriteEmpty.test_warning_on_bad_chunks[3] _______________ 1241s 1241s self = 1241s 1241s @requires_dask 1241s def test_warning_on_bad_chunks(self) -> None: 1241s original = create_test_data().chunk({"dim1": 4, "dim2": 3, "dim3": 3}) 1241s 1241s bad_chunks = (2, {"dim2": (3, 3, 2, 1)}) 1241s for chunks in bad_chunks: 1241s kwargs = {"chunks": chunks} 1241s with pytest.warns(UserWarning): 1241s > with self.roundtrip(original, open_kwargs=kwargs) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2433: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _____________ TestZarrWriteEmpty.test_write_uneven_dask_chunks[3] ______________ 1241s 1241s self = 1241s 1241s @requires_dask 1241s def test_write_uneven_dask_chunks(self) -> None: 1241s # regression for GH#2225 1241s original = create_test_data().chunk({"dim1": 3, "dim2": 4, "dim3": 3}) 1241s > with self.roundtrip(original, open_kwargs={"chunks": {}}) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2476: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s __________________ TestZarrWriteEmpty.test_chunk_encoding[3] ___________________ 1241s 1241s self = 1241s 1241s def test_chunk_encoding(self) -> None: 1241s # These datasets have no dask chunks. All chunking specified in 1241s # encoding 1241s data = create_test_data() 1241s chunks = (5, 5) 1241s data["var2"].encoding.update({"chunks": chunks}) 1241s 1241s > with self.roundtrip(data) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2487: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s __________________ TestZarrWriteEmpty.test_shard_encoding[3] ___________________ 1241s 1241s self = 1241s 1241s def test_shard_encoding(self) -> None: 1241s # These datasets have no dask chunks. All chunking/sharding specified in 1241s # encoding 1241s if has_zarr_v3 and zarr.config.config["default_zarr_format"] == 3: 1241s data = create_test_data() 1241s chunks = (1, 1) 1241s shards = (5, 5) 1241s data["var2"].encoding.update({"chunks": chunks}) 1241s data["var2"].encoding.update({"shards": shards}) 1241s > with self.roundtrip(data) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2505: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ___________ TestZarrWriteEmpty.test_write_persistence_modes[3-None] ____________ 1241s 1241s self = 1241s group = None 1241s 1241s @pytest.mark.parametrize("group", [None, "group1"]) 1241s def test_write_persistence_modes(self, group) -> None: 1241s original = create_test_data() 1241s 1241s # overwrite mode 1241s > with self.roundtrip( 1241s original, 1241s save_kwargs={"mode": "w", "group": group}, 1241s open_kwargs={"group": group}, 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2650: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s __________ TestZarrWriteEmpty.test_write_persistence_modes[3-group1] ___________ 1241s 1241s self = 1241s group = 'group1' 1241s 1241s @pytest.mark.parametrize("group", [None, "group1"]) 1241s def test_write_persistence_modes(self, group) -> None: 1241s original = create_test_data() 1241s 1241s # overwrite mode 1241s > with self.roundtrip( 1241s original, 1241s save_kwargs={"mode": "w", "group": group}, 1241s open_kwargs={"group": group}, 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2650: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ________________ TestZarrWriteEmpty.test_compressor_encoding[3] ________________ 1241s 1241s self = 1241s 1241s def test_compressor_encoding(self) -> None: 1241s # specify a custom compressor 1241s original = create_test_data() 1241s if has_zarr_v3 and zarr.config.config["default_zarr_format"] == 3: 1241s encoding_key = "compressors" 1241s # all parameters need to be explicitly specified in order for the comparison to pass below 1241s encoding = { 1241s "serializer": zarr.codecs.BytesCodec(endian="little"), 1241s encoding_key: ( 1241s zarr.codecs.BloscCodec( 1241s cname="zstd", 1241s clevel=3, 1241s shuffle="shuffle", 1241s typesize=8, 1241s blocksize=0, 1241s ), 1241s ), 1241s } 1241s else: 1241s from numcodecs.blosc import Blosc 1241s 1241s encoding_key = "compressors" if has_zarr_v3 else "compressor" 1241s comp = Blosc(cname="zstd", clevel=3, shuffle=2) 1241s encoding = {encoding_key: (comp,) if has_zarr_v3 else comp} 1241s 1241s save_kwargs = dict(encoding={"var1": encoding}) 1241s 1241s > with self.roundtrip(original, save_kwargs=save_kwargs) as ds: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2723: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _______________________ TestZarrWriteEmpty.test_group[3] _______________________ 1241s 1241s self = 1241s 1241s def test_group(self) -> None: 1241s original = create_test_data() 1241s group = "some/random/path" 1241s > with self.roundtrip( 1241s original, save_kwargs={"group": group}, open_kwargs={"group": group} 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2730: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ___________________ TestZarrWriteEmpty.test_append_write[3] ____________________ 1241s 1241s self = 1241s 1241s def test_append_write(self) -> None: 1241s > super().test_append_write() 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2762: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:1377: in test_append_write 1241s with self.roundtrip_append(data) as actual: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:388: in roundtrip_append 1241s self.save(data[[key]], path, mode=mode, **save_kwargs) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2296: in save 1241s return dataset.to_zarr(store=store_target, **kwargs, **self.version_kwargs) 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _______ TestZarrWriteEmpty.test_append_with_append_dim_not_set_raises[3] _______ 1241s 1241s self = 1241s 1241s def test_append_with_append_dim_not_set_raises(self) -> None: 1241s ds, ds_to_append, _ = create_append_test_data() 1241s with self.create_zarr_target() as store_target: 1241s ds.to_zarr(store_target, mode="w", **self.version_kwargs) 1241s with pytest.raises(ValueError, match="different dimension sizes"): 1241s > ds_to_append.to_zarr(store_target, mode="a", **self.version_kwargs) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2809: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'da' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _______ TestZarrWriteEmpty.test_append_string_length_mismatch_works[3-U] _______ 1241s 1241s self = 1241s dtype = 'U' 1241s 1241s @pytest.mark.parametrize("dtype", ["U", "S"]) 1241s def test_append_string_length_mismatch_works(self, dtype) -> None: 1241s skip_if_zarr_format_2("This doesn't work with Zarr format 2") 1241s # ...but it probably would if we used object dtype 1241s ds, ds_to_append = create_append_string_length_mismatch_test_data(dtype) 1241s expected = xr.concat([ds, ds_to_append], dim="time") 1241s with self.create_zarr_target() as store_target: 1241s ds.to_zarr(store_target, mode="w", **self.version_kwargs) 1241s > ds_to_append.to_zarr(store_target, append_dim="time", **self.version_kwargs) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2851: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1018: in store 1241s _validate_datatypes_for_zarr_append( 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s vname = 'temperature' 1241s existing_var = Size: 24B 1241s [3 values with dtype= Size: 60B 1241s array(['abc', 'def', 'ghijk'], dtype=' raise ValueError( 1241s f"Mismatched dtypes for variable {vname} between Zarr store on disk " 1241s f"and dataset to append. Store has dtype {existing_var.dtype} but " 1241s f"dataset to append has dtype {new_var.dtype}." 1241s ) 1241s E ValueError: Mismatched dtypes for variable temperature between Zarr store on disk and dataset to append. Store has dtype 1241s dtype = 'S' 1241s 1241s @pytest.mark.parametrize("dtype", ["U", "S"]) 1241s def test_append_string_length_mismatch_works(self, dtype) -> None: 1241s skip_if_zarr_format_2("This doesn't work with Zarr format 2") 1241s # ...but it probably would if we used object dtype 1241s ds, ds_to_append = create_append_string_length_mismatch_test_data(dtype) 1241s expected = xr.concat([ds, ds_to_append], dim="time") 1241s with self.create_zarr_target() as store_target: 1241s ds.to_zarr(store_target, mode="w", **self.version_kwargs) 1241s > ds_to_append.to_zarr(store_target, append_dim="time", **self.version_kwargs) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2851: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1018: in store 1241s _validate_datatypes_for_zarr_append( 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s vname = 'temperature' 1241s existing_var = Size: 6B 1241s [3 values with dtype=|S2] 1241s new_var = Size: 9B 1241s array([b'aaa', b'bbb', b'ccc'], dtype='|S3') 1241s 1241s def _validate_datatypes_for_zarr_append(vname, existing_var, new_var): 1241s """If variable exists in the store, confirm dtype of the data to append is compatible with 1241s existing dtype. 1241s """ 1241s if ( 1241s np.issubdtype(new_var.dtype, np.number) 1241s or np.issubdtype(new_var.dtype, np.datetime64) 1241s or np.issubdtype(new_var.dtype, np.bool_) 1241s or new_var.dtype == object 1241s or (new_var.dtype.kind in ("S", "U") and existing_var.dtype == object) 1241s ): 1241s # We can skip dtype equality checks under two conditions: (1) if the var to append is 1241s # new to the dataset, because in this case there is no existing var to compare it to; 1241s # or (2) if var to append's dtype is known to be easy-to-append, because in this case 1241s # we can be confident appending won't cause problems. Examples of dtypes which are not 1241s # easy-to-append include length-specified strings of type `|S*` or ` raise ValueError( 1241s f"Mismatched dtypes for variable {vname} between Zarr store on disk " 1241s f"and dataset to append. Store has dtype {existing_var.dtype} but " 1241s f"dataset to append has dtype {new_var.dtype}." 1241s ) 1241s E ValueError: Mismatched dtypes for variable temperature between Zarr store on disk and dataset to append. Store has dtype |S2 but dataset to append has dtype |S3. 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:566: ValueError 1241s _____ TestZarrWriteEmpty.test_check_encoding_is_consistent_after_append[3] _____ 1241s 1241s self = 1241s 1241s def test_check_encoding_is_consistent_after_append(self) -> None: 1241s ds, ds_to_append, _ = create_append_test_data() 1241s 1241s # check encoding consistency 1241s with self.create_zarr_target() as store_target: 1241s import numcodecs 1241s 1241s encoding_value: Any 1241s if has_zarr_v3 and zarr.config.config["default_zarr_format"] == 3: 1241s compressor = zarr.codecs.BloscCodec() 1241s else: 1241s compressor = numcodecs.Blosc() 1241s encoding_key = "compressors" if has_zarr_v3 else "compressor" 1241s encoding_value = (compressor,) if has_zarr_v3 else compressor 1241s 1241s encoding = {"da": {encoding_key: encoding_value}} 1241s ds.to_zarr(store_target, mode="w", encoding=encoding, **self.version_kwargs) 1241s > original_ds = xr.open_dataset( 1241s store_target, engine="zarr", **self.version_kwargs 1241s ) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2872: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'da' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _____________ TestZarrWriteEmpty.test_append_with_new_variable[3] ______________ 1241s 1241s self = 1241s 1241s def test_append_with_new_variable(self) -> None: 1241s ds, ds_to_append, ds_with_new_var = create_append_test_data() 1241s 1241s # check append mode for new variable 1241s with self.create_zarr_target() as store_target: 1241s combined = xr.concat([ds, ds_to_append], dim="time") 1241s combined.to_zarr(store_target, mode="w", **self.version_kwargs) 1241s assert_identical( 1241s combined, 1241s > xr.open_dataset(store_target, engine="zarr", **self.version_kwargs), 1241s ) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2899: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'da' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ________ TestZarrWriteEmpty.test_append_with_append_dim_no_overwrite[3] ________ 1241s 1241s self = 1241s 1241s def test_append_with_append_dim_no_overwrite(self) -> None: 1241s ds, ds_to_append, _ = create_append_test_data() 1241s with self.create_zarr_target() as store_target: 1241s ds.to_zarr(store_target, mode="w", **self.version_kwargs) 1241s original = xr.concat([ds, ds_to_append], dim="time") 1241s original2 = xr.concat([original, ds_to_append], dim="time") 1241s 1241s # overwrite a coordinate; 1241s # for mode='a-', this will not get written to the store 1241s # because it does not have the append_dim as a dim 1241s lon = ds_to_append.lon.to_numpy().copy() 1241s lon[:] = -999 1241s ds_to_append["lon"] = lon 1241s > ds_to_append.to_zarr( 1241s store_target, mode="a-", append_dim="time", **self.version_kwargs 1241s ) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2922: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'da' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s __________ TestZarrWriteEmpty.test_to_zarr_compute_false_roundtrip[3] __________ 1241s 1241s self = 1241s 1241s @requires_dask 1241s def test_to_zarr_compute_false_roundtrip(self) -> None: 1241s from dask.delayed import Delayed 1241s 1241s original = create_test_data().chunk() 1241s 1241s with self.create_zarr_target() as store: 1241s delayed_obj = self.save(original, store, compute=False) 1241s assert isinstance(delayed_obj, Delayed) 1241s 1241s # make sure target store has not been written to yet 1241s with pytest.raises(AssertionError): 1241s > with self.open(store) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2948: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ______ TestZarrWriteEmpty.test_to_zarr_append_compute_false_roundtrip[3] _______ 1241s 1241s self = 1241s 1241s @requires_dask 1241s def test_to_zarr_append_compute_false_roundtrip(self) -> None: 1241s from dask.delayed import Delayed 1241s 1241s ds, ds_to_append, _ = create_append_test_data() 1241s ds, ds_to_append = ds.chunk(), ds_to_append.chunk() 1241s 1241s with pytest.warns(SerializationWarning): 1241s with self.create_zarr_target() as store: 1241s delayed_obj = self.save(ds, store, compute=False, mode="w") 1241s assert isinstance(delayed_obj, Delayed) 1241s 1241s with pytest.raises(AssertionError): 1241s > with self.open(store) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2969: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'da' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ________________ TestZarrWriteEmpty.test_save_emptydim[3-False] ________________ 1241s 1241s self = 1241s chunk = False 1241s 1241s @pytest.mark.parametrize("chunk", [False, True]) 1241s def test_save_emptydim(self, chunk) -> None: 1241s if chunk and not has_dask: 1241s pytest.skip("requires dask") 1241s ds = Dataset({"x": (("a", "b"), np.empty((5, 0))), "y": ("a", [1, 2, 5, 8, 9])}) 1241s if chunk: 1241s ds = ds.chunk({}) # chunk dataset to save dask array 1241s > with self.roundtrip(ds) as ds_reload: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3000: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'x' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ________________ TestZarrWriteEmpty.test_save_emptydim[3-True] _________________ 1241s 1241s self = 1241s chunk = True 1241s 1241s @pytest.mark.parametrize("chunk", [False, True]) 1241s def test_save_emptydim(self, chunk) -> None: 1241s if chunk and not has_dask: 1241s pytest.skip("requires dask") 1241s ds = Dataset({"x": (("a", "b"), np.empty((5, 0))), "y": ("a", [1, 2, 5, 8, 9])}) 1241s if chunk: 1241s ds = ds.chunk({}) # chunk dataset to save dask array 1241s > with self.roundtrip(ds) as ds_reload: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3000: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'x' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _____ TestZarrWriteEmpty.test_no_warning_from_open_emptydim_with_chunks[3] _____ 1241s 1241s self = 1241s 1241s @requires_dask 1241s def test_no_warning_from_open_emptydim_with_chunks(self) -> None: 1241s ds = Dataset({"x": (("a", "b"), np.empty((5, 0)))}).chunk({"a": 1}) 1241s with assert_no_warnings(): 1241s with warnings.catch_warnings(): 1241s warnings.filterwarnings( 1241s "ignore", 1241s message=".*Zarr format 3 specification.*", 1241s category=UserWarning, 1241s ) 1241s > with self.roundtrip(ds, open_kwargs=dict(chunks={"a": 1})) as ds_reload: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3013: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'x' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _______ TestZarrWriteEmpty.test_write_region[3-False-False-False-False] ________ 1241s 1241s self = 1241s consolidated = False, compute = False, use_dask = False, write_empty = False 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s assert_identical(actual, zeros) 1241s for i in range(0, 10, 2): 1241s region = {"x": slice(i, i + 2)} 1241s > nonzeros.isel(region).to_zarr( 1241s store, 1241s region=region, 1241s consolidated=consolidated, 1241s write_empty_chunks=write_empty, 1241s **self.version_kwargs, 1241s ) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ________ TestZarrWriteEmpty.test_write_region[3-False-False-False-True] ________ 1241s 1241s self = 1241s consolidated = True, compute = False, use_dask = False, write_empty = False 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s assert_identical(actual, zeros) 1241s for i in range(0, 10, 2): 1241s region = {"x": slice(i, i + 2)} 1241s > nonzeros.isel(region).to_zarr( 1241s store, 1241s region=region, 1241s consolidated=consolidated, 1241s write_empty_chunks=write_empty, 1241s **self.version_kwargs, 1241s ) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ________ TestZarrWriteEmpty.test_write_region[3-False-False-False-None] ________ 1241s 1241s self = 1241s consolidated = None, compute = False, use_dask = False, write_empty = False 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s assert_identical(actual, zeros) 1241s for i in range(0, 10, 2): 1241s region = {"x": slice(i, i + 2)} 1241s > nonzeros.isel(region).to_zarr( 1241s store, 1241s region=region, 1241s consolidated=consolidated, 1241s write_empty_chunks=write_empty, 1241s **self.version_kwargs, 1241s ) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ________ TestZarrWriteEmpty.test_write_region[3-False-False-True-False] ________ 1241s 1241s self = 1241s consolidated = False, compute = True, use_dask = False, write_empty = False 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s > with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1241s ds = open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ________ TestZarrWriteEmpty.test_write_region[3-False-False-True-True] _________ 1241s 1241s self = 1241s consolidated = True, compute = True, use_dask = False, write_empty = False 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s > with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1241s ds = open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ________ TestZarrWriteEmpty.test_write_region[3-False-False-True-None] _________ 1241s 1241s self = 1241s consolidated = None, compute = True, use_dask = False, write_empty = False 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s > with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1241s ds = open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ________ TestZarrWriteEmpty.test_write_region[3-False-True-False-False] ________ 1241s 1241s self = 1241s consolidated = False, compute = False, use_dask = True, write_empty = False 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s assert_identical(actual, zeros) 1241s for i in range(0, 10, 2): 1241s region = {"x": slice(i, i + 2)} 1241s > nonzeros.isel(region).to_zarr( 1241s store, 1241s region=region, 1241s consolidated=consolidated, 1241s write_empty_chunks=write_empty, 1241s **self.version_kwargs, 1241s ) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ________ TestZarrWriteEmpty.test_write_region[3-False-True-False-True] _________ 1241s 1241s self = 1241s consolidated = True, compute = False, use_dask = True, write_empty = False 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s assert_identical(actual, zeros) 1241s for i in range(0, 10, 2): 1241s region = {"x": slice(i, i + 2)} 1241s > nonzeros.isel(region).to_zarr( 1241s store, 1241s region=region, 1241s consolidated=consolidated, 1241s write_empty_chunks=write_empty, 1241s **self.version_kwargs, 1241s ) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ________ TestZarrWriteEmpty.test_write_region[3-False-True-False-None] _________ 1241s 1241s self = 1241s consolidated = None, compute = False, use_dask = True, write_empty = False 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s assert_identical(actual, zeros) 1241s for i in range(0, 10, 2): 1241s region = {"x": slice(i, i + 2)} 1241s > nonzeros.isel(region).to_zarr( 1241s store, 1241s region=region, 1241s consolidated=consolidated, 1241s write_empty_chunks=write_empty, 1241s **self.version_kwargs, 1241s ) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ________ TestZarrWriteEmpty.test_write_region[3-False-True-True-False] _________ 1241s 1241s self = 1241s consolidated = False, compute = True, use_dask = True, write_empty = False 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s > with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1241s ds = open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _________ TestZarrWriteEmpty.test_write_region[3-False-True-True-True] _________ 1241s 1241s self = 1241s consolidated = True, compute = True, use_dask = True, write_empty = False 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s > with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1241s ds = open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _________ TestZarrWriteEmpty.test_write_region[3-False-True-True-None] _________ 1241s 1241s self = 1241s consolidated = None, compute = True, use_dask = True, write_empty = False 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s > with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1241s ds = open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ________ TestZarrWriteEmpty.test_write_region[3-True-False-False-False] ________ 1241s 1241s self = 1241s consolidated = False, compute = False, use_dask = False, write_empty = True 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s assert_identical(actual, zeros) 1241s for i in range(0, 10, 2): 1241s region = {"x": slice(i, i + 2)} 1241s > nonzeros.isel(region).to_zarr( 1241s store, 1241s region=region, 1241s consolidated=consolidated, 1241s write_empty_chunks=write_empty, 1241s **self.version_kwargs, 1241s ) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ________ TestZarrWriteEmpty.test_write_region[3-True-False-False-True] _________ 1241s 1241s self = 1241s consolidated = True, compute = False, use_dask = False, write_empty = True 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s assert_identical(actual, zeros) 1241s for i in range(0, 10, 2): 1241s region = {"x": slice(i, i + 2)} 1241s > nonzeros.isel(region).to_zarr( 1241s store, 1241s region=region, 1241s consolidated=consolidated, 1241s write_empty_chunks=write_empty, 1241s **self.version_kwargs, 1241s ) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ________ TestZarrWriteEmpty.test_write_region[3-True-False-False-None] _________ 1241s 1241s self = 1241s consolidated = None, compute = False, use_dask = False, write_empty = True 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s assert_identical(actual, zeros) 1241s for i in range(0, 10, 2): 1241s region = {"x": slice(i, i + 2)} 1241s > nonzeros.isel(region).to_zarr( 1241s store, 1241s region=region, 1241s consolidated=consolidated, 1241s write_empty_chunks=write_empty, 1241s **self.version_kwargs, 1241s ) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ________ TestZarrWriteEmpty.test_write_region[3-True-False-True-False] _________ 1241s 1241s self = 1241s consolidated = False, compute = True, use_dask = False, write_empty = True 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s > with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1241s ds = open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _________ TestZarrWriteEmpty.test_write_region[3-True-False-True-True] _________ 1241s 1241s self = 1241s consolidated = True, compute = True, use_dask = False, write_empty = True 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s > with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1241s ds = open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _________ TestZarrWriteEmpty.test_write_region[3-True-False-True-None] _________ 1241s 1241s self = 1241s consolidated = None, compute = True, use_dask = False, write_empty = True 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s > with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1241s ds = open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ________ TestZarrWriteEmpty.test_write_region[3-True-True-False-False] _________ 1241s 1241s self = 1241s consolidated = False, compute = False, use_dask = True, write_empty = True 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s assert_identical(actual, zeros) 1241s for i in range(0, 10, 2): 1241s region = {"x": slice(i, i + 2)} 1241s > nonzeros.isel(region).to_zarr( 1241s store, 1241s region=region, 1241s consolidated=consolidated, 1241s write_empty_chunks=write_empty, 1241s **self.version_kwargs, 1241s ) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _________ TestZarrWriteEmpty.test_write_region[3-True-True-False-True] _________ 1241s 1241s self = 1241s consolidated = True, compute = False, use_dask = True, write_empty = True 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s assert_identical(actual, zeros) 1241s for i in range(0, 10, 2): 1241s region = {"x": slice(i, i + 2)} 1241s > nonzeros.isel(region).to_zarr( 1241s store, 1241s region=region, 1241s consolidated=consolidated, 1241s write_empty_chunks=write_empty, 1241s **self.version_kwargs, 1241s ) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _________ TestZarrWriteEmpty.test_write_region[3-True-True-False-None] _________ 1241s 1241s self = 1241s consolidated = None, compute = False, use_dask = True, write_empty = True 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s assert_identical(actual, zeros) 1241s for i in range(0, 10, 2): 1241s region = {"x": slice(i, i + 2)} 1241s > nonzeros.isel(region).to_zarr( 1241s store, 1241s region=region, 1241s consolidated=consolidated, 1241s write_empty_chunks=write_empty, 1241s **self.version_kwargs, 1241s ) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _________ TestZarrWriteEmpty.test_write_region[3-True-True-True-False] _________ 1241s 1241s self = 1241s consolidated = False, compute = True, use_dask = True, write_empty = True 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s > with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1241s ds = open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _________ TestZarrWriteEmpty.test_write_region[3-True-True-True-True] __________ 1241s 1241s self = 1241s consolidated = True, compute = True, use_dask = True, write_empty = True 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s > with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1241s ds = open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _________ TestZarrWriteEmpty.test_write_region[3-True-True-True-None] __________ 1241s 1241s self = 1241s consolidated = None, compute = True, use_dask = True, write_empty = True 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s > with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1241s ds = open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ________ TestZarrWriteEmpty.test_write_region[3-None-False-False-False] ________ 1241s 1241s self = 1241s consolidated = False, compute = False, use_dask = False, write_empty = None 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s assert_identical(actual, zeros) 1241s for i in range(0, 10, 2): 1241s region = {"x": slice(i, i + 2)} 1241s > nonzeros.isel(region).to_zarr( 1241s store, 1241s region=region, 1241s consolidated=consolidated, 1241s write_empty_chunks=write_empty, 1241s **self.version_kwargs, 1241s ) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ________ TestZarrWriteEmpty.test_write_region[3-None-False-False-True] _________ 1241s 1241s self = 1241s consolidated = True, compute = False, use_dask = False, write_empty = None 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s assert_identical(actual, zeros) 1241s for i in range(0, 10, 2): 1241s region = {"x": slice(i, i + 2)} 1241s > nonzeros.isel(region).to_zarr( 1241s store, 1241s region=region, 1241s consolidated=consolidated, 1241s write_empty_chunks=write_empty, 1241s **self.version_kwargs, 1241s ) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ________ TestZarrWriteEmpty.test_write_region[3-None-False-False-None] _________ 1241s 1241s self = 1241s consolidated = None, compute = False, use_dask = False, write_empty = None 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s assert_identical(actual, zeros) 1241s for i in range(0, 10, 2): 1241s region = {"x": slice(i, i + 2)} 1241s > nonzeros.isel(region).to_zarr( 1241s store, 1241s region=region, 1241s consolidated=consolidated, 1241s write_empty_chunks=write_empty, 1241s **self.version_kwargs, 1241s ) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ________ TestZarrWriteEmpty.test_write_region[3-None-False-True-False] _________ 1241s 1241s self = 1241s consolidated = False, compute = True, use_dask = False, write_empty = None 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s > with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1241s ds = open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _________ TestZarrWriteEmpty.test_write_region[3-None-False-True-True] _________ 1241s 1241s self = 1241s consolidated = True, compute = True, use_dask = False, write_empty = None 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s > with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1241s ds = open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _________ TestZarrWriteEmpty.test_write_region[3-None-False-True-None] _________ 1241s 1241s self = 1241s consolidated = None, compute = True, use_dask = False, write_empty = None 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s > with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1241s ds = open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ________ TestZarrWriteEmpty.test_write_region[3-None-True-False-False] _________ 1241s 1241s self = 1241s consolidated = False, compute = False, use_dask = True, write_empty = None 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s assert_identical(actual, zeros) 1241s for i in range(0, 10, 2): 1241s region = {"x": slice(i, i + 2)} 1241s > nonzeros.isel(region).to_zarr( 1241s store, 1241s region=region, 1241s consolidated=consolidated, 1241s write_empty_chunks=write_empty, 1241s **self.version_kwargs, 1241s ) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _________ TestZarrWriteEmpty.test_write_region[3-None-True-False-True] _________ 1241s 1241s self = 1241s consolidated = True, compute = False, use_dask = True, write_empty = None 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s assert_identical(actual, zeros) 1241s for i in range(0, 10, 2): 1241s region = {"x": slice(i, i + 2)} 1241s > nonzeros.isel(region).to_zarr( 1241s store, 1241s region=region, 1241s consolidated=consolidated, 1241s write_empty_chunks=write_empty, 1241s **self.version_kwargs, 1241s ) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _________ TestZarrWriteEmpty.test_write_region[3-None-True-False-None] _________ 1241s 1241s self = 1241s consolidated = None, compute = False, use_dask = True, write_empty = None 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s assert_identical(actual, zeros) 1241s for i in range(0, 10, 2): 1241s region = {"x": slice(i, i + 2)} 1241s > nonzeros.isel(region).to_zarr( 1241s store, 1241s region=region, 1241s consolidated=consolidated, 1241s write_empty_chunks=write_empty, 1241s **self.version_kwargs, 1241s ) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3046: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _________ TestZarrWriteEmpty.test_write_region[3-None-True-True-False] _________ 1241s 1241s self = 1241s consolidated = False, compute = True, use_dask = True, write_empty = None 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s > with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1241s ds = open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _________ TestZarrWriteEmpty.test_write_region[3-None-True-True-True] __________ 1241s 1241s self = 1241s consolidated = True, compute = True, use_dask = True, write_empty = None 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s > with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1241s ds = open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _________ TestZarrWriteEmpty.test_write_region[3-None-True-True-None] __________ 1241s 1241s self = 1241s consolidated = None, compute = True, use_dask = True, write_empty = None 1241s 1241s @pytest.mark.parametrize("consolidated", [False, True, None]) 1241s @pytest.mark.parametrize("compute", [False, True]) 1241s @pytest.mark.parametrize("use_dask", [False, True]) 1241s @pytest.mark.parametrize("write_empty", [False, True, None]) 1241s def test_write_region(self, consolidated, compute, use_dask, write_empty) -> None: 1241s if (use_dask or not compute) and not has_dask: 1241s pytest.skip("requires dask") 1241s 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s 1241s if use_dask: 1241s zeros = zeros.chunk(2) 1241s nonzeros = nonzeros.chunk(2) 1241s 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr( 1241s store, 1241s consolidated=consolidated, 1241s compute=compute, 1241s encoding={"u": dict(chunks=2)}, 1241s **self.version_kwargs, 1241s ) 1241s if compute: 1241s > with xr.open_zarr( 1241s store, consolidated=consolidated, **self.version_kwargs 1241s ) as actual: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3040: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1241s ds = open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ______________ TestZarrWriteEmpty.test_write_region_mode[3-None] _______________ 1241s 1241s self = 1241s mode = None 1241s 1241s @pytest.mark.parametrize("mode", [None, "r+", "a"]) 1241s def test_write_region_mode(self, mode) -> None: 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr(store, **self.version_kwargs) 1241s for region in [{"x": slice(5)}, {"x": slice(5, 10)}]: 1241s > nonzeros.isel(region).to_zarr( 1241s store, region=region, mode=mode, **self.version_kwargs 1241s ) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3065: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _______________ TestZarrWriteEmpty.test_write_region_mode[3-r+] ________________ 1241s 1241s self = 1241s mode = 'r+' 1241s 1241s @pytest.mark.parametrize("mode", [None, "r+", "a"]) 1241s def test_write_region_mode(self, mode) -> None: 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr(store, **self.version_kwargs) 1241s for region in [{"x": slice(5)}, {"x": slice(5, 10)}]: 1241s > nonzeros.isel(region).to_zarr( 1241s store, region=region, mode=mode, **self.version_kwargs 1241s ) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3065: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ________________ TestZarrWriteEmpty.test_write_region_mode[3-a] ________________ 1241s 1241s self = 1241s mode = 'a' 1241s 1241s @pytest.mark.parametrize("mode", [None, "r+", "a"]) 1241s def test_write_region_mode(self, mode) -> None: 1241s zeros = Dataset({"u": (("x",), np.zeros(10))}) 1241s nonzeros = Dataset({"u": (("x",), np.arange(1, 11))}) 1241s with self.create_zarr_target() as store: 1241s zeros.to_zarr(store, **self.version_kwargs) 1241s for region in [{"x": slice(5)}, {"x": slice(5, 10)}]: 1241s > nonzeros.isel(region).to_zarr( 1241s store, region=region, mode=mode, **self.version_kwargs 1241s ) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3065: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ________ TestZarrWriteEmpty.test_write_preexisting_override_metadata[3] ________ 1241s 1241s self = 1241s 1241s @requires_dask 1241s def test_write_preexisting_override_metadata(self) -> None: 1241s """Metadata should be overridden if mode="a" but not in mode="r+".""" 1241s original = Dataset( 1241s {"u": (("x",), np.zeros(10), {"variable": "original"})}, 1241s attrs={"global": "original"}, 1241s ) 1241s both_modified = Dataset( 1241s {"u": (("x",), np.ones(10), {"variable": "modified"})}, 1241s attrs={"global": "modified"}, 1241s ) 1241s global_modified = Dataset( 1241s {"u": (("x",), np.ones(10), {"variable": "original"})}, 1241s attrs={"global": "modified"}, 1241s ) 1241s only_new_data = Dataset( 1241s {"u": (("x",), np.ones(10), {"variable": "original"})}, 1241s attrs={"global": "original"}, 1241s ) 1241s 1241s with self.create_zarr_target() as store: 1241s original.to_zarr(store, compute=False, **self.version_kwargs) 1241s > both_modified.to_zarr(store, mode="a", **self.version_kwargs) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3093: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1241s return to_zarr( # type: ignore[call-overload,misc] 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1241s dump_to_store(dataset, zstore, writer, encoding=encoding) 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1241s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1241s k: self.open_store_variable(name=k) for k in existing_variable_names 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'u' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ________________ TestZarrWriteEmpty.test_encoding_chunksizes[3] ________________ 1241s 1241s self = 1241s 1241s @requires_dask 1241s def test_encoding_chunksizes(self) -> None: 1241s # regression test for GH2278 1241s # see also test_encoding_chunksizes_unlimited 1241s nx, ny, nt = 4, 4, 5 1241s original = xr.Dataset( 1241s {}, 1241s coords={ 1241s "x": np.arange(nx), 1241s "y": np.arange(ny), 1241s "t": np.arange(nt), 1241s }, 1241s ) 1241s original["v"] = xr.Variable(("x", "y", "t"), np.zeros((nx, ny, nt))) 1241s original = original.chunk({"t": 1, "x": 2, "y": 2}) 1241s 1241s > with self.roundtrip(original) as ds1: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3207: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'v' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ______ TestZarrWriteEmpty.test_chunk_encoding_with_partial_dask_chunks[3] ______ 1241s 1241s self = 1241s 1241s @requires_dask 1241s def test_chunk_encoding_with_partial_dask_chunks(self) -> None: 1241s original = xr.Dataset( 1241s {"x": xr.DataArray(np.random.random(size=(6, 8)), dims=("a", "b"))} 1241s ).chunk({"a": 3}) 1241s 1241s > with self.roundtrip( 1241s original, save_kwargs={"encoding": {"x": {"chunks": [3, 2]}}} 1241s ) as ds1: 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3218: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1241s with self.open(store_target, **open_kwargs) as ds: 1241s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1241s return next(self.gen) 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1241s with xr.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'x' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s _______________ TestZarrWriteEmpty.test_open_zarr_use_cftime[3] ________________ 1241s 1241s self = 1241s 1241s @requires_cftime 1241s def test_open_zarr_use_cftime(self) -> None: 1241s ds = create_test_data() 1241s with self.create_zarr_target() as store_target: 1241s ds.to_zarr(store_target, **self.version_kwargs) 1241s > ds_a = xr.open_zarr(store_target, **self.version_kwargs) 1241s 1241s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3237: 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1241s ds = open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1241s backend_ds = backend.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1241s ds = store_entrypoint.open_dataset( 1241s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1241s vars, attrs = filename_or_obj.load() 1241s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1241s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1241s return Frozen(dict(*args, **kwargs)) 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1241s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1241s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1241s 1241s self = , name = 'dim2' 1241s 1241s def open_store_variable(self, name): 1241s zarr_array = self.members[name] 1241s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1241s try_nczarr = self._mode == "r" 1241s dimensions, attributes = _get_zarr_dims_and_attrs( 1241s zarr_array, DIMENSION_KEY, try_nczarr 1241s ) 1241s attributes = dict(attributes) 1241s 1241s encoding = { 1241s "chunks": zarr_array.chunks, 1241s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1241s } 1241s 1241s if _zarr_v3(): 1241s encoding.update( 1241s { 1241s "compressors": zarr_array.compressors, 1241s "filters": zarr_array.filters, 1241s "shards": zarr_array.shards, 1241s } 1241s ) 1241s if self.zarr_group.metadata.zarr_format == 3: 1241s encoding.update({"serializer": zarr_array.serializer}) 1241s else: 1241s encoding.update( 1241s { 1241s "compressor": zarr_array.compressor, 1241s "filters": zarr_array.filters, 1241s } 1241s ) 1241s 1241s if self._use_zarr_fill_value_as_mask: 1241s # Setting this attribute triggers CF decoding for missing values 1241s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1241s if zarr_array.fill_value is not None: 1241s attributes["_FillValue"] = zarr_array.fill_value 1241s elif "_FillValue" in attributes: 1241s original_zarr_dtype = zarr_array.metadata.data_type 1241s attributes["_FillValue"] = FillValueCoder.decode( 1241s > attributes["_FillValue"], original_zarr_dtype.value 1241s ) 1241s E AttributeError: 'Float64' object has no attribute 'value' 1241s 1241s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1241s ______________ TestZarrWriteEmpty.test_write_read_select_write[3] ______________ 1241s 1241s self = 1241s 1241s def test_write_read_select_write(self) -> None: 1241s # Test for https://github.com/pydata/xarray/issues/4084 1241s ds = create_test_data() 1241s 1242s # NOTE: using self.roundtrip, which uses open_dataset, will not trigger the bug. 1242s with self.create_zarr_target() as initial_store: 1242s ds.to_zarr(initial_store, mode="w", **self.version_kwargs) 1242s > ds1 = xr.open_zarr(initial_store, **self.version_kwargs) 1242s 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3252: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1242s ds = open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1242s backend_ds = backend.open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1242s ds = store_entrypoint.open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1242s vars, attrs = filename_or_obj.load() 1242s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1242s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1242s return Frozen(dict(*args, **kwargs)) 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s self = , name = 'dim2' 1242s 1242s def open_store_variable(self, name): 1242s zarr_array = self.members[name] 1242s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1242s try_nczarr = self._mode == "r" 1242s dimensions, attributes = _get_zarr_dims_and_attrs( 1242s zarr_array, DIMENSION_KEY, try_nczarr 1242s ) 1242s attributes = dict(attributes) 1242s 1242s encoding = { 1242s "chunks": zarr_array.chunks, 1242s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1242s } 1242s 1242s if _zarr_v3(): 1242s encoding.update( 1242s { 1242s "compressors": zarr_array.compressors, 1242s "filters": zarr_array.filters, 1242s "shards": zarr_array.shards, 1242s } 1242s ) 1242s if self.zarr_group.metadata.zarr_format == 3: 1242s encoding.update({"serializer": zarr_array.serializer}) 1242s else: 1242s encoding.update( 1242s { 1242s "compressor": zarr_array.compressor, 1242s "filters": zarr_array.filters, 1242s } 1242s ) 1242s 1242s if self._use_zarr_fill_value_as_mask: 1242s # Setting this attribute triggers CF decoding for missing values 1242s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1242s if zarr_array.fill_value is not None: 1242s attributes["_FillValue"] = zarr_array.fill_value 1242s elif "_FillValue" in attributes: 1242s original_zarr_dtype = zarr_array.metadata.data_type 1242s attributes["_FillValue"] = FillValueCoder.decode( 1242s > attributes["_FillValue"], original_zarr_dtype.value 1242s ) 1242s E AttributeError: 'Float64' object has no attribute 'value' 1242s 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1242s __________________ TestZarrWriteEmpty.test_attributes[3-obj1] __________________ 1242s 1242s self = 1242s obj = Size: 8B 1242s array(nan) 1242s Attributes: 1242s good: {'key': 'value'} 1242s 1242s @pytest.mark.parametrize("obj", [Dataset(), DataArray(name="foo")]) 1242s def test_attributes(self, obj) -> None: 1242s obj = obj.copy() 1242s 1242s obj.attrs["good"] = {"key": "value"} 1242s ds = obj if isinstance(obj, Dataset) else obj.to_dataset() 1242s with self.create_zarr_target() as store_target: 1242s ds.to_zarr(store_target, **self.version_kwargs) 1242s > assert_identical(ds, xr.open_zarr(store_target, **self.version_kwargs)) 1242s 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3267: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1242s ds = open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1242s backend_ds = backend.open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1242s ds = store_entrypoint.open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1242s vars, attrs = filename_or_obj.load() 1242s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1242s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1242s return Frozen(dict(*args, **kwargs)) 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s self = , name = 'foo' 1242s 1242s def open_store_variable(self, name): 1242s zarr_array = self.members[name] 1242s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1242s try_nczarr = self._mode == "r" 1242s dimensions, attributes = _get_zarr_dims_and_attrs( 1242s zarr_array, DIMENSION_KEY, try_nczarr 1242s ) 1242s attributes = dict(attributes) 1242s 1242s encoding = { 1242s "chunks": zarr_array.chunks, 1242s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1242s } 1242s 1242s if _zarr_v3(): 1242s encoding.update( 1242s { 1242s "compressors": zarr_array.compressors, 1242s "filters": zarr_array.filters, 1242s "shards": zarr_array.shards, 1242s } 1242s ) 1242s if self.zarr_group.metadata.zarr_format == 3: 1242s encoding.update({"serializer": zarr_array.serializer}) 1242s else: 1242s encoding.update( 1242s { 1242s "compressor": zarr_array.compressor, 1242s "filters": zarr_array.filters, 1242s } 1242s ) 1242s 1242s if self._use_zarr_fill_value_as_mask: 1242s # Setting this attribute triggers CF decoding for missing values 1242s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1242s if zarr_array.fill_value is not None: 1242s attributes["_FillValue"] = zarr_array.fill_value 1242s elif "_FillValue" in attributes: 1242s original_zarr_dtype = zarr_array.metadata.data_type 1242s attributes["_FillValue"] = FillValueCoder.decode( 1242s > attributes["_FillValue"], original_zarr_dtype.value 1242s ) 1242s E AttributeError: 'Float64' object has no attribute 'value' 1242s 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1242s _ TestZarrWriteEmpty.test_chunked_datetime64_or_timedelta64[3-datetime64[ns]] __ 1242s 1242s self = 1242s dtype = 'datetime64[ns]' 1242s 1242s @requires_dask 1242s @pytest.mark.parametrize("dtype", ["datetime64[ns]", "timedelta64[ns]"]) 1242s def test_chunked_datetime64_or_timedelta64(self, dtype) -> None: 1242s # Generalized from @malmans2's test in PR #8253 1242s original = create_test_data().astype(dtype).chunk(1) 1242s > with self.roundtrip( 1242s original, 1242s open_kwargs={ 1242s "chunks": {}, 1242s "decode_timedelta": CFTimedeltaCoder(time_unit="ns"), 1242s }, 1242s ) as actual: 1242s 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3280: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1242s return next(self.gen) 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1242s with self.open(store_target, **open_kwargs) as ds: 1242s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1242s return next(self.gen) 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1242s with xr.open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1242s backend_ds = backend.open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1242s ds = store_entrypoint.open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1242s vars, attrs = filename_or_obj.load() 1242s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1242s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1242s return Frozen(dict(*args, **kwargs)) 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s self = , name = 'dim2' 1242s 1242s def open_store_variable(self, name): 1242s zarr_array = self.members[name] 1242s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1242s try_nczarr = self._mode == "r" 1242s dimensions, attributes = _get_zarr_dims_and_attrs( 1242s zarr_array, DIMENSION_KEY, try_nczarr 1242s ) 1242s attributes = dict(attributes) 1242s 1242s encoding = { 1242s "chunks": zarr_array.chunks, 1242s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1242s } 1242s 1242s if _zarr_v3(): 1242s encoding.update( 1242s { 1242s "compressors": zarr_array.compressors, 1242s "filters": zarr_array.filters, 1242s "shards": zarr_array.shards, 1242s } 1242s ) 1242s if self.zarr_group.metadata.zarr_format == 3: 1242s encoding.update({"serializer": zarr_array.serializer}) 1242s else: 1242s encoding.update( 1242s { 1242s "compressor": zarr_array.compressor, 1242s "filters": zarr_array.filters, 1242s } 1242s ) 1242s 1242s if self._use_zarr_fill_value_as_mask: 1242s # Setting this attribute triggers CF decoding for missing values 1242s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1242s if zarr_array.fill_value is not None: 1242s attributes["_FillValue"] = zarr_array.fill_value 1242s elif "_FillValue" in attributes: 1242s original_zarr_dtype = zarr_array.metadata.data_type 1242s attributes["_FillValue"] = FillValueCoder.decode( 1242s > attributes["_FillValue"], original_zarr_dtype.value 1242s ) 1242s E AttributeError: 'Float64' object has no attribute 'value' 1242s 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1242s _ TestZarrWriteEmpty.test_chunked_datetime64_or_timedelta64[3-timedelta64[ns]] _ 1242s 1242s self = 1242s dtype = 'timedelta64[ns]' 1242s 1242s @requires_dask 1242s @pytest.mark.parametrize("dtype", ["datetime64[ns]", "timedelta64[ns]"]) 1242s def test_chunked_datetime64_or_timedelta64(self, dtype) -> None: 1242s # Generalized from @malmans2's test in PR #8253 1242s original = create_test_data().astype(dtype).chunk(1) 1242s > with self.roundtrip( 1242s original, 1242s open_kwargs={ 1242s "chunks": {}, 1242s "decode_timedelta": CFTimedeltaCoder(time_unit="ns"), 1242s }, 1242s ) as actual: 1242s 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3280: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1242s return next(self.gen) 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1242s with self.open(store_target, **open_kwargs) as ds: 1242s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1242s return next(self.gen) 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1242s with xr.open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1242s backend_ds = backend.open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1242s ds = store_entrypoint.open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1242s vars, attrs = filename_or_obj.load() 1242s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1242s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1242s return Frozen(dict(*args, **kwargs)) 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s self = , name = 'dim2' 1242s 1242s def open_store_variable(self, name): 1242s zarr_array = self.members[name] 1242s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1242s try_nczarr = self._mode == "r" 1242s dimensions, attributes = _get_zarr_dims_and_attrs( 1242s zarr_array, DIMENSION_KEY, try_nczarr 1242s ) 1242s attributes = dict(attributes) 1242s 1242s encoding = { 1242s "chunks": zarr_array.chunks, 1242s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1242s } 1242s 1242s if _zarr_v3(): 1242s encoding.update( 1242s { 1242s "compressors": zarr_array.compressors, 1242s "filters": zarr_array.filters, 1242s "shards": zarr_array.shards, 1242s } 1242s ) 1242s if self.zarr_group.metadata.zarr_format == 3: 1242s encoding.update({"serializer": zarr_array.serializer}) 1242s else: 1242s encoding.update( 1242s { 1242s "compressor": zarr_array.compressor, 1242s "filters": zarr_array.filters, 1242s } 1242s ) 1242s 1242s if self._use_zarr_fill_value_as_mask: 1242s # Setting this attribute triggers CF decoding for missing values 1242s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1242s if zarr_array.fill_value is not None: 1242s attributes["_FillValue"] = zarr_array.fill_value 1242s elif "_FillValue" in attributes: 1242s original_zarr_dtype = zarr_array.metadata.data_type 1242s attributes["_FillValue"] = FillValueCoder.decode( 1242s > attributes["_FillValue"], original_zarr_dtype.value 1242s ) 1242s E AttributeError: 'Float64' object has no attribute 'value' 1242s 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1242s ___________ TestZarrWriteEmpty.test_zarr_fill_value_setting[3-float] ___________ 1242s 1242s self = 1242s dtype = 1242s 1242s @requires_dask 1242s @pytest.mark.parametrize("dtype", [int, float]) 1242s def test_zarr_fill_value_setting(self, dtype): 1242s # When zarr_format=2, _FillValue sets fill_value 1242s # When zarr_format=3, fill_value is set independently 1242s # We test this by writing a dask array with compute=False, 1242s # on read we should receive chunks filled with `fill_value` 1242s fv = -1 1242s ds = xr.Dataset( 1242s {"foo": ("x", dask.array.from_array(np.array([0, 0, 0], dtype=dtype)))} 1242s ) 1242s expected = xr.Dataset({"foo": ("x", [fv] * 3)}) 1242s 1242s zarr_format_2 = ( 1242s has_zarr_v3 and zarr.config.get("default_zarr_format") == 2 1242s ) or not has_zarr_v3 1242s if zarr_format_2: 1242s attr = "_FillValue" 1242s expected.foo.attrs[attr] = fv 1242s else: 1242s attr = "fill_value" 1242s if dtype is float: 1242s # for floats, Xarray inserts a default `np.nan` 1242s expected.foo.attrs["_FillValue"] = np.nan 1242s 1242s # turn off all decoding so we see what Zarr returns to us. 1242s # Since chunks, are not written, we should receive on `fill_value` 1242s open_kwargs = { 1242s "mask_and_scale": False, 1242s "consolidated": False, 1242s "use_zarr_fill_value_as_mask": False, 1242s } 1242s save_kwargs = dict(compute=False, consolidated=False) 1242s > with self.roundtrip( 1242s ds, 1242s save_kwargs=ChainMap(save_kwargs, dict(encoding={"foo": {attr: fv}})), 1242s open_kwargs=open_kwargs, 1242s ) as actual: 1242s 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3374: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1242s return next(self.gen) 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2315: in roundtrip 1242s with self.open(store_target, **open_kwargs) as ds: 1242s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1242s return next(self.gen) 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:2300: in open 1242s with xr.open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1242s backend_ds = backend.open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1242s ds = store_entrypoint.open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1242s vars, attrs = filename_or_obj.load() 1242s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1242s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1242s return Frozen(dict(*args, **kwargs)) 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s self = , name = 'foo' 1242s 1242s def open_store_variable(self, name): 1242s zarr_array = self.members[name] 1242s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1242s try_nczarr = self._mode == "r" 1242s dimensions, attributes = _get_zarr_dims_and_attrs( 1242s zarr_array, DIMENSION_KEY, try_nczarr 1242s ) 1242s attributes = dict(attributes) 1242s 1242s encoding = { 1242s "chunks": zarr_array.chunks, 1242s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1242s } 1242s 1242s if _zarr_v3(): 1242s encoding.update( 1242s { 1242s "compressors": zarr_array.compressors, 1242s "filters": zarr_array.filters, 1242s "shards": zarr_array.shards, 1242s } 1242s ) 1242s if self.zarr_group.metadata.zarr_format == 3: 1242s encoding.update({"serializer": zarr_array.serializer}) 1242s else: 1242s encoding.update( 1242s { 1242s "compressor": zarr_array.compressor, 1242s "filters": zarr_array.filters, 1242s } 1242s ) 1242s 1242s if self._use_zarr_fill_value_as_mask: 1242s # Setting this attribute triggers CF decoding for missing values 1242s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1242s if zarr_array.fill_value is not None: 1242s attributes["_FillValue"] = zarr_array.fill_value 1242s elif "_FillValue" in attributes: 1242s original_zarr_dtype = zarr_array.metadata.data_type 1242s attributes["_FillValue"] = FillValueCoder.decode( 1242s > attributes["_FillValue"], original_zarr_dtype.value 1242s ) 1242s E AttributeError: 'Float64' object has no attribute 'value' 1242s 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1242s _______________ TestZarrWriteEmpty.test_write_empty[3-True-True] _______________ 1242s 1242s self = 1242s consolidated = True, write_empty = True 1242s 1242s @pytest.mark.parametrize("consolidated", [True, False, None]) 1242s @pytest.mark.parametrize("write_empty", [True, False, None]) 1242s def test_write_empty( 1242s self, 1242s consolidated: bool | None, 1242s write_empty: bool | None, 1242s ) -> None: 1242s def assert_expected_files(expected: list[str], store: str) -> None: 1242s """Convenience for comparing with actual files written""" 1242s ls = [] 1242s test_root = os.path.join(store, "test") 1242s for root, _, files in os.walk(test_root): 1242s ls.extend( 1242s [ 1242s os.path.join(root, f).removeprefix(test_root).lstrip("/") 1242s for f in files 1242s ] 1242s ) 1242s 1242s assert set(expected) == set( 1242s [ 1242s file.lstrip("c/") 1242s for file in ls 1242s if (file not in (".zattrs", ".zarray", "zarr.json")) 1242s ] 1242s ) 1242s 1242s # The zarr format is set by the `default_zarr_format` 1242s # pytest fixture that acts on a superclass 1242s zarr_format_3 = has_zarr_v3 and zarr.config.config["default_zarr_format"] == 3 1242s if (write_empty is False) or (write_empty is None and has_zarr_v3): 1242s expected = ["0.1.0"] 1242s else: 1242s expected = [ 1242s "0.0.0", 1242s "0.0.1", 1242s "0.1.0", 1242s "0.1.1", 1242s ] 1242s 1242s if zarr_format_3: 1242s data = np.array([0.0, 0, 1.0, 0]).reshape((1, 2, 2)) 1242s # transform to the path style of zarr 3 1242s # e.g. 0/0/1 1242s expected = [e.replace(".", "/") for e in expected] 1242s else: 1242s # use nan for default fill_value behaviour 1242s data = np.array([np.nan, np.nan, 1.0, np.nan]).reshape((1, 2, 2)) 1242s 1242s ds = xr.Dataset(data_vars={"test": (("Z", "Y", "X"), data)}) 1242s 1242s if has_dask: 1242s ds["test"] = ds["test"].chunk(1) 1242s encoding = None 1242s else: 1242s encoding = {"test": {"chunks": (1, 1, 1)}} 1242s 1242s with self.temp_dir() as (d, store): 1242s ds.to_zarr( 1242s store, 1242s mode="w", 1242s encoding=encoding, 1242s write_empty_chunks=write_empty, 1242s ) 1242s 1242s # check expected files after a write 1242s assert_expected_files(expected, store) 1242s 1242s > with self.roundtrip_dir( 1242s ds, 1242s store, 1242s save_kwargs={ 1242s "mode": "a", 1242s "append_dim": "Z", 1242s "write_empty_chunks": write_empty, 1242s }, 1242s ) as a_ds: 1242s 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3761: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1242s return next(self.gen) 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3687: in roundtrip_dir 1242s data.to_zarr(store, **save_kwargs, **self.version_kwargs) 1242s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1242s return to_zarr( # type: ignore[call-overload,misc] 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1242s dump_to_store(dataset, zstore, writer, encoding=encoding) 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1242s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1242s k: self.open_store_variable(name=k) for k in existing_variable_names 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s self = , name = 'test' 1242s 1242s def open_store_variable(self, name): 1242s zarr_array = self.members[name] 1242s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1242s try_nczarr = self._mode == "r" 1242s dimensions, attributes = _get_zarr_dims_and_attrs( 1242s zarr_array, DIMENSION_KEY, try_nczarr 1242s ) 1242s attributes = dict(attributes) 1242s 1242s encoding = { 1242s "chunks": zarr_array.chunks, 1242s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1242s } 1242s 1242s if _zarr_v3(): 1242s encoding.update( 1242s { 1242s "compressors": zarr_array.compressors, 1242s "filters": zarr_array.filters, 1242s "shards": zarr_array.shards, 1242s } 1242s ) 1242s if self.zarr_group.metadata.zarr_format == 3: 1242s encoding.update({"serializer": zarr_array.serializer}) 1242s else: 1242s encoding.update( 1242s { 1242s "compressor": zarr_array.compressor, 1242s "filters": zarr_array.filters, 1242s } 1242s ) 1242s 1242s if self._use_zarr_fill_value_as_mask: 1242s # Setting this attribute triggers CF decoding for missing values 1242s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1242s if zarr_array.fill_value is not None: 1242s attributes["_FillValue"] = zarr_array.fill_value 1242s elif "_FillValue" in attributes: 1242s original_zarr_dtype = zarr_array.metadata.data_type 1242s attributes["_FillValue"] = FillValueCoder.decode( 1242s > attributes["_FillValue"], original_zarr_dtype.value 1242s ) 1242s E AttributeError: 'Float64' object has no attribute 'value' 1242s 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1242s ______________ TestZarrWriteEmpty.test_write_empty[3-True-False] _______________ 1242s 1242s self = 1242s consolidated = False, write_empty = True 1242s 1242s @pytest.mark.parametrize("consolidated", [True, False, None]) 1242s @pytest.mark.parametrize("write_empty", [True, False, None]) 1242s def test_write_empty( 1242s self, 1242s consolidated: bool | None, 1242s write_empty: bool | None, 1242s ) -> None: 1242s def assert_expected_files(expected: list[str], store: str) -> None: 1242s """Convenience for comparing with actual files written""" 1242s ls = [] 1242s test_root = os.path.join(store, "test") 1242s for root, _, files in os.walk(test_root): 1242s ls.extend( 1242s [ 1242s os.path.join(root, f).removeprefix(test_root).lstrip("/") 1242s for f in files 1242s ] 1242s ) 1242s 1242s assert set(expected) == set( 1242s [ 1242s file.lstrip("c/") 1242s for file in ls 1242s if (file not in (".zattrs", ".zarray", "zarr.json")) 1242s ] 1242s ) 1242s 1242s # The zarr format is set by the `default_zarr_format` 1242s # pytest fixture that acts on a superclass 1242s zarr_format_3 = has_zarr_v3 and zarr.config.config["default_zarr_format"] == 3 1242s if (write_empty is False) or (write_empty is None and has_zarr_v3): 1242s expected = ["0.1.0"] 1242s else: 1242s expected = [ 1242s "0.0.0", 1242s "0.0.1", 1242s "0.1.0", 1242s "0.1.1", 1242s ] 1242s 1242s if zarr_format_3: 1242s data = np.array([0.0, 0, 1.0, 0]).reshape((1, 2, 2)) 1242s # transform to the path style of zarr 3 1242s # e.g. 0/0/1 1242s expected = [e.replace(".", "/") for e in expected] 1242s else: 1242s # use nan for default fill_value behaviour 1242s data = np.array([np.nan, np.nan, 1.0, np.nan]).reshape((1, 2, 2)) 1242s 1242s ds = xr.Dataset(data_vars={"test": (("Z", "Y", "X"), data)}) 1242s 1242s if has_dask: 1242s ds["test"] = ds["test"].chunk(1) 1242s encoding = None 1242s else: 1242s encoding = {"test": {"chunks": (1, 1, 1)}} 1242s 1242s with self.temp_dir() as (d, store): 1242s ds.to_zarr( 1242s store, 1242s mode="w", 1242s encoding=encoding, 1242s write_empty_chunks=write_empty, 1242s ) 1242s 1242s # check expected files after a write 1242s assert_expected_files(expected, store) 1242s 1242s > with self.roundtrip_dir( 1242s ds, 1242s store, 1242s save_kwargs={ 1242s "mode": "a", 1242s "append_dim": "Z", 1242s "write_empty_chunks": write_empty, 1242s }, 1242s ) as a_ds: 1242s 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3761: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1242s return next(self.gen) 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3687: in roundtrip_dir 1242s data.to_zarr(store, **save_kwargs, **self.version_kwargs) 1242s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1242s return to_zarr( # type: ignore[call-overload,misc] 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1242s dump_to_store(dataset, zstore, writer, encoding=encoding) 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1242s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1242s k: self.open_store_variable(name=k) for k in existing_variable_names 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s self = , name = 'test' 1242s 1242s def open_store_variable(self, name): 1242s zarr_array = self.members[name] 1242s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1242s try_nczarr = self._mode == "r" 1242s dimensions, attributes = _get_zarr_dims_and_attrs( 1242s zarr_array, DIMENSION_KEY, try_nczarr 1242s ) 1242s attributes = dict(attributes) 1242s 1242s encoding = { 1242s "chunks": zarr_array.chunks, 1242s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1242s } 1242s 1242s if _zarr_v3(): 1242s encoding.update( 1242s { 1242s "compressors": zarr_array.compressors, 1242s "filters": zarr_array.filters, 1242s "shards": zarr_array.shards, 1242s } 1242s ) 1242s if self.zarr_group.metadata.zarr_format == 3: 1242s encoding.update({"serializer": zarr_array.serializer}) 1242s else: 1242s encoding.update( 1242s { 1242s "compressor": zarr_array.compressor, 1242s "filters": zarr_array.filters, 1242s } 1242s ) 1242s 1242s if self._use_zarr_fill_value_as_mask: 1242s # Setting this attribute triggers CF decoding for missing values 1242s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1242s if zarr_array.fill_value is not None: 1242s attributes["_FillValue"] = zarr_array.fill_value 1242s elif "_FillValue" in attributes: 1242s original_zarr_dtype = zarr_array.metadata.data_type 1242s attributes["_FillValue"] = FillValueCoder.decode( 1242s > attributes["_FillValue"], original_zarr_dtype.value 1242s ) 1242s E AttributeError: 'Float64' object has no attribute 'value' 1242s 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1242s _______________ TestZarrWriteEmpty.test_write_empty[3-True-None] _______________ 1242s 1242s self = 1242s consolidated = None, write_empty = True 1242s 1242s @pytest.mark.parametrize("consolidated", [True, False, None]) 1242s @pytest.mark.parametrize("write_empty", [True, False, None]) 1242s def test_write_empty( 1242s self, 1242s consolidated: bool | None, 1242s write_empty: bool | None, 1242s ) -> None: 1242s def assert_expected_files(expected: list[str], store: str) -> None: 1242s """Convenience for comparing with actual files written""" 1242s ls = [] 1242s test_root = os.path.join(store, "test") 1242s for root, _, files in os.walk(test_root): 1242s ls.extend( 1242s [ 1242s os.path.join(root, f).removeprefix(test_root).lstrip("/") 1242s for f in files 1242s ] 1242s ) 1242s 1242s assert set(expected) == set( 1242s [ 1242s file.lstrip("c/") 1242s for file in ls 1242s if (file not in (".zattrs", ".zarray", "zarr.json")) 1242s ] 1242s ) 1242s 1242s # The zarr format is set by the `default_zarr_format` 1242s # pytest fixture that acts on a superclass 1242s zarr_format_3 = has_zarr_v3 and zarr.config.config["default_zarr_format"] == 3 1242s if (write_empty is False) or (write_empty is None and has_zarr_v3): 1242s expected = ["0.1.0"] 1242s else: 1242s expected = [ 1242s "0.0.0", 1242s "0.0.1", 1242s "0.1.0", 1242s "0.1.1", 1242s ] 1242s 1242s if zarr_format_3: 1242s data = np.array([0.0, 0, 1.0, 0]).reshape((1, 2, 2)) 1242s # transform to the path style of zarr 3 1242s # e.g. 0/0/1 1242s expected = [e.replace(".", "/") for e in expected] 1242s else: 1242s # use nan for default fill_value behaviour 1242s data = np.array([np.nan, np.nan, 1.0, np.nan]).reshape((1, 2, 2)) 1242s 1242s ds = xr.Dataset(data_vars={"test": (("Z", "Y", "X"), data)}) 1242s 1242s if has_dask: 1242s ds["test"] = ds["test"].chunk(1) 1242s encoding = None 1242s else: 1242s encoding = {"test": {"chunks": (1, 1, 1)}} 1242s 1242s with self.temp_dir() as (d, store): 1242s ds.to_zarr( 1242s store, 1242s mode="w", 1242s encoding=encoding, 1242s write_empty_chunks=write_empty, 1242s ) 1242s 1242s # check expected files after a write 1242s assert_expected_files(expected, store) 1242s 1242s > with self.roundtrip_dir( 1242s ds, 1242s store, 1242s save_kwargs={ 1242s "mode": "a", 1242s "append_dim": "Z", 1242s "write_empty_chunks": write_empty, 1242s }, 1242s ) as a_ds: 1242s 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3761: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1242s return next(self.gen) 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3687: in roundtrip_dir 1242s data.to_zarr(store, **save_kwargs, **self.version_kwargs) 1242s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1242s return to_zarr( # type: ignore[call-overload,misc] 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1242s dump_to_store(dataset, zstore, writer, encoding=encoding) 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1242s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1242s k: self.open_store_variable(name=k) for k in existing_variable_names 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s self = , name = 'test' 1242s 1242s def open_store_variable(self, name): 1242s zarr_array = self.members[name] 1242s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1242s try_nczarr = self._mode == "r" 1242s dimensions, attributes = _get_zarr_dims_and_attrs( 1242s zarr_array, DIMENSION_KEY, try_nczarr 1242s ) 1242s attributes = dict(attributes) 1242s 1242s encoding = { 1242s "chunks": zarr_array.chunks, 1242s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1242s } 1242s 1242s if _zarr_v3(): 1242s encoding.update( 1242s { 1242s "compressors": zarr_array.compressors, 1242s "filters": zarr_array.filters, 1242s "shards": zarr_array.shards, 1242s } 1242s ) 1242s if self.zarr_group.metadata.zarr_format == 3: 1242s encoding.update({"serializer": zarr_array.serializer}) 1242s else: 1242s encoding.update( 1242s { 1242s "compressor": zarr_array.compressor, 1242s "filters": zarr_array.filters, 1242s } 1242s ) 1242s 1242s if self._use_zarr_fill_value_as_mask: 1242s # Setting this attribute triggers CF decoding for missing values 1242s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1242s if zarr_array.fill_value is not None: 1242s attributes["_FillValue"] = zarr_array.fill_value 1242s elif "_FillValue" in attributes: 1242s original_zarr_dtype = zarr_array.metadata.data_type 1242s attributes["_FillValue"] = FillValueCoder.decode( 1242s > attributes["_FillValue"], original_zarr_dtype.value 1242s ) 1242s E AttributeError: 'Float64' object has no attribute 'value' 1242s 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1242s ______________ TestZarrWriteEmpty.test_write_empty[3-False-True] _______________ 1242s 1242s self = 1242s consolidated = True, write_empty = False 1242s 1242s @pytest.mark.parametrize("consolidated", [True, False, None]) 1242s @pytest.mark.parametrize("write_empty", [True, False, None]) 1242s def test_write_empty( 1242s self, 1242s consolidated: bool | None, 1242s write_empty: bool | None, 1242s ) -> None: 1242s def assert_expected_files(expected: list[str], store: str) -> None: 1242s """Convenience for comparing with actual files written""" 1242s ls = [] 1242s test_root = os.path.join(store, "test") 1242s for root, _, files in os.walk(test_root): 1242s ls.extend( 1242s [ 1242s os.path.join(root, f).removeprefix(test_root).lstrip("/") 1242s for f in files 1242s ] 1242s ) 1242s 1242s assert set(expected) == set( 1242s [ 1242s file.lstrip("c/") 1242s for file in ls 1242s if (file not in (".zattrs", ".zarray", "zarr.json")) 1242s ] 1242s ) 1242s 1242s # The zarr format is set by the `default_zarr_format` 1242s # pytest fixture that acts on a superclass 1242s zarr_format_3 = has_zarr_v3 and zarr.config.config["default_zarr_format"] == 3 1242s if (write_empty is False) or (write_empty is None and has_zarr_v3): 1242s expected = ["0.1.0"] 1242s else: 1242s expected = [ 1242s "0.0.0", 1242s "0.0.1", 1242s "0.1.0", 1242s "0.1.1", 1242s ] 1242s 1242s if zarr_format_3: 1242s data = np.array([0.0, 0, 1.0, 0]).reshape((1, 2, 2)) 1242s # transform to the path style of zarr 3 1242s # e.g. 0/0/1 1242s expected = [e.replace(".", "/") for e in expected] 1242s else: 1242s # use nan for default fill_value behaviour 1242s data = np.array([np.nan, np.nan, 1.0, np.nan]).reshape((1, 2, 2)) 1242s 1242s ds = xr.Dataset(data_vars={"test": (("Z", "Y", "X"), data)}) 1242s 1242s if has_dask: 1242s ds["test"] = ds["test"].chunk(1) 1242s encoding = None 1242s else: 1242s encoding = {"test": {"chunks": (1, 1, 1)}} 1242s 1242s with self.temp_dir() as (d, store): 1242s ds.to_zarr( 1242s store, 1242s mode="w", 1242s encoding=encoding, 1242s write_empty_chunks=write_empty, 1242s ) 1242s 1242s # check expected files after a write 1242s assert_expected_files(expected, store) 1242s 1242s > with self.roundtrip_dir( 1242s ds, 1242s store, 1242s save_kwargs={ 1242s "mode": "a", 1242s "append_dim": "Z", 1242s "write_empty_chunks": write_empty, 1242s }, 1242s ) as a_ds: 1242s 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3761: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1242s return next(self.gen) 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3687: in roundtrip_dir 1242s data.to_zarr(store, **save_kwargs, **self.version_kwargs) 1242s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1242s return to_zarr( # type: ignore[call-overload,misc] 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1242s dump_to_store(dataset, zstore, writer, encoding=encoding) 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1242s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1242s k: self.open_store_variable(name=k) for k in existing_variable_names 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s self = , name = 'test' 1242s 1242s def open_store_variable(self, name): 1242s zarr_array = self.members[name] 1242s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1242s try_nczarr = self._mode == "r" 1242s dimensions, attributes = _get_zarr_dims_and_attrs( 1242s zarr_array, DIMENSION_KEY, try_nczarr 1242s ) 1242s attributes = dict(attributes) 1242s 1242s encoding = { 1242s "chunks": zarr_array.chunks, 1242s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1242s } 1242s 1242s if _zarr_v3(): 1242s encoding.update( 1242s { 1242s "compressors": zarr_array.compressors, 1242s "filters": zarr_array.filters, 1242s "shards": zarr_array.shards, 1242s } 1242s ) 1242s if self.zarr_group.metadata.zarr_format == 3: 1242s encoding.update({"serializer": zarr_array.serializer}) 1242s else: 1242s encoding.update( 1242s { 1242s "compressor": zarr_array.compressor, 1242s "filters": zarr_array.filters, 1242s } 1242s ) 1242s 1242s if self._use_zarr_fill_value_as_mask: 1242s # Setting this attribute triggers CF decoding for missing values 1242s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1242s if zarr_array.fill_value is not None: 1242s attributes["_FillValue"] = zarr_array.fill_value 1242s elif "_FillValue" in attributes: 1242s original_zarr_dtype = zarr_array.metadata.data_type 1242s attributes["_FillValue"] = FillValueCoder.decode( 1242s > attributes["_FillValue"], original_zarr_dtype.value 1242s ) 1242s E AttributeError: 'Float64' object has no attribute 'value' 1242s 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1242s ______________ TestZarrWriteEmpty.test_write_empty[3-False-False] ______________ 1242s 1242s self = 1242s consolidated = False, write_empty = False 1242s 1242s @pytest.mark.parametrize("consolidated", [True, False, None]) 1242s @pytest.mark.parametrize("write_empty", [True, False, None]) 1242s def test_write_empty( 1242s self, 1242s consolidated: bool | None, 1242s write_empty: bool | None, 1242s ) -> None: 1242s def assert_expected_files(expected: list[str], store: str) -> None: 1242s """Convenience for comparing with actual files written""" 1242s ls = [] 1242s test_root = os.path.join(store, "test") 1242s for root, _, files in os.walk(test_root): 1242s ls.extend( 1242s [ 1242s os.path.join(root, f).removeprefix(test_root).lstrip("/") 1242s for f in files 1242s ] 1242s ) 1242s 1242s assert set(expected) == set( 1242s [ 1242s file.lstrip("c/") 1242s for file in ls 1242s if (file not in (".zattrs", ".zarray", "zarr.json")) 1242s ] 1242s ) 1242s 1242s # The zarr format is set by the `default_zarr_format` 1242s # pytest fixture that acts on a superclass 1242s zarr_format_3 = has_zarr_v3 and zarr.config.config["default_zarr_format"] == 3 1242s if (write_empty is False) or (write_empty is None and has_zarr_v3): 1242s expected = ["0.1.0"] 1242s else: 1242s expected = [ 1242s "0.0.0", 1242s "0.0.1", 1242s "0.1.0", 1242s "0.1.1", 1242s ] 1242s 1242s if zarr_format_3: 1242s data = np.array([0.0, 0, 1.0, 0]).reshape((1, 2, 2)) 1242s # transform to the path style of zarr 3 1242s # e.g. 0/0/1 1242s expected = [e.replace(".", "/") for e in expected] 1242s else: 1242s # use nan for default fill_value behaviour 1242s data = np.array([np.nan, np.nan, 1.0, np.nan]).reshape((1, 2, 2)) 1242s 1242s ds = xr.Dataset(data_vars={"test": (("Z", "Y", "X"), data)}) 1242s 1242s if has_dask: 1242s ds["test"] = ds["test"].chunk(1) 1242s encoding = None 1242s else: 1242s encoding = {"test": {"chunks": (1, 1, 1)}} 1242s 1242s with self.temp_dir() as (d, store): 1242s ds.to_zarr( 1242s store, 1242s mode="w", 1242s encoding=encoding, 1242s write_empty_chunks=write_empty, 1242s ) 1242s 1242s # check expected files after a write 1242s assert_expected_files(expected, store) 1242s 1242s > with self.roundtrip_dir( 1242s ds, 1242s store, 1242s save_kwargs={ 1242s "mode": "a", 1242s "append_dim": "Z", 1242s "write_empty_chunks": write_empty, 1242s }, 1242s ) as a_ds: 1242s 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3761: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1242s return next(self.gen) 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3687: in roundtrip_dir 1242s data.to_zarr(store, **save_kwargs, **self.version_kwargs) 1242s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1242s return to_zarr( # type: ignore[call-overload,misc] 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1242s dump_to_store(dataset, zstore, writer, encoding=encoding) 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1242s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1242s k: self.open_store_variable(name=k) for k in existing_variable_names 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s self = , name = 'test' 1242s 1242s def open_store_variable(self, name): 1242s zarr_array = self.members[name] 1242s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1242s try_nczarr = self._mode == "r" 1242s dimensions, attributes = _get_zarr_dims_and_attrs( 1242s zarr_array, DIMENSION_KEY, try_nczarr 1242s ) 1242s attributes = dict(attributes) 1242s 1242s encoding = { 1242s "chunks": zarr_array.chunks, 1242s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1242s } 1242s 1242s if _zarr_v3(): 1242s encoding.update( 1242s { 1242s "compressors": zarr_array.compressors, 1242s "filters": zarr_array.filters, 1242s "shards": zarr_array.shards, 1242s } 1242s ) 1242s if self.zarr_group.metadata.zarr_format == 3: 1242s encoding.update({"serializer": zarr_array.serializer}) 1242s else: 1242s encoding.update( 1242s { 1242s "compressor": zarr_array.compressor, 1242s "filters": zarr_array.filters, 1242s } 1242s ) 1242s 1242s if self._use_zarr_fill_value_as_mask: 1242s # Setting this attribute triggers CF decoding for missing values 1242s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1242s if zarr_array.fill_value is not None: 1242s attributes["_FillValue"] = zarr_array.fill_value 1242s elif "_FillValue" in attributes: 1242s original_zarr_dtype = zarr_array.metadata.data_type 1242s attributes["_FillValue"] = FillValueCoder.decode( 1242s > attributes["_FillValue"], original_zarr_dtype.value 1242s ) 1242s E AttributeError: 'Float64' object has no attribute 'value' 1242s 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1242s ______________ TestZarrWriteEmpty.test_write_empty[3-False-None] _______________ 1242s 1242s self = 1242s consolidated = None, write_empty = False 1242s 1242s @pytest.mark.parametrize("consolidated", [True, False, None]) 1242s @pytest.mark.parametrize("write_empty", [True, False, None]) 1242s def test_write_empty( 1242s self, 1242s consolidated: bool | None, 1242s write_empty: bool | None, 1242s ) -> None: 1242s def assert_expected_files(expected: list[str], store: str) -> None: 1242s """Convenience for comparing with actual files written""" 1242s ls = [] 1242s test_root = os.path.join(store, "test") 1242s for root, _, files in os.walk(test_root): 1242s ls.extend( 1242s [ 1242s os.path.join(root, f).removeprefix(test_root).lstrip("/") 1242s for f in files 1242s ] 1242s ) 1242s 1242s assert set(expected) == set( 1242s [ 1242s file.lstrip("c/") 1242s for file in ls 1242s if (file not in (".zattrs", ".zarray", "zarr.json")) 1242s ] 1242s ) 1242s 1242s # The zarr format is set by the `default_zarr_format` 1242s # pytest fixture that acts on a superclass 1242s zarr_format_3 = has_zarr_v3 and zarr.config.config["default_zarr_format"] == 3 1242s if (write_empty is False) or (write_empty is None and has_zarr_v3): 1242s expected = ["0.1.0"] 1242s else: 1242s expected = [ 1242s "0.0.0", 1242s "0.0.1", 1242s "0.1.0", 1242s "0.1.1", 1242s ] 1242s 1242s if zarr_format_3: 1242s data = np.array([0.0, 0, 1.0, 0]).reshape((1, 2, 2)) 1242s # transform to the path style of zarr 3 1242s # e.g. 0/0/1 1242s expected = [e.replace(".", "/") for e in expected] 1242s else: 1242s # use nan for default fill_value behaviour 1242s data = np.array([np.nan, np.nan, 1.0, np.nan]).reshape((1, 2, 2)) 1242s 1242s ds = xr.Dataset(data_vars={"test": (("Z", "Y", "X"), data)}) 1242s 1242s if has_dask: 1242s ds["test"] = ds["test"].chunk(1) 1242s encoding = None 1242s else: 1242s encoding = {"test": {"chunks": (1, 1, 1)}} 1242s 1242s with self.temp_dir() as (d, store): 1242s ds.to_zarr( 1242s store, 1242s mode="w", 1242s encoding=encoding, 1242s write_empty_chunks=write_empty, 1242s ) 1242s 1242s # check expected files after a write 1242s assert_expected_files(expected, store) 1242s 1242s > with self.roundtrip_dir( 1242s ds, 1242s store, 1242s save_kwargs={ 1242s "mode": "a", 1242s "append_dim": "Z", 1242s "write_empty_chunks": write_empty, 1242s }, 1242s ) as a_ds: 1242s 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3761: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1242s return next(self.gen) 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3687: in roundtrip_dir 1242s data.to_zarr(store, **save_kwargs, **self.version_kwargs) 1242s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1242s return to_zarr( # type: ignore[call-overload,misc] 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1242s dump_to_store(dataset, zstore, writer, encoding=encoding) 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1242s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1242s k: self.open_store_variable(name=k) for k in existing_variable_names 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s self = , name = 'test' 1242s 1242s def open_store_variable(self, name): 1242s zarr_array = self.members[name] 1242s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1242s try_nczarr = self._mode == "r" 1242s dimensions, attributes = _get_zarr_dims_and_attrs( 1242s zarr_array, DIMENSION_KEY, try_nczarr 1242s ) 1242s attributes = dict(attributes) 1242s 1242s encoding = { 1242s "chunks": zarr_array.chunks, 1242s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1242s } 1242s 1242s if _zarr_v3(): 1242s encoding.update( 1242s { 1242s "compressors": zarr_array.compressors, 1242s "filters": zarr_array.filters, 1242s "shards": zarr_array.shards, 1242s } 1242s ) 1242s if self.zarr_group.metadata.zarr_format == 3: 1242s encoding.update({"serializer": zarr_array.serializer}) 1242s else: 1242s encoding.update( 1242s { 1242s "compressor": zarr_array.compressor, 1242s "filters": zarr_array.filters, 1242s } 1242s ) 1242s 1242s if self._use_zarr_fill_value_as_mask: 1242s # Setting this attribute triggers CF decoding for missing values 1242s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1242s if zarr_array.fill_value is not None: 1242s attributes["_FillValue"] = zarr_array.fill_value 1242s elif "_FillValue" in attributes: 1242s original_zarr_dtype = zarr_array.metadata.data_type 1242s attributes["_FillValue"] = FillValueCoder.decode( 1242s > attributes["_FillValue"], original_zarr_dtype.value 1242s ) 1242s E AttributeError: 'Float64' object has no attribute 'value' 1242s 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1242s _______________ TestZarrWriteEmpty.test_write_empty[3-None-True] _______________ 1242s 1242s self = 1242s consolidated = True, write_empty = None 1242s 1242s @pytest.mark.parametrize("consolidated", [True, False, None]) 1242s @pytest.mark.parametrize("write_empty", [True, False, None]) 1242s def test_write_empty( 1242s self, 1242s consolidated: bool | None, 1242s write_empty: bool | None, 1242s ) -> None: 1242s def assert_expected_files(expected: list[str], store: str) -> None: 1242s """Convenience for comparing with actual files written""" 1242s ls = [] 1242s test_root = os.path.join(store, "test") 1242s for root, _, files in os.walk(test_root): 1242s ls.extend( 1242s [ 1242s os.path.join(root, f).removeprefix(test_root).lstrip("/") 1242s for f in files 1242s ] 1242s ) 1242s 1242s assert set(expected) == set( 1242s [ 1242s file.lstrip("c/") 1242s for file in ls 1242s if (file not in (".zattrs", ".zarray", "zarr.json")) 1242s ] 1242s ) 1242s 1242s # The zarr format is set by the `default_zarr_format` 1242s # pytest fixture that acts on a superclass 1242s zarr_format_3 = has_zarr_v3 and zarr.config.config["default_zarr_format"] == 3 1242s if (write_empty is False) or (write_empty is None and has_zarr_v3): 1242s expected = ["0.1.0"] 1242s else: 1242s expected = [ 1242s "0.0.0", 1242s "0.0.1", 1242s "0.1.0", 1242s "0.1.1", 1242s ] 1242s 1242s if zarr_format_3: 1242s data = np.array([0.0, 0, 1.0, 0]).reshape((1, 2, 2)) 1242s # transform to the path style of zarr 3 1242s # e.g. 0/0/1 1242s expected = [e.replace(".", "/") for e in expected] 1242s else: 1242s # use nan for default fill_value behaviour 1242s data = np.array([np.nan, np.nan, 1.0, np.nan]).reshape((1, 2, 2)) 1242s 1242s ds = xr.Dataset(data_vars={"test": (("Z", "Y", "X"), data)}) 1242s 1242s if has_dask: 1242s ds["test"] = ds["test"].chunk(1) 1242s encoding = None 1242s else: 1242s encoding = {"test": {"chunks": (1, 1, 1)}} 1242s 1242s with self.temp_dir() as (d, store): 1242s ds.to_zarr( 1242s store, 1242s mode="w", 1242s encoding=encoding, 1242s write_empty_chunks=write_empty, 1242s ) 1242s 1242s # check expected files after a write 1242s assert_expected_files(expected, store) 1242s 1242s > with self.roundtrip_dir( 1242s ds, 1242s store, 1242s save_kwargs={ 1242s "mode": "a", 1242s "append_dim": "Z", 1242s "write_empty_chunks": write_empty, 1242s }, 1242s ) as a_ds: 1242s 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3761: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1242s return next(self.gen) 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3687: in roundtrip_dir 1242s data.to_zarr(store, **save_kwargs, **self.version_kwargs) 1242s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1242s return to_zarr( # type: ignore[call-overload,misc] 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1242s dump_to_store(dataset, zstore, writer, encoding=encoding) 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1242s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1242s k: self.open_store_variable(name=k) for k in existing_variable_names 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s self = , name = 'test' 1242s 1242s def open_store_variable(self, name): 1242s zarr_array = self.members[name] 1242s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1242s try_nczarr = self._mode == "r" 1242s dimensions, attributes = _get_zarr_dims_and_attrs( 1242s zarr_array, DIMENSION_KEY, try_nczarr 1242s ) 1242s attributes = dict(attributes) 1242s 1242s encoding = { 1242s "chunks": zarr_array.chunks, 1242s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1242s } 1242s 1242s if _zarr_v3(): 1242s encoding.update( 1242s { 1242s "compressors": zarr_array.compressors, 1242s "filters": zarr_array.filters, 1242s "shards": zarr_array.shards, 1242s } 1242s ) 1242s if self.zarr_group.metadata.zarr_format == 3: 1242s encoding.update({"serializer": zarr_array.serializer}) 1242s else: 1242s encoding.update( 1242s { 1242s "compressor": zarr_array.compressor, 1242s "filters": zarr_array.filters, 1242s } 1242s ) 1242s 1242s if self._use_zarr_fill_value_as_mask: 1242s # Setting this attribute triggers CF decoding for missing values 1242s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1242s if zarr_array.fill_value is not None: 1242s attributes["_FillValue"] = zarr_array.fill_value 1242s elif "_FillValue" in attributes: 1242s original_zarr_dtype = zarr_array.metadata.data_type 1242s attributes["_FillValue"] = FillValueCoder.decode( 1242s > attributes["_FillValue"], original_zarr_dtype.value 1242s ) 1242s E AttributeError: 'Float64' object has no attribute 'value' 1242s 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1242s ______________ TestZarrWriteEmpty.test_write_empty[3-None-False] _______________ 1242s 1242s self = 1242s consolidated = False, write_empty = None 1242s 1242s @pytest.mark.parametrize("consolidated", [True, False, None]) 1242s @pytest.mark.parametrize("write_empty", [True, False, None]) 1242s def test_write_empty( 1242s self, 1242s consolidated: bool | None, 1242s write_empty: bool | None, 1242s ) -> None: 1242s def assert_expected_files(expected: list[str], store: str) -> None: 1242s """Convenience for comparing with actual files written""" 1242s ls = [] 1242s test_root = os.path.join(store, "test") 1242s for root, _, files in os.walk(test_root): 1242s ls.extend( 1242s [ 1242s os.path.join(root, f).removeprefix(test_root).lstrip("/") 1242s for f in files 1242s ] 1242s ) 1242s 1242s assert set(expected) == set( 1242s [ 1242s file.lstrip("c/") 1242s for file in ls 1242s if (file not in (".zattrs", ".zarray", "zarr.json")) 1242s ] 1242s ) 1242s 1242s # The zarr format is set by the `default_zarr_format` 1242s # pytest fixture that acts on a superclass 1242s zarr_format_3 = has_zarr_v3 and zarr.config.config["default_zarr_format"] == 3 1242s if (write_empty is False) or (write_empty is None and has_zarr_v3): 1242s expected = ["0.1.0"] 1242s else: 1242s expected = [ 1242s "0.0.0", 1242s "0.0.1", 1242s "0.1.0", 1242s "0.1.1", 1242s ] 1242s 1242s if zarr_format_3: 1242s data = np.array([0.0, 0, 1.0, 0]).reshape((1, 2, 2)) 1242s # transform to the path style of zarr 3 1242s # e.g. 0/0/1 1242s expected = [e.replace(".", "/") for e in expected] 1242s else: 1242s # use nan for default fill_value behaviour 1242s data = np.array([np.nan, np.nan, 1.0, np.nan]).reshape((1, 2, 2)) 1242s 1242s ds = xr.Dataset(data_vars={"test": (("Z", "Y", "X"), data)}) 1242s 1242s if has_dask: 1242s ds["test"] = ds["test"].chunk(1) 1242s encoding = None 1242s else: 1242s encoding = {"test": {"chunks": (1, 1, 1)}} 1242s 1242s with self.temp_dir() as (d, store): 1242s ds.to_zarr( 1242s store, 1242s mode="w", 1242s encoding=encoding, 1242s write_empty_chunks=write_empty, 1242s ) 1242s 1242s # check expected files after a write 1242s assert_expected_files(expected, store) 1242s 1242s > with self.roundtrip_dir( 1242s ds, 1242s store, 1242s save_kwargs={ 1242s "mode": "a", 1242s "append_dim": "Z", 1242s "write_empty_chunks": write_empty, 1242s }, 1242s ) as a_ds: 1242s 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3761: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1242s return next(self.gen) 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3687: in roundtrip_dir 1242s data.to_zarr(store, **save_kwargs, **self.version_kwargs) 1242s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1242s return to_zarr( # type: ignore[call-overload,misc] 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1242s dump_to_store(dataset, zstore, writer, encoding=encoding) 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1242s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1242s k: self.open_store_variable(name=k) for k in existing_variable_names 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s self = , name = 'test' 1242s 1242s def open_store_variable(self, name): 1242s zarr_array = self.members[name] 1242s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1242s try_nczarr = self._mode == "r" 1242s dimensions, attributes = _get_zarr_dims_and_attrs( 1242s zarr_array, DIMENSION_KEY, try_nczarr 1242s ) 1242s attributes = dict(attributes) 1242s 1242s encoding = { 1242s "chunks": zarr_array.chunks, 1242s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1242s } 1242s 1242s if _zarr_v3(): 1242s encoding.update( 1242s { 1242s "compressors": zarr_array.compressors, 1242s "filters": zarr_array.filters, 1242s "shards": zarr_array.shards, 1242s } 1242s ) 1242s if self.zarr_group.metadata.zarr_format == 3: 1242s encoding.update({"serializer": zarr_array.serializer}) 1242s else: 1242s encoding.update( 1242s { 1242s "compressor": zarr_array.compressor, 1242s "filters": zarr_array.filters, 1242s } 1242s ) 1242s 1242s if self._use_zarr_fill_value_as_mask: 1242s # Setting this attribute triggers CF decoding for missing values 1242s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1242s if zarr_array.fill_value is not None: 1242s attributes["_FillValue"] = zarr_array.fill_value 1242s elif "_FillValue" in attributes: 1242s original_zarr_dtype = zarr_array.metadata.data_type 1242s attributes["_FillValue"] = FillValueCoder.decode( 1242s > attributes["_FillValue"], original_zarr_dtype.value 1242s ) 1242s E AttributeError: 'Float64' object has no attribute 'value' 1242s 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1242s _______________ TestZarrWriteEmpty.test_write_empty[3-None-None] _______________ 1242s 1242s self = 1242s consolidated = None, write_empty = None 1242s 1242s @pytest.mark.parametrize("consolidated", [True, False, None]) 1242s @pytest.mark.parametrize("write_empty", [True, False, None]) 1242s def test_write_empty( 1242s self, 1242s consolidated: bool | None, 1242s write_empty: bool | None, 1242s ) -> None: 1242s def assert_expected_files(expected: list[str], store: str) -> None: 1242s """Convenience for comparing with actual files written""" 1242s ls = [] 1242s test_root = os.path.join(store, "test") 1242s for root, _, files in os.walk(test_root): 1242s ls.extend( 1242s [ 1242s os.path.join(root, f).removeprefix(test_root).lstrip("/") 1242s for f in files 1242s ] 1242s ) 1242s 1242s assert set(expected) == set( 1242s [ 1242s file.lstrip("c/") 1242s for file in ls 1242s if (file not in (".zattrs", ".zarray", "zarr.json")) 1242s ] 1242s ) 1242s 1242s # The zarr format is set by the `default_zarr_format` 1242s # pytest fixture that acts on a superclass 1242s zarr_format_3 = has_zarr_v3 and zarr.config.config["default_zarr_format"] == 3 1242s if (write_empty is False) or (write_empty is None and has_zarr_v3): 1242s expected = ["0.1.0"] 1242s else: 1242s expected = [ 1242s "0.0.0", 1242s "0.0.1", 1242s "0.1.0", 1242s "0.1.1", 1242s ] 1242s 1242s if zarr_format_3: 1242s data = np.array([0.0, 0, 1.0, 0]).reshape((1, 2, 2)) 1242s # transform to the path style of zarr 3 1242s # e.g. 0/0/1 1242s expected = [e.replace(".", "/") for e in expected] 1242s else: 1242s # use nan for default fill_value behaviour 1242s data = np.array([np.nan, np.nan, 1.0, np.nan]).reshape((1, 2, 2)) 1242s 1242s ds = xr.Dataset(data_vars={"test": (("Z", "Y", "X"), data)}) 1242s 1242s if has_dask: 1242s ds["test"] = ds["test"].chunk(1) 1242s encoding = None 1242s else: 1242s encoding = {"test": {"chunks": (1, 1, 1)}} 1242s 1242s with self.temp_dir() as (d, store): 1242s ds.to_zarr( 1242s store, 1242s mode="w", 1242s encoding=encoding, 1242s write_empty_chunks=write_empty, 1242s ) 1242s 1242s # check expected files after a write 1242s assert_expected_files(expected, store) 1242s 1242s > with self.roundtrip_dir( 1242s ds, 1242s store, 1242s save_kwargs={ 1242s "mode": "a", 1242s "append_dim": "Z", 1242s "write_empty_chunks": write_empty, 1242s }, 1242s ) as a_ds: 1242s 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3761: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s /usr/lib/python3.13/contextlib.py:141: in __enter__ 1242s return next(self.gen) 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:3687: in roundtrip_dir 1242s data.to_zarr(store, **save_kwargs, **self.version_kwargs) 1242s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1242s return to_zarr( # type: ignore[call-overload,misc] 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1242s dump_to_store(dataset, zstore, writer, encoding=encoding) 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1242s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1242s k: self.open_store_variable(name=k) for k in existing_variable_names 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s self = , name = 'test' 1242s 1242s def open_store_variable(self, name): 1242s zarr_array = self.members[name] 1242s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1242s try_nczarr = self._mode == "r" 1242s dimensions, attributes = _get_zarr_dims_and_attrs( 1242s zarr_array, DIMENSION_KEY, try_nczarr 1242s ) 1242s attributes = dict(attributes) 1242s 1242s encoding = { 1242s "chunks": zarr_array.chunks, 1242s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1242s } 1242s 1242s if _zarr_v3(): 1242s encoding.update( 1242s { 1242s "compressors": zarr_array.compressors, 1242s "filters": zarr_array.filters, 1242s "shards": zarr_array.shards, 1242s } 1242s ) 1242s if self.zarr_group.metadata.zarr_format == 3: 1242s encoding.update({"serializer": zarr_array.serializer}) 1242s else: 1242s encoding.update( 1242s { 1242s "compressor": zarr_array.compressor, 1242s "filters": zarr_array.filters, 1242s } 1242s ) 1242s 1242s if self._use_zarr_fill_value_as_mask: 1242s # Setting this attribute triggers CF decoding for missing values 1242s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1242s if zarr_array.fill_value is not None: 1242s attributes["_FillValue"] = zarr_array.fill_value 1242s elif "_FillValue" in attributes: 1242s original_zarr_dtype = zarr_array.metadata.data_type 1242s attributes["_FillValue"] = FillValueCoder.decode( 1242s > attributes["_FillValue"], original_zarr_dtype.value 1242s ) 1242s E AttributeError: 'Float64' object has no attribute 'value' 1242s 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1242s ____________ TestZarrRegionAuto.test_zarr_region_auto[3-full-auto] _____________ 1242s 1242s self = 1242s region = 'auto' 1242s 1242s @pytest.mark.parametrize( 1242s "region", 1242s [ 1242s pytest.param("auto", id="full-auto"), 1242s pytest.param({"x": "auto", "y": slice(6, 8)}, id="mixed-auto"), 1242s ], 1242s ) 1242s def test_zarr_region_auto(self, region): 1242s with self.create() as (target, ds): 1242s ds_region = 1 + ds.isel(x=slice(2, 4), y=slice(6, 8)) 1242s > self.save(target, ds_region, region=region) 1242s 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6306: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6294: in save 1242s ds.to_zarr(target, **kwargs) 1242s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1242s return to_zarr( # type: ignore[call-overload,misc] 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1242s dump_to_store(dataset, zstore, writer, encoding=encoding) 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1242s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1242s k: self.open_store_variable(name=k) for k in existing_variable_names 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s self = , name = 'test' 1242s 1242s def open_store_variable(self, name): 1242s zarr_array = self.members[name] 1242s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1242s try_nczarr = self._mode == "r" 1242s dimensions, attributes = _get_zarr_dims_and_attrs( 1242s zarr_array, DIMENSION_KEY, try_nczarr 1242s ) 1242s attributes = dict(attributes) 1242s 1242s encoding = { 1242s "chunks": zarr_array.chunks, 1242s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1242s } 1242s 1242s if _zarr_v3(): 1242s encoding.update( 1242s { 1242s "compressors": zarr_array.compressors, 1242s "filters": zarr_array.filters, 1242s "shards": zarr_array.shards, 1242s } 1242s ) 1242s if self.zarr_group.metadata.zarr_format == 3: 1242s encoding.update({"serializer": zarr_array.serializer}) 1242s else: 1242s encoding.update( 1242s { 1242s "compressor": zarr_array.compressor, 1242s "filters": zarr_array.filters, 1242s } 1242s ) 1242s 1242s if self._use_zarr_fill_value_as_mask: 1242s # Setting this attribute triggers CF decoding for missing values 1242s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1242s if zarr_array.fill_value is not None: 1242s attributes["_FillValue"] = zarr_array.fill_value 1242s elif "_FillValue" in attributes: 1242s original_zarr_dtype = zarr_array.metadata.data_type 1242s attributes["_FillValue"] = FillValueCoder.decode( 1242s > attributes["_FillValue"], original_zarr_dtype.value 1242s ) 1242s E AttributeError: 'Float64' object has no attribute 'value' 1242s 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1242s ____________ TestZarrRegionAuto.test_zarr_region_auto[3-mixed-auto] ____________ 1242s 1242s self = 1242s region = {'x': slice(np.int64(2), np.int64(4), None), 'y': slice(6, 8, None)} 1242s 1242s @pytest.mark.parametrize( 1242s "region", 1242s [ 1242s pytest.param("auto", id="full-auto"), 1242s pytest.param({"x": "auto", "y": slice(6, 8)}, id="mixed-auto"), 1242s ], 1242s ) 1242s def test_zarr_region_auto(self, region): 1242s with self.create() as (target, ds): 1242s ds_region = 1 + ds.isel(x=slice(2, 4), y=slice(6, 8)) 1242s > self.save(target, ds_region, region=region) 1242s 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6306: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6294: in save 1242s ds.to_zarr(target, **kwargs) 1242s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1242s return to_zarr( # type: ignore[call-overload,misc] 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1242s dump_to_store(dataset, zstore, writer, encoding=encoding) 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1242s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1242s k: self.open_store_variable(name=k) for k in existing_variable_names 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s self = , name = 'test' 1242s 1242s def open_store_variable(self, name): 1242s zarr_array = self.members[name] 1242s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1242s try_nczarr = self._mode == "r" 1242s dimensions, attributes = _get_zarr_dims_and_attrs( 1242s zarr_array, DIMENSION_KEY, try_nczarr 1242s ) 1242s attributes = dict(attributes) 1242s 1242s encoding = { 1242s "chunks": zarr_array.chunks, 1242s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1242s } 1242s 1242s if _zarr_v3(): 1242s encoding.update( 1242s { 1242s "compressors": zarr_array.compressors, 1242s "filters": zarr_array.filters, 1242s "shards": zarr_array.shards, 1242s } 1242s ) 1242s if self.zarr_group.metadata.zarr_format == 3: 1242s encoding.update({"serializer": zarr_array.serializer}) 1242s else: 1242s encoding.update( 1242s { 1242s "compressor": zarr_array.compressor, 1242s "filters": zarr_array.filters, 1242s } 1242s ) 1242s 1242s if self._use_zarr_fill_value_as_mask: 1242s # Setting this attribute triggers CF decoding for missing values 1242s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1242s if zarr_array.fill_value is not None: 1242s attributes["_FillValue"] = zarr_array.fill_value 1242s elif "_FillValue" in attributes: 1242s original_zarr_dtype = zarr_array.metadata.data_type 1242s attributes["_FillValue"] = FillValueCoder.decode( 1242s > attributes["_FillValue"], original_zarr_dtype.value 1242s ) 1242s E AttributeError: 'Float64' object has no attribute 'value' 1242s 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1242s ______________ TestZarrRegionAuto.test_zarr_region_index_write[3] ______________ 1242s 1242s self = 1242s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-1/test_zarr_region_index_write_30') 1242s 1242s def test_zarr_region_index_write(self, tmp_path): 1242s region: Mapping[str, slice] | Literal["auto"] 1242s region_slice = dict(x=slice(2, 4), y=slice(6, 8)) 1242s 1242s with self.create() as (target, ds): 1242s ds_region = 1 + ds.isel(region_slice) 1242s for region in [region_slice, "auto"]: # type: ignore[assignment] 1242s with patch.object( 1242s ZarrStore, 1242s "set_variables", 1242s side_effect=ZarrStore.set_variables, 1242s autospec=True, 1242s ) as mock: 1242s > self.save(target, ds_region, region=region, mode="r+") 1242s 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6336: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6294: in save 1242s ds.to_zarr(target, **kwargs) 1242s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1242s return to_zarr( # type: ignore[call-overload,misc] 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1242s dump_to_store(dataset, zstore, writer, encoding=encoding) 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1242s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1242s k: self.open_store_variable(name=k) for k in existing_variable_names 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s self = , name = 'test' 1242s 1242s def open_store_variable(self, name): 1242s zarr_array = self.members[name] 1242s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1242s try_nczarr = self._mode == "r" 1242s dimensions, attributes = _get_zarr_dims_and_attrs( 1242s zarr_array, DIMENSION_KEY, try_nczarr 1242s ) 1242s attributes = dict(attributes) 1242s 1242s encoding = { 1242s "chunks": zarr_array.chunks, 1242s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1242s } 1242s 1242s if _zarr_v3(): 1242s encoding.update( 1242s { 1242s "compressors": zarr_array.compressors, 1242s "filters": zarr_array.filters, 1242s "shards": zarr_array.shards, 1242s } 1242s ) 1242s if self.zarr_group.metadata.zarr_format == 3: 1242s encoding.update({"serializer": zarr_array.serializer}) 1242s else: 1242s encoding.update( 1242s { 1242s "compressor": zarr_array.compressor, 1242s "filters": zarr_array.filters, 1242s } 1242s ) 1242s 1242s if self._use_zarr_fill_value_as_mask: 1242s # Setting this attribute triggers CF decoding for missing values 1242s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1242s if zarr_array.fill_value is not None: 1242s attributes["_FillValue"] = zarr_array.fill_value 1242s elif "_FillValue" in attributes: 1242s original_zarr_dtype = zarr_array.metadata.data_type 1242s attributes["_FillValue"] = FillValueCoder.decode( 1242s > attributes["_FillValue"], original_zarr_dtype.value 1242s ) 1242s E AttributeError: 'Float64' object has no attribute 'value' 1242s 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1242s ____________________ TestZarrRegionAuto.test_zarr_region[3] ____________________ 1242s 1242s self = 1242s 1242s def test_zarr_region(self): 1242s with self.create() as (target, ds): 1242s ds_transposed = ds.transpose("y", "x") 1242s ds_region = 1 + ds_transposed.isel(x=[0], y=[0]) 1242s > self.save(target, ds_region, region={"x": slice(0, 1), "y": slice(0, 1)}) 1242s 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6369: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6294: in save 1242s ds.to_zarr(target, **kwargs) 1242s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1242s return to_zarr( # type: ignore[call-overload,misc] 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1242s dump_to_store(dataset, zstore, writer, encoding=encoding) 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1242s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1242s k: self.open_store_variable(name=k) for k in existing_variable_names 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s self = , name = 'test' 1242s 1242s def open_store_variable(self, name): 1242s zarr_array = self.members[name] 1242s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1242s try_nczarr = self._mode == "r" 1242s dimensions, attributes = _get_zarr_dims_and_attrs( 1242s zarr_array, DIMENSION_KEY, try_nczarr 1242s ) 1242s attributes = dict(attributes) 1242s 1242s encoding = { 1242s "chunks": zarr_array.chunks, 1242s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1242s } 1242s 1242s if _zarr_v3(): 1242s encoding.update( 1242s { 1242s "compressors": zarr_array.compressors, 1242s "filters": zarr_array.filters, 1242s "shards": zarr_array.shards, 1242s } 1242s ) 1242s if self.zarr_group.metadata.zarr_format == 3: 1242s encoding.update({"serializer": zarr_array.serializer}) 1242s else: 1242s encoding.update( 1242s { 1242s "compressor": zarr_array.compressor, 1242s "filters": zarr_array.filters, 1242s } 1242s ) 1242s 1242s if self._use_zarr_fill_value_as_mask: 1242s # Setting this attribute triggers CF decoding for missing values 1242s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1242s if zarr_array.fill_value is not None: 1242s attributes["_FillValue"] = zarr_array.fill_value 1242s elif "_FillValue" in attributes: 1242s original_zarr_dtype = zarr_array.metadata.data_type 1242s attributes["_FillValue"] = FillValueCoder.decode( 1242s > attributes["_FillValue"], original_zarr_dtype.value 1242s ) 1242s E AttributeError: 'Float64' object has no attribute 'value' 1242s 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1242s _____________ TestZarrRegionAuto.test_zarr_append_chunk_partial[3] _____________ 1242s 1242s self = 1242s 1242s @requires_dask 1242s def test_zarr_append_chunk_partial(self): 1242s t_coords = np.array([np.datetime64("2020-01-01").astype("datetime64[ns]")]) 1242s data = np.ones((10, 10)) 1242s 1242s da = xr.DataArray( 1242s data.reshape((-1, 10, 10)), 1242s dims=["time", "x", "y"], 1242s coords={"time": t_coords}, 1242s name="foo", 1242s ) 1242s new_time = np.array([np.datetime64("2021-01-01").astype("datetime64[ns]")]) 1242s da2 = xr.DataArray( 1242s data.reshape((-1, 10, 10)), 1242s dims=["time", "x", "y"], 1242s coords={"time": new_time}, 1242s name="foo", 1242s ) 1242s 1242s with self.create_zarr_target() as target: 1242s self.save(target, da, mode="w", encoding={"foo": {"chunks": (5, 5, 1)}}) 1242s 1242s with pytest.raises(ValueError, match="encoding was provided"): 1242s self.save( 1242s target, 1242s da2, 1242s append_dim="time", 1242s mode="a", 1242s encoding={"foo": {"chunks": (1, 1, 1)}}, 1242s ) 1242s 1242s # chunking with dask sidesteps the encoding check, so we need a different check 1242s with pytest.raises(ValueError, match="Specified zarr chunks"): 1242s > self.save( 1242s target, 1242s da2.chunk({"x": 1, "y": 1, "time": 1}), 1242s append_dim="time", 1242s mode="a", 1242s ) 1242s 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6426: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6294: in save 1242s ds.to_zarr(target, **kwargs) 1242s /usr/lib/python3/dist-packages/xarray/core/dataarray.py:4466: in to_zarr 1242s return to_zarr( # type: ignore[call-overload,misc] 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1242s dump_to_store(dataset, zstore, writer, encoding=encoding) 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1242s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1242s k: self.open_store_variable(name=k) for k in existing_variable_names 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s self = , name = 'foo' 1242s 1242s def open_store_variable(self, name): 1242s zarr_array = self.members[name] 1242s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1242s try_nczarr = self._mode == "r" 1242s dimensions, attributes = _get_zarr_dims_and_attrs( 1242s zarr_array, DIMENSION_KEY, try_nczarr 1242s ) 1242s attributes = dict(attributes) 1242s 1242s encoding = { 1242s "chunks": zarr_array.chunks, 1242s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1242s } 1242s 1242s if _zarr_v3(): 1242s encoding.update( 1242s { 1242s "compressors": zarr_array.compressors, 1242s "filters": zarr_array.filters, 1242s "shards": zarr_array.shards, 1242s } 1242s ) 1242s if self.zarr_group.metadata.zarr_format == 3: 1242s encoding.update({"serializer": zarr_array.serializer}) 1242s else: 1242s encoding.update( 1242s { 1242s "compressor": zarr_array.compressor, 1242s "filters": zarr_array.filters, 1242s } 1242s ) 1242s 1242s if self._use_zarr_fill_value_as_mask: 1242s # Setting this attribute triggers CF decoding for missing values 1242s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1242s if zarr_array.fill_value is not None: 1242s attributes["_FillValue"] = zarr_array.fill_value 1242s elif "_FillValue" in attributes: 1242s original_zarr_dtype = zarr_array.metadata.data_type 1242s attributes["_FillValue"] = FillValueCoder.decode( 1242s > attributes["_FillValue"], original_zarr_dtype.value 1242s ) 1242s E AttributeError: 'Float64' object has no attribute 'value' 1242s 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1242s _________ TestZarrRegionAuto.test_zarr_region_chunk_partial_offset[3] __________ 1242s 1242s self = 1242s 1242s @requires_dask 1242s def test_zarr_region_chunk_partial_offset(self): 1242s # https://github.com/pydata/xarray/pull/8459#issuecomment-1819417545 1242s with self.create_zarr_target() as store: 1242s data = np.ones((30,)) 1242s da = xr.DataArray( 1242s data, dims=["x"], coords={"x": range(30)}, name="foo" 1242s ).chunk(x=10) 1242s self.save(store, da, compute=False) 1242s 1242s > self.save(store, da.isel(x=slice(10)).chunk(x=(10,)), region="auto") 1242s 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6443: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6294: in save 1242s ds.to_zarr(target, **kwargs) 1242s /usr/lib/python3/dist-packages/xarray/core/dataarray.py:4466: in to_zarr 1242s return to_zarr( # type: ignore[call-overload,misc] 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1242s dump_to_store(dataset, zstore, writer, encoding=encoding) 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1242s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1242s k: self.open_store_variable(name=k) for k in existing_variable_names 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s self = , name = 'foo' 1242s 1242s def open_store_variable(self, name): 1242s zarr_array = self.members[name] 1242s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1242s try_nczarr = self._mode == "r" 1242s dimensions, attributes = _get_zarr_dims_and_attrs( 1242s zarr_array, DIMENSION_KEY, try_nczarr 1242s ) 1242s attributes = dict(attributes) 1242s 1242s encoding = { 1242s "chunks": zarr_array.chunks, 1242s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1242s } 1242s 1242s if _zarr_v3(): 1242s encoding.update( 1242s { 1242s "compressors": zarr_array.compressors, 1242s "filters": zarr_array.filters, 1242s "shards": zarr_array.shards, 1242s } 1242s ) 1242s if self.zarr_group.metadata.zarr_format == 3: 1242s encoding.update({"serializer": zarr_array.serializer}) 1242s else: 1242s encoding.update( 1242s { 1242s "compressor": zarr_array.compressor, 1242s "filters": zarr_array.filters, 1242s } 1242s ) 1242s 1242s if self._use_zarr_fill_value_as_mask: 1242s # Setting this attribute triggers CF decoding for missing values 1242s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1242s if zarr_array.fill_value is not None: 1242s attributes["_FillValue"] = zarr_array.fill_value 1242s elif "_FillValue" in attributes: 1242s original_zarr_dtype = zarr_array.metadata.data_type 1242s attributes["_FillValue"] = FillValueCoder.decode( 1242s > attributes["_FillValue"], original_zarr_dtype.value 1242s ) 1242s E AttributeError: 'Float64' object has no attribute 'value' 1242s 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1242s ____________ TestZarrRegionAuto.test_zarr_safe_chunk_append_dim[3] _____________ 1242s 1242s self = 1242s 1242s @requires_dask 1242s def test_zarr_safe_chunk_append_dim(self): 1242s with self.create_zarr_target() as store: 1242s data = np.ones((20,)) 1242s da = xr.DataArray( 1242s data, dims=["x"], coords={"x": range(20)}, name="foo" 1242s ).chunk(x=5) 1242s 1242s self.save(store, da.isel(x=slice(0, 7)), safe_chunks=True, mode="w") 1242s with pytest.raises(ValueError): 1242s # If the first chunk is smaller than the border size then raise an error 1242s > self.save( 1242s store, 1242s da.isel(x=slice(7, 11)).chunk(x=(2, 2)), 1242s append_dim="x", 1242s safe_chunks=True, 1242s ) 1242s 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6468: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6294: in save 1242s ds.to_zarr(target, **kwargs) 1242s /usr/lib/python3/dist-packages/xarray/core/dataarray.py:4466: in to_zarr 1242s return to_zarr( # type: ignore[call-overload,misc] 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1242s dump_to_store(dataset, zstore, writer, encoding=encoding) 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1242s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1242s k: self.open_store_variable(name=k) for k in existing_variable_names 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s self = , name = 'foo' 1242s 1242s def open_store_variable(self, name): 1242s zarr_array = self.members[name] 1242s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1242s try_nczarr = self._mode == "r" 1242s dimensions, attributes = _get_zarr_dims_and_attrs( 1242s zarr_array, DIMENSION_KEY, try_nczarr 1242s ) 1242s attributes = dict(attributes) 1242s 1242s encoding = { 1242s "chunks": zarr_array.chunks, 1242s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1242s } 1242s 1242s if _zarr_v3(): 1242s encoding.update( 1242s { 1242s "compressors": zarr_array.compressors, 1242s "filters": zarr_array.filters, 1242s "shards": zarr_array.shards, 1242s } 1242s ) 1242s if self.zarr_group.metadata.zarr_format == 3: 1242s encoding.update({"serializer": zarr_array.serializer}) 1242s else: 1242s encoding.update( 1242s { 1242s "compressor": zarr_array.compressor, 1242s "filters": zarr_array.filters, 1242s } 1242s ) 1242s 1242s if self._use_zarr_fill_value_as_mask: 1242s # Setting this attribute triggers CF decoding for missing values 1242s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1242s if zarr_array.fill_value is not None: 1242s attributes["_FillValue"] = zarr_array.fill_value 1242s elif "_FillValue" in attributes: 1242s original_zarr_dtype = zarr_array.metadata.data_type 1242s attributes["_FillValue"] = FillValueCoder.decode( 1242s > attributes["_FillValue"], original_zarr_dtype.value 1242s ) 1242s E AttributeError: 'Float64' object has no attribute 'value' 1242s 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1242s _____________ TestZarrRegionAuto.test_zarr_safe_chunk_region[3-r+] _____________ 1242s 1242s self = 1242s mode = 'r+' 1242s 1242s @requires_dask 1242s @pytest.mark.parametrize("mode", ["r+", "a"]) 1242s def test_zarr_safe_chunk_region(self, mode: Literal["r+", "a"]): 1242s with self.create_zarr_target() as store: 1242s arr = xr.DataArray( 1242s list(range(11)), dims=["a"], coords={"a": list(range(11))}, name="foo" 1242s ).chunk(a=3) 1242s self.save(store, arr, mode="w") 1242s 1242s with pytest.raises(ValueError): 1242s # There are two Dask chunks on the same Zarr chunk, 1242s # which means that it is unsafe in any mode 1242s self.save( 1242s store, 1242s arr.isel(a=slice(0, 3)).chunk(a=(2, 1)), 1242s region="auto", 1242s mode=mode, 1242s ) 1242s 1242s with pytest.raises(ValueError): 1242s # the first chunk is covering the border size, but it is not 1242s # completely covering the second chunk, which means that it is 1242s # unsafe in any mode 1242s self.save( 1242s store, 1242s arr.isel(a=slice(1, 5)).chunk(a=(3, 1)), 1242s region="auto", 1242s mode=mode, 1242s ) 1242s 1242s with pytest.raises(ValueError): 1242s # The first chunk is safe but the other two chunks are overlapping with 1242s # the same Zarr chunk 1242s self.save( 1242s store, 1242s arr.isel(a=slice(0, 5)).chunk(a=(3, 1, 1)), 1242s region="auto", 1242s mode=mode, 1242s ) 1242s 1242s # Fully update two contiguous chunks is safe in any mode 1242s self.save(store, arr.isel(a=slice(3, 9)), region="auto", mode=mode) 1242s 1242s # The last chunk is considered full based on their current size (2) 1242s self.save(store, arr.isel(a=slice(9, 11)), region="auto", mode=mode) 1242s self.save( 1242s store, arr.isel(a=slice(6, None)).chunk(a=-1), region="auto", mode=mode 1242s ) 1242s 1242s # Write the last chunk of a region partially is safe in "a" mode 1242s self.save(store, arr.isel(a=slice(3, 8)), region="auto", mode="a") 1242s with pytest.raises(ValueError): 1242s # with "r+" mode it is invalid to write partial chunk 1242s self.save(store, arr.isel(a=slice(3, 8)), region="auto", mode="r+") 1242s 1242s # This is safe with mode "a", the border size is covered by the first chunk of Dask 1242s self.save( 1242s store, arr.isel(a=slice(1, 4)).chunk(a=(2, 1)), region="auto", mode="a" 1242s ) 1242s with pytest.raises(ValueError): 1242s # This is considered unsafe in mode "r+" because it is writing in a partial chunk 1242s self.save( 1242s store, 1242s arr.isel(a=slice(1, 4)).chunk(a=(2, 1)), 1242s region="auto", 1242s mode="r+", 1242s ) 1242s 1242s # This is safe on mode "a" because there is a single dask chunk 1242s self.save( 1242s store, arr.isel(a=slice(1, 5)).chunk(a=(4,)), region="auto", mode="a" 1242s ) 1242s with pytest.raises(ValueError): 1242s # This is unsafe on mode "r+", because the Dask chunk is partially writing 1242s # in the first chunk of Zarr 1242s self.save( 1242s store, 1242s arr.isel(a=slice(1, 5)).chunk(a=(4,)), 1242s region="auto", 1242s mode="r+", 1242s ) 1242s 1242s # The first chunk is completely covering the first Zarr chunk 1242s # and the last chunk is a partial one 1242s self.save( 1242s store, arr.isel(a=slice(0, 5)).chunk(a=(3, 2)), region="auto", mode="a" 1242s ) 1242s 1242s with pytest.raises(ValueError): 1242s # The last chunk is partial, so it is considered unsafe on mode "r+" 1242s self.save( 1242s store, 1242s arr.isel(a=slice(0, 5)).chunk(a=(3, 2)), 1242s region="auto", 1242s mode="r+", 1242s ) 1242s 1242s # The first chunk is covering the border size (2 elements) 1242s # and also the second chunk (3 elements), so it is valid 1242s self.save( 1242s store, arr.isel(a=slice(1, 8)).chunk(a=(5, 2)), region="auto", mode="a" 1242s ) 1242s 1242s with pytest.raises(ValueError): 1242s # The first chunk is not fully covering the first zarr chunk 1242s self.save( 1242s store, 1242s arr.isel(a=slice(1, 8)).chunk(a=(5, 2)), 1242s region="auto", 1242s mode="r+", 1242s ) 1242s 1242s with pytest.raises(ValueError): 1242s # Validate that the border condition is not affecting the "r+" mode 1242s self.save(store, arr.isel(a=slice(1, 9)), region="auto", mode="r+") 1242s 1242s self.save(store, arr.isel(a=slice(10, 11)), region="auto", mode="a") 1242s with pytest.raises(ValueError): 1242s # Validate that even if we write with a single Dask chunk on the last Zarr 1242s # chunk it is still unsafe if it is not fully covering it 1242s # (the last Zarr chunk has size 2) 1242s self.save(store, arr.isel(a=slice(10, 11)), region="auto", mode="r+") 1242s 1242s # Validate the same as the above test but in the beginning of the last chunk 1242s self.save(store, arr.isel(a=slice(9, 10)), region="auto", mode="a") 1242s with pytest.raises(ValueError): 1242s self.save(store, arr.isel(a=slice(9, 10)), region="auto", mode="r+") 1242s 1242s self.save( 1242s store, arr.isel(a=slice(7, None)).chunk(a=-1), region="auto", mode="a" 1242s ) 1242s with pytest.raises(ValueError): 1242s # Test that even a Dask chunk that covers the last Zarr chunk can be unsafe 1242s # if it is partial covering other Zarr chunks 1242s self.save( 1242s store, 1242s arr.isel(a=slice(7, None)).chunk(a=-1), 1242s region="auto", 1242s mode="r+", 1242s ) 1242s 1242s with pytest.raises(ValueError): 1242s # If the chunk is of size equal to the one in the Zarr encoding, but 1242s # it is partially writing in the first chunk then raise an error 1242s self.save( 1242s store, 1242s arr.isel(a=slice(8, None)).chunk(a=3), 1242s region="auto", 1242s mode="r+", 1242s ) 1242s 1242s with pytest.raises(ValueError): 1242s self.save( 1242s store, arr.isel(a=slice(5, -1)).chunk(a=5), region="auto", mode="r+" 1242s ) 1242s 1242s # Test if the code is detecting the last chunk correctly 1242s data = np.random.default_rng(0).random((2920, 25, 53)) 1242s ds = xr.Dataset({"temperature": (("time", "lat", "lon"), data)}) 1242s chunks = {"time": 1000, "lat": 25, "lon": 53} 1242s self.save(store, ds.chunk(chunks), compute=False, mode="w") 1242s region = {"time": slice(1000, 2000, 1)} 1242s chunk = ds.isel(region) 1242s chunk = chunk.chunk() 1242s > self.save(store, chunk.chunk(), region=region) 1242s 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6691: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6294: in save 1242s ds.to_zarr(target, **kwargs) 1242s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1242s return to_zarr( # type: ignore[call-overload,misc] 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1242s dump_to_store(dataset, zstore, writer, encoding=encoding) 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1242s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1242s k: self.open_store_variable(name=k) for k in existing_variable_names 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s self = 1242s name = 'temperature' 1242s 1242s def open_store_variable(self, name): 1242s zarr_array = self.members[name] 1242s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1242s try_nczarr = self._mode == "r" 1242s dimensions, attributes = _get_zarr_dims_and_attrs( 1242s zarr_array, DIMENSION_KEY, try_nczarr 1242s ) 1242s attributes = dict(attributes) 1242s 1242s encoding = { 1242s "chunks": zarr_array.chunks, 1242s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1242s } 1242s 1242s if _zarr_v3(): 1242s encoding.update( 1242s { 1242s "compressors": zarr_array.compressors, 1242s "filters": zarr_array.filters, 1242s "shards": zarr_array.shards, 1242s } 1242s ) 1242s if self.zarr_group.metadata.zarr_format == 3: 1242s encoding.update({"serializer": zarr_array.serializer}) 1242s else: 1242s encoding.update( 1242s { 1242s "compressor": zarr_array.compressor, 1242s "filters": zarr_array.filters, 1242s } 1242s ) 1242s 1242s if self._use_zarr_fill_value_as_mask: 1242s # Setting this attribute triggers CF decoding for missing values 1242s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1242s if zarr_array.fill_value is not None: 1242s attributes["_FillValue"] = zarr_array.fill_value 1242s elif "_FillValue" in attributes: 1242s original_zarr_dtype = zarr_array.metadata.data_type 1242s attributes["_FillValue"] = FillValueCoder.decode( 1242s > attributes["_FillValue"], original_zarr_dtype.value 1242s ) 1242s E AttributeError: 'Float64' object has no attribute 'value' 1242s 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1242s _____________ TestZarrRegionAuto.test_zarr_safe_chunk_region[3-a] ______________ 1242s 1242s self = 1242s mode = 'a' 1242s 1242s @requires_dask 1242s @pytest.mark.parametrize("mode", ["r+", "a"]) 1242s def test_zarr_safe_chunk_region(self, mode: Literal["r+", "a"]): 1242s with self.create_zarr_target() as store: 1242s arr = xr.DataArray( 1242s list(range(11)), dims=["a"], coords={"a": list(range(11))}, name="foo" 1242s ).chunk(a=3) 1242s self.save(store, arr, mode="w") 1242s 1242s with pytest.raises(ValueError): 1242s # There are two Dask chunks on the same Zarr chunk, 1242s # which means that it is unsafe in any mode 1242s self.save( 1242s store, 1242s arr.isel(a=slice(0, 3)).chunk(a=(2, 1)), 1242s region="auto", 1242s mode=mode, 1242s ) 1242s 1242s with pytest.raises(ValueError): 1242s # the first chunk is covering the border size, but it is not 1242s # completely covering the second chunk, which means that it is 1242s # unsafe in any mode 1242s self.save( 1242s store, 1242s arr.isel(a=slice(1, 5)).chunk(a=(3, 1)), 1242s region="auto", 1242s mode=mode, 1242s ) 1242s 1242s with pytest.raises(ValueError): 1242s # The first chunk is safe but the other two chunks are overlapping with 1242s # the same Zarr chunk 1242s self.save( 1242s store, 1242s arr.isel(a=slice(0, 5)).chunk(a=(3, 1, 1)), 1242s region="auto", 1242s mode=mode, 1242s ) 1242s 1242s # Fully update two contiguous chunks is safe in any mode 1242s self.save(store, arr.isel(a=slice(3, 9)), region="auto", mode=mode) 1242s 1242s # The last chunk is considered full based on their current size (2) 1242s self.save(store, arr.isel(a=slice(9, 11)), region="auto", mode=mode) 1242s self.save( 1242s store, arr.isel(a=slice(6, None)).chunk(a=-1), region="auto", mode=mode 1242s ) 1242s 1242s # Write the last chunk of a region partially is safe in "a" mode 1242s self.save(store, arr.isel(a=slice(3, 8)), region="auto", mode="a") 1242s with pytest.raises(ValueError): 1242s # with "r+" mode it is invalid to write partial chunk 1242s self.save(store, arr.isel(a=slice(3, 8)), region="auto", mode="r+") 1242s 1242s # This is safe with mode "a", the border size is covered by the first chunk of Dask 1242s self.save( 1242s store, arr.isel(a=slice(1, 4)).chunk(a=(2, 1)), region="auto", mode="a" 1242s ) 1242s with pytest.raises(ValueError): 1242s # This is considered unsafe in mode "r+" because it is writing in a partial chunk 1242s self.save( 1242s store, 1242s arr.isel(a=slice(1, 4)).chunk(a=(2, 1)), 1242s region="auto", 1242s mode="r+", 1242s ) 1242s 1242s # This is safe on mode "a" because there is a single dask chunk 1242s self.save( 1242s store, arr.isel(a=slice(1, 5)).chunk(a=(4,)), region="auto", mode="a" 1242s ) 1242s with pytest.raises(ValueError): 1242s # This is unsafe on mode "r+", because the Dask chunk is partially writing 1242s # in the first chunk of Zarr 1242s self.save( 1242s store, 1242s arr.isel(a=slice(1, 5)).chunk(a=(4,)), 1242s region="auto", 1242s mode="r+", 1242s ) 1242s 1242s # The first chunk is completely covering the first Zarr chunk 1242s # and the last chunk is a partial one 1242s self.save( 1242s store, arr.isel(a=slice(0, 5)).chunk(a=(3, 2)), region="auto", mode="a" 1242s ) 1242s 1242s with pytest.raises(ValueError): 1242s # The last chunk is partial, so it is considered unsafe on mode "r+" 1242s self.save( 1242s store, 1242s arr.isel(a=slice(0, 5)).chunk(a=(3, 2)), 1242s region="auto", 1242s mode="r+", 1242s ) 1242s 1242s # The first chunk is covering the border size (2 elements) 1242s # and also the second chunk (3 elements), so it is valid 1242s self.save( 1242s store, arr.isel(a=slice(1, 8)).chunk(a=(5, 2)), region="auto", mode="a" 1242s ) 1242s 1242s with pytest.raises(ValueError): 1242s # The first chunk is not fully covering the first zarr chunk 1242s self.save( 1242s store, 1242s arr.isel(a=slice(1, 8)).chunk(a=(5, 2)), 1242s region="auto", 1242s mode="r+", 1242s ) 1242s 1242s with pytest.raises(ValueError): 1242s # Validate that the border condition is not affecting the "r+" mode 1242s self.save(store, arr.isel(a=slice(1, 9)), region="auto", mode="r+") 1242s 1242s self.save(store, arr.isel(a=slice(10, 11)), region="auto", mode="a") 1242s with pytest.raises(ValueError): 1242s # Validate that even if we write with a single Dask chunk on the last Zarr 1242s # chunk it is still unsafe if it is not fully covering it 1242s # (the last Zarr chunk has size 2) 1242s self.save(store, arr.isel(a=slice(10, 11)), region="auto", mode="r+") 1242s 1242s # Validate the same as the above test but in the beginning of the last chunk 1242s self.save(store, arr.isel(a=slice(9, 10)), region="auto", mode="a") 1242s with pytest.raises(ValueError): 1242s self.save(store, arr.isel(a=slice(9, 10)), region="auto", mode="r+") 1242s 1242s self.save( 1242s store, arr.isel(a=slice(7, None)).chunk(a=-1), region="auto", mode="a" 1242s ) 1242s with pytest.raises(ValueError): 1242s # Test that even a Dask chunk that covers the last Zarr chunk can be unsafe 1242s # if it is partial covering other Zarr chunks 1242s self.save( 1242s store, 1242s arr.isel(a=slice(7, None)).chunk(a=-1), 1242s region="auto", 1242s mode="r+", 1242s ) 1242s 1242s with pytest.raises(ValueError): 1242s # If the chunk is of size equal to the one in the Zarr encoding, but 1242s # it is partially writing in the first chunk then raise an error 1242s self.save( 1242s store, 1242s arr.isel(a=slice(8, None)).chunk(a=3), 1242s region="auto", 1242s mode="r+", 1242s ) 1242s 1242s with pytest.raises(ValueError): 1242s self.save( 1242s store, arr.isel(a=slice(5, -1)).chunk(a=5), region="auto", mode="r+" 1242s ) 1242s 1242s # Test if the code is detecting the last chunk correctly 1242s data = np.random.default_rng(0).random((2920, 25, 53)) 1242s ds = xr.Dataset({"temperature": (("time", "lat", "lon"), data)}) 1242s chunks = {"time": 1000, "lat": 25, "lon": 53} 1242s self.save(store, ds.chunk(chunks), compute=False, mode="w") 1242s region = {"time": slice(1000, 2000, 1)} 1242s chunk = ds.isel(region) 1242s chunk = chunk.chunk() 1242s > self.save(store, chunk.chunk(), region=region) 1242s 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6691: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6294: in save 1242s ds.to_zarr(target, **kwargs) 1242s /usr/lib/python3/dist-packages/xarray/core/dataset.py:2270: in to_zarr 1242s return to_zarr( # type: ignore[call-overload,misc] 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:2239: in to_zarr 1242s dump_to_store(dataset, zstore, writer, encoding=encoding) 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:1975: in dump_to_store 1242s store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims) 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1009: in store 1242s k: self.open_store_variable(name=k) for k in existing_variable_names 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s self = 1242s name = 'temperature' 1242s 1242s def open_store_variable(self, name): 1242s zarr_array = self.members[name] 1242s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1242s try_nczarr = self._mode == "r" 1242s dimensions, attributes = _get_zarr_dims_and_attrs( 1242s zarr_array, DIMENSION_KEY, try_nczarr 1242s ) 1242s attributes = dict(attributes) 1242s 1242s encoding = { 1242s "chunks": zarr_array.chunks, 1242s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1242s } 1242s 1242s if _zarr_v3(): 1242s encoding.update( 1242s { 1242s "compressors": zarr_array.compressors, 1242s "filters": zarr_array.filters, 1242s "shards": zarr_array.shards, 1242s } 1242s ) 1242s if self.zarr_group.metadata.zarr_format == 3: 1242s encoding.update({"serializer": zarr_array.serializer}) 1242s else: 1242s encoding.update( 1242s { 1242s "compressor": zarr_array.compressor, 1242s "filters": zarr_array.filters, 1242s } 1242s ) 1242s 1242s if self._use_zarr_fill_value_as_mask: 1242s # Setting this attribute triggers CF decoding for missing values 1242s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1242s if zarr_array.fill_value is not None: 1242s attributes["_FillValue"] = zarr_array.fill_value 1242s elif "_FillValue" in attributes: 1242s original_zarr_dtype = zarr_array.metadata.data_type 1242s attributes["_FillValue"] = FillValueCoder.decode( 1242s > attributes["_FillValue"], original_zarr_dtype.value 1242s ) 1242s E AttributeError: 'Float64' object has no attribute 'value' 1242s 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1242s ____________________ test_open_dataset_chunking_zarr[auto] _____________________ 1242s 1242s chunks = 'auto' 1242s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-1/test_open_dataset_chunking_zar0') 1242s 1242s @requires_zarr 1242s @requires_dask 1242s @pytest.mark.parametrize( 1242s "chunks", ["auto", -1, {}, {"x": "auto"}, {"x": -1}, {"x": "auto", "y": -1}] 1242s ) 1242s def test_open_dataset_chunking_zarr(chunks, tmp_path: Path) -> None: 1242s encoded_chunks = 100 1242s dask_arr = da.from_array( 1242s np.ones((500, 500), dtype="float64"), chunks=encoded_chunks 1242s ) 1242s ds = xr.Dataset( 1242s { 1242s "test": xr.DataArray( 1242s dask_arr, 1242s dims=("x", "y"), 1242s ) 1242s } 1242s ) 1242s ds["test"].encoding["chunks"] = encoded_chunks 1242s ds.to_zarr(tmp_path / "test.zarr") 1242s 1242s with dask.config.set({"array.chunk-size": "1MiB"}): 1242s expected = ds.chunk(chunks) 1242s > with open_dataset( 1242s tmp_path / "test.zarr", engine="zarr", chunks=chunks 1242s ) as actual: 1242s 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6043: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1242s backend_ds = backend.open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1242s ds = store_entrypoint.open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1242s vars, attrs = filename_or_obj.load() 1242s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1242s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1242s return Frozen(dict(*args, **kwargs)) 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s self = , name = 'test' 1242s 1242s def open_store_variable(self, name): 1242s zarr_array = self.members[name] 1242s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1242s try_nczarr = self._mode == "r" 1242s dimensions, attributes = _get_zarr_dims_and_attrs( 1242s zarr_array, DIMENSION_KEY, try_nczarr 1242s ) 1242s attributes = dict(attributes) 1242s 1242s encoding = { 1242s "chunks": zarr_array.chunks, 1242s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1242s } 1242s 1242s if _zarr_v3(): 1242s encoding.update( 1242s { 1242s "compressors": zarr_array.compressors, 1242s "filters": zarr_array.filters, 1242s "shards": zarr_array.shards, 1242s } 1242s ) 1242s if self.zarr_group.metadata.zarr_format == 3: 1242s encoding.update({"serializer": zarr_array.serializer}) 1242s else: 1242s encoding.update( 1242s { 1242s "compressor": zarr_array.compressor, 1242s "filters": zarr_array.filters, 1242s } 1242s ) 1242s 1242s if self._use_zarr_fill_value_as_mask: 1242s # Setting this attribute triggers CF decoding for missing values 1242s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1242s if zarr_array.fill_value is not None: 1242s attributes["_FillValue"] = zarr_array.fill_value 1242s elif "_FillValue" in attributes: 1242s original_zarr_dtype = zarr_array.metadata.data_type 1242s attributes["_FillValue"] = FillValueCoder.decode( 1242s > attributes["_FillValue"], original_zarr_dtype.value 1242s ) 1242s E AttributeError: 'Float64' object has no attribute 'value' 1242s 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1242s _____________________ test_open_dataset_chunking_zarr[-1] ______________________ 1242s 1242s chunks = -1 1242s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-1/test_open_dataset_chunking_zar1') 1242s 1242s @requires_zarr 1242s @requires_dask 1242s @pytest.mark.parametrize( 1242s "chunks", ["auto", -1, {}, {"x": "auto"}, {"x": -1}, {"x": "auto", "y": -1}] 1242s ) 1242s def test_open_dataset_chunking_zarr(chunks, tmp_path: Path) -> None: 1242s encoded_chunks = 100 1242s dask_arr = da.from_array( 1242s np.ones((500, 500), dtype="float64"), chunks=encoded_chunks 1242s ) 1242s ds = xr.Dataset( 1242s { 1242s "test": xr.DataArray( 1242s dask_arr, 1242s dims=("x", "y"), 1242s ) 1242s } 1242s ) 1242s ds["test"].encoding["chunks"] = encoded_chunks 1242s ds.to_zarr(tmp_path / "test.zarr") 1242s 1242s with dask.config.set({"array.chunk-size": "1MiB"}): 1242s expected = ds.chunk(chunks) 1242s > with open_dataset( 1242s tmp_path / "test.zarr", engine="zarr", chunks=chunks 1242s ) as actual: 1242s 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6043: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1242s backend_ds = backend.open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1242s ds = store_entrypoint.open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1242s vars, attrs = filename_or_obj.load() 1242s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1242s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1242s return Frozen(dict(*args, **kwargs)) 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s self = , name = 'test' 1242s 1242s def open_store_variable(self, name): 1242s zarr_array = self.members[name] 1242s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1242s try_nczarr = self._mode == "r" 1242s dimensions, attributes = _get_zarr_dims_and_attrs( 1242s zarr_array, DIMENSION_KEY, try_nczarr 1242s ) 1242s attributes = dict(attributes) 1242s 1242s encoding = { 1242s "chunks": zarr_array.chunks, 1242s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1242s } 1242s 1242s if _zarr_v3(): 1242s encoding.update( 1242s { 1242s "compressors": zarr_array.compressors, 1242s "filters": zarr_array.filters, 1242s "shards": zarr_array.shards, 1242s } 1242s ) 1242s if self.zarr_group.metadata.zarr_format == 3: 1242s encoding.update({"serializer": zarr_array.serializer}) 1242s else: 1242s encoding.update( 1242s { 1242s "compressor": zarr_array.compressor, 1242s "filters": zarr_array.filters, 1242s } 1242s ) 1242s 1242s if self._use_zarr_fill_value_as_mask: 1242s # Setting this attribute triggers CF decoding for missing values 1242s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1242s if zarr_array.fill_value is not None: 1242s attributes["_FillValue"] = zarr_array.fill_value 1242s elif "_FillValue" in attributes: 1242s original_zarr_dtype = zarr_array.metadata.data_type 1242s attributes["_FillValue"] = FillValueCoder.decode( 1242s > attributes["_FillValue"], original_zarr_dtype.value 1242s ) 1242s E AttributeError: 'Float64' object has no attribute 'value' 1242s 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1242s ___________________ test_open_dataset_chunking_zarr[chunks2] ___________________ 1242s 1242s chunks = {} 1242s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-1/test_open_dataset_chunking_zar2') 1242s 1242s @requires_zarr 1242s @requires_dask 1242s @pytest.mark.parametrize( 1242s "chunks", ["auto", -1, {}, {"x": "auto"}, {"x": -1}, {"x": "auto", "y": -1}] 1242s ) 1242s def test_open_dataset_chunking_zarr(chunks, tmp_path: Path) -> None: 1242s encoded_chunks = 100 1242s dask_arr = da.from_array( 1242s np.ones((500, 500), dtype="float64"), chunks=encoded_chunks 1242s ) 1242s ds = xr.Dataset( 1242s { 1242s "test": xr.DataArray( 1242s dask_arr, 1242s dims=("x", "y"), 1242s ) 1242s } 1242s ) 1242s ds["test"].encoding["chunks"] = encoded_chunks 1242s ds.to_zarr(tmp_path / "test.zarr") 1242s 1242s with dask.config.set({"array.chunk-size": "1MiB"}): 1242s expected = ds.chunk(chunks) 1242s > with open_dataset( 1242s tmp_path / "test.zarr", engine="zarr", chunks=chunks 1242s ) as actual: 1242s 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6043: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1242s backend_ds = backend.open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1242s ds = store_entrypoint.open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1242s vars, attrs = filename_or_obj.load() 1242s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1242s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1242s return Frozen(dict(*args, **kwargs)) 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s self = , name = 'test' 1242s 1242s def open_store_variable(self, name): 1242s zarr_array = self.members[name] 1242s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1242s try_nczarr = self._mode == "r" 1242s dimensions, attributes = _get_zarr_dims_and_attrs( 1242s zarr_array, DIMENSION_KEY, try_nczarr 1242s ) 1242s attributes = dict(attributes) 1242s 1242s encoding = { 1242s "chunks": zarr_array.chunks, 1242s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1242s } 1242s 1242s if _zarr_v3(): 1242s encoding.update( 1242s { 1242s "compressors": zarr_array.compressors, 1242s "filters": zarr_array.filters, 1242s "shards": zarr_array.shards, 1242s } 1242s ) 1242s if self.zarr_group.metadata.zarr_format == 3: 1242s encoding.update({"serializer": zarr_array.serializer}) 1242s else: 1242s encoding.update( 1242s { 1242s "compressor": zarr_array.compressor, 1242s "filters": zarr_array.filters, 1242s } 1242s ) 1242s 1242s if self._use_zarr_fill_value_as_mask: 1242s # Setting this attribute triggers CF decoding for missing values 1242s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1242s if zarr_array.fill_value is not None: 1242s attributes["_FillValue"] = zarr_array.fill_value 1242s elif "_FillValue" in attributes: 1242s original_zarr_dtype = zarr_array.metadata.data_type 1242s attributes["_FillValue"] = FillValueCoder.decode( 1242s > attributes["_FillValue"], original_zarr_dtype.value 1242s ) 1242s E AttributeError: 'Float64' object has no attribute 'value' 1242s 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1242s ___________________ test_open_dataset_chunking_zarr[chunks3] ___________________ 1242s 1242s chunks = {'x': 'auto'} 1242s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-1/test_open_dataset_chunking_zar3') 1242s 1242s @requires_zarr 1242s @requires_dask 1242s @pytest.mark.parametrize( 1242s "chunks", ["auto", -1, {}, {"x": "auto"}, {"x": -1}, {"x": "auto", "y": -1}] 1242s ) 1242s def test_open_dataset_chunking_zarr(chunks, tmp_path: Path) -> None: 1242s encoded_chunks = 100 1242s dask_arr = da.from_array( 1242s np.ones((500, 500), dtype="float64"), chunks=encoded_chunks 1242s ) 1242s ds = xr.Dataset( 1242s { 1242s "test": xr.DataArray( 1242s dask_arr, 1242s dims=("x", "y"), 1242s ) 1242s } 1242s ) 1242s ds["test"].encoding["chunks"] = encoded_chunks 1242s ds.to_zarr(tmp_path / "test.zarr") 1242s 1242s with dask.config.set({"array.chunk-size": "1MiB"}): 1242s expected = ds.chunk(chunks) 1242s > with open_dataset( 1242s tmp_path / "test.zarr", engine="zarr", chunks=chunks 1242s ) as actual: 1242s 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6043: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1242s backend_ds = backend.open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1242s ds = store_entrypoint.open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1242s vars, attrs = filename_or_obj.load() 1242s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1242s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1242s return Frozen(dict(*args, **kwargs)) 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s self = , name = 'test' 1242s 1242s def open_store_variable(self, name): 1242s zarr_array = self.members[name] 1242s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1242s try_nczarr = self._mode == "r" 1242s dimensions, attributes = _get_zarr_dims_and_attrs( 1242s zarr_array, DIMENSION_KEY, try_nczarr 1242s ) 1242s attributes = dict(attributes) 1242s 1242s encoding = { 1242s "chunks": zarr_array.chunks, 1242s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1242s } 1242s 1242s if _zarr_v3(): 1242s encoding.update( 1242s { 1242s "compressors": zarr_array.compressors, 1242s "filters": zarr_array.filters, 1242s "shards": zarr_array.shards, 1242s } 1242s ) 1242s if self.zarr_group.metadata.zarr_format == 3: 1242s encoding.update({"serializer": zarr_array.serializer}) 1242s else: 1242s encoding.update( 1242s { 1242s "compressor": zarr_array.compressor, 1242s "filters": zarr_array.filters, 1242s } 1242s ) 1242s 1242s if self._use_zarr_fill_value_as_mask: 1242s # Setting this attribute triggers CF decoding for missing values 1242s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1242s if zarr_array.fill_value is not None: 1242s attributes["_FillValue"] = zarr_array.fill_value 1242s elif "_FillValue" in attributes: 1242s original_zarr_dtype = zarr_array.metadata.data_type 1242s attributes["_FillValue"] = FillValueCoder.decode( 1242s > attributes["_FillValue"], original_zarr_dtype.value 1242s ) 1242s E AttributeError: 'Float64' object has no attribute 'value' 1242s 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1242s ___________________ test_open_dataset_chunking_zarr[chunks4] ___________________ 1242s 1242s chunks = {'x': -1} 1242s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-1/test_open_dataset_chunking_zar4') 1242s 1242s @requires_zarr 1242s @requires_dask 1242s @pytest.mark.parametrize( 1242s "chunks", ["auto", -1, {}, {"x": "auto"}, {"x": -1}, {"x": "auto", "y": -1}] 1242s ) 1242s def test_open_dataset_chunking_zarr(chunks, tmp_path: Path) -> None: 1242s encoded_chunks = 100 1242s dask_arr = da.from_array( 1242s np.ones((500, 500), dtype="float64"), chunks=encoded_chunks 1242s ) 1242s ds = xr.Dataset( 1242s { 1242s "test": xr.DataArray( 1242s dask_arr, 1242s dims=("x", "y"), 1242s ) 1242s } 1242s ) 1242s ds["test"].encoding["chunks"] = encoded_chunks 1242s ds.to_zarr(tmp_path / "test.zarr") 1242s 1242s with dask.config.set({"array.chunk-size": "1MiB"}): 1242s expected = ds.chunk(chunks) 1242s > with open_dataset( 1242s tmp_path / "test.zarr", engine="zarr", chunks=chunks 1242s ) as actual: 1242s 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6043: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1242s backend_ds = backend.open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1242s ds = store_entrypoint.open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1242s vars, attrs = filename_or_obj.load() 1242s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1242s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1242s return Frozen(dict(*args, **kwargs)) 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s self = , name = 'test' 1242s 1242s def open_store_variable(self, name): 1242s zarr_array = self.members[name] 1242s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1242s try_nczarr = self._mode == "r" 1242s dimensions, attributes = _get_zarr_dims_and_attrs( 1242s zarr_array, DIMENSION_KEY, try_nczarr 1242s ) 1242s attributes = dict(attributes) 1242s 1242s encoding = { 1242s "chunks": zarr_array.chunks, 1242s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1242s } 1242s 1242s if _zarr_v3(): 1242s encoding.update( 1242s { 1242s "compressors": zarr_array.compressors, 1242s "filters": zarr_array.filters, 1242s "shards": zarr_array.shards, 1242s } 1242s ) 1242s if self.zarr_group.metadata.zarr_format == 3: 1242s encoding.update({"serializer": zarr_array.serializer}) 1242s else: 1242s encoding.update( 1242s { 1242s "compressor": zarr_array.compressor, 1242s "filters": zarr_array.filters, 1242s } 1242s ) 1242s 1242s if self._use_zarr_fill_value_as_mask: 1242s # Setting this attribute triggers CF decoding for missing values 1242s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1242s if zarr_array.fill_value is not None: 1242s attributes["_FillValue"] = zarr_array.fill_value 1242s elif "_FillValue" in attributes: 1242s original_zarr_dtype = zarr_array.metadata.data_type 1242s attributes["_FillValue"] = FillValueCoder.decode( 1242s > attributes["_FillValue"], original_zarr_dtype.value 1242s ) 1242s E AttributeError: 'Float64' object has no attribute 'value' 1242s 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1242s ___________________ test_open_dataset_chunking_zarr[chunks5] ___________________ 1242s 1242s chunks = {'x': 'auto', 'y': -1} 1242s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-1/test_open_dataset_chunking_zar5') 1242s 1242s @requires_zarr 1242s @requires_dask 1242s @pytest.mark.parametrize( 1242s "chunks", ["auto", -1, {}, {"x": "auto"}, {"x": -1}, {"x": "auto", "y": -1}] 1242s ) 1242s def test_open_dataset_chunking_zarr(chunks, tmp_path: Path) -> None: 1242s encoded_chunks = 100 1242s dask_arr = da.from_array( 1242s np.ones((500, 500), dtype="float64"), chunks=encoded_chunks 1242s ) 1242s ds = xr.Dataset( 1242s { 1242s "test": xr.DataArray( 1242s dask_arr, 1242s dims=("x", "y"), 1242s ) 1242s } 1242s ) 1242s ds["test"].encoding["chunks"] = encoded_chunks 1242s ds.to_zarr(tmp_path / "test.zarr") 1242s 1242s with dask.config.set({"array.chunk-size": "1MiB"}): 1242s expected = ds.chunk(chunks) 1242s > with open_dataset( 1242s tmp_path / "test.zarr", engine="zarr", chunks=chunks 1242s ) as actual: 1242s 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6043: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1242s backend_ds = backend.open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1242s ds = store_entrypoint.open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1242s vars, attrs = filename_or_obj.load() 1242s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1242s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1242s return Frozen(dict(*args, **kwargs)) 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s self = , name = 'test' 1242s 1242s def open_store_variable(self, name): 1242s zarr_array = self.members[name] 1242s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1242s try_nczarr = self._mode == "r" 1242s dimensions, attributes = _get_zarr_dims_and_attrs( 1242s zarr_array, DIMENSION_KEY, try_nczarr 1242s ) 1242s attributes = dict(attributes) 1242s 1242s encoding = { 1242s "chunks": zarr_array.chunks, 1242s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1242s } 1242s 1242s if _zarr_v3(): 1242s encoding.update( 1242s { 1242s "compressors": zarr_array.compressors, 1242s "filters": zarr_array.filters, 1242s "shards": zarr_array.shards, 1242s } 1242s ) 1242s if self.zarr_group.metadata.zarr_format == 3: 1242s encoding.update({"serializer": zarr_array.serializer}) 1242s else: 1242s encoding.update( 1242s { 1242s "compressor": zarr_array.compressor, 1242s "filters": zarr_array.filters, 1242s } 1242s ) 1242s 1242s if self._use_zarr_fill_value_as_mask: 1242s # Setting this attribute triggers CF decoding for missing values 1242s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1242s if zarr_array.fill_value is not None: 1242s attributes["_FillValue"] = zarr_array.fill_value 1242s elif "_FillValue" in attributes: 1242s original_zarr_dtype = zarr_array.metadata.data_type 1242s attributes["_FillValue"] = FillValueCoder.decode( 1242s > attributes["_FillValue"], original_zarr_dtype.value 1242s ) 1242s E AttributeError: 'Float64' object has no attribute 'value' 1242s 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1242s _______________________ test_chunking_consintency[auto] ________________________ 1242s 1242s chunks = 'auto' 1242s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-1/test_chunking_consintency_auto0') 1242s 1242s @requires_zarr 1242s @requires_dask 1242s @pytest.mark.parametrize( 1242s "chunks", ["auto", -1, {}, {"x": "auto"}, {"x": -1}, {"x": "auto", "y": -1}] 1242s ) 1242s @pytest.mark.filterwarnings("ignore:The specified chunks separate") 1242s def test_chunking_consintency(chunks, tmp_path: Path) -> None: 1242s encoded_chunks: dict[str, Any] = {} 1242s dask_arr = da.from_array( 1242s np.ones((500, 500), dtype="float64"), chunks=encoded_chunks 1242s ) 1242s ds = xr.Dataset( 1242s { 1242s "test": xr.DataArray( 1242s dask_arr, 1242s dims=("x", "y"), 1242s ) 1242s } 1242s ) 1242s ds["test"].encoding["chunks"] = encoded_chunks 1242s ds.to_zarr(tmp_path / "test.zarr") 1242s ds.to_netcdf(tmp_path / "test.nc") 1242s 1242s with dask.config.set({"array.chunk-size": "1MiB"}): 1242s expected = ds.chunk(chunks) 1242s > with xr.open_dataset( 1242s tmp_path / "test.zarr", engine="zarr", chunks=chunks 1242s ) as actual: 1242s 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6074: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1242s backend_ds = backend.open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1242s ds = store_entrypoint.open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1242s vars, attrs = filename_or_obj.load() 1242s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1242s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1242s return Frozen(dict(*args, **kwargs)) 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s self = , name = 'test' 1242s 1242s def open_store_variable(self, name): 1242s zarr_array = self.members[name] 1242s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1242s try_nczarr = self._mode == "r" 1242s dimensions, attributes = _get_zarr_dims_and_attrs( 1242s zarr_array, DIMENSION_KEY, try_nczarr 1242s ) 1242s attributes = dict(attributes) 1242s 1242s encoding = { 1242s "chunks": zarr_array.chunks, 1242s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1242s } 1242s 1242s if _zarr_v3(): 1242s encoding.update( 1242s { 1242s "compressors": zarr_array.compressors, 1242s "filters": zarr_array.filters, 1242s "shards": zarr_array.shards, 1242s } 1242s ) 1242s if self.zarr_group.metadata.zarr_format == 3: 1242s encoding.update({"serializer": zarr_array.serializer}) 1242s else: 1242s encoding.update( 1242s { 1242s "compressor": zarr_array.compressor, 1242s "filters": zarr_array.filters, 1242s } 1242s ) 1242s 1242s if self._use_zarr_fill_value_as_mask: 1242s # Setting this attribute triggers CF decoding for missing values 1242s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1242s if zarr_array.fill_value is not None: 1242s attributes["_FillValue"] = zarr_array.fill_value 1242s elif "_FillValue" in attributes: 1242s original_zarr_dtype = zarr_array.metadata.data_type 1242s attributes["_FillValue"] = FillValueCoder.decode( 1242s > attributes["_FillValue"], original_zarr_dtype.value 1242s ) 1242s E AttributeError: 'Float64' object has no attribute 'value' 1242s 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1242s ________________________ test_chunking_consintency[-1] _________________________ 1242s 1242s chunks = -1 1242s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-1/test_chunking_consintency__1_0') 1242s 1242s @requires_zarr 1242s @requires_dask 1242s @pytest.mark.parametrize( 1242s "chunks", ["auto", -1, {}, {"x": "auto"}, {"x": -1}, {"x": "auto", "y": -1}] 1242s ) 1242s @pytest.mark.filterwarnings("ignore:The specified chunks separate") 1242s def test_chunking_consintency(chunks, tmp_path: Path) -> None: 1242s encoded_chunks: dict[str, Any] = {} 1242s dask_arr = da.from_array( 1242s np.ones((500, 500), dtype="float64"), chunks=encoded_chunks 1242s ) 1242s ds = xr.Dataset( 1242s { 1242s "test": xr.DataArray( 1242s dask_arr, 1242s dims=("x", "y"), 1242s ) 1242s } 1242s ) 1242s ds["test"].encoding["chunks"] = encoded_chunks 1242s ds.to_zarr(tmp_path / "test.zarr") 1242s ds.to_netcdf(tmp_path / "test.nc") 1242s 1242s with dask.config.set({"array.chunk-size": "1MiB"}): 1242s expected = ds.chunk(chunks) 1242s > with xr.open_dataset( 1242s tmp_path / "test.zarr", engine="zarr", chunks=chunks 1242s ) as actual: 1242s 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6074: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1242s backend_ds = backend.open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1242s ds = store_entrypoint.open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1242s vars, attrs = filename_or_obj.load() 1242s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1242s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1242s return Frozen(dict(*args, **kwargs)) 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s self = , name = 'test' 1242s 1242s def open_store_variable(self, name): 1242s zarr_array = self.members[name] 1242s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1242s try_nczarr = self._mode == "r" 1242s dimensions, attributes = _get_zarr_dims_and_attrs( 1242s zarr_array, DIMENSION_KEY, try_nczarr 1242s ) 1242s attributes = dict(attributes) 1242s 1242s encoding = { 1242s "chunks": zarr_array.chunks, 1242s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1242s } 1242s 1242s if _zarr_v3(): 1242s encoding.update( 1242s { 1242s "compressors": zarr_array.compressors, 1242s "filters": zarr_array.filters, 1242s "shards": zarr_array.shards, 1242s } 1242s ) 1242s if self.zarr_group.metadata.zarr_format == 3: 1242s encoding.update({"serializer": zarr_array.serializer}) 1242s else: 1242s encoding.update( 1242s { 1242s "compressor": zarr_array.compressor, 1242s "filters": zarr_array.filters, 1242s } 1242s ) 1242s 1242s if self._use_zarr_fill_value_as_mask: 1242s # Setting this attribute triggers CF decoding for missing values 1242s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1242s if zarr_array.fill_value is not None: 1242s attributes["_FillValue"] = zarr_array.fill_value 1242s elif "_FillValue" in attributes: 1242s original_zarr_dtype = zarr_array.metadata.data_type 1242s attributes["_FillValue"] = FillValueCoder.decode( 1242s > attributes["_FillValue"], original_zarr_dtype.value 1242s ) 1242s E AttributeError: 'Float64' object has no attribute 'value' 1242s 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1242s ______________________ test_chunking_consintency[chunks2] ______________________ 1242s 1242s chunks = {} 1242s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-1/test_chunking_consintency_chun0') 1242s 1242s @requires_zarr 1242s @requires_dask 1242s @pytest.mark.parametrize( 1242s "chunks", ["auto", -1, {}, {"x": "auto"}, {"x": -1}, {"x": "auto", "y": -1}] 1242s ) 1242s @pytest.mark.filterwarnings("ignore:The specified chunks separate") 1242s def test_chunking_consintency(chunks, tmp_path: Path) -> None: 1242s encoded_chunks: dict[str, Any] = {} 1242s dask_arr = da.from_array( 1242s np.ones((500, 500), dtype="float64"), chunks=encoded_chunks 1242s ) 1242s ds = xr.Dataset( 1242s { 1242s "test": xr.DataArray( 1242s dask_arr, 1242s dims=("x", "y"), 1242s ) 1242s } 1242s ) 1242s ds["test"].encoding["chunks"] = encoded_chunks 1242s ds.to_zarr(tmp_path / "test.zarr") 1242s ds.to_netcdf(tmp_path / "test.nc") 1242s 1242s with dask.config.set({"array.chunk-size": "1MiB"}): 1242s expected = ds.chunk(chunks) 1242s > with xr.open_dataset( 1242s tmp_path / "test.zarr", engine="zarr", chunks=chunks 1242s ) as actual: 1242s 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6074: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1242s backend_ds = backend.open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1242s ds = store_entrypoint.open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1242s vars, attrs = filename_or_obj.load() 1242s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1242s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1242s return Frozen(dict(*args, **kwargs)) 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s self = , name = 'test' 1242s 1242s def open_store_variable(self, name): 1242s zarr_array = self.members[name] 1242s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1242s try_nczarr = self._mode == "r" 1242s dimensions, attributes = _get_zarr_dims_and_attrs( 1242s zarr_array, DIMENSION_KEY, try_nczarr 1242s ) 1242s attributes = dict(attributes) 1242s 1242s encoding = { 1242s "chunks": zarr_array.chunks, 1242s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1242s } 1242s 1242s if _zarr_v3(): 1242s encoding.update( 1242s { 1242s "compressors": zarr_array.compressors, 1242s "filters": zarr_array.filters, 1242s "shards": zarr_array.shards, 1242s } 1242s ) 1242s if self.zarr_group.metadata.zarr_format == 3: 1242s encoding.update({"serializer": zarr_array.serializer}) 1242s else: 1242s encoding.update( 1242s { 1242s "compressor": zarr_array.compressor, 1242s "filters": zarr_array.filters, 1242s } 1242s ) 1242s 1242s if self._use_zarr_fill_value_as_mask: 1242s # Setting this attribute triggers CF decoding for missing values 1242s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1242s if zarr_array.fill_value is not None: 1242s attributes["_FillValue"] = zarr_array.fill_value 1242s elif "_FillValue" in attributes: 1242s original_zarr_dtype = zarr_array.metadata.data_type 1242s attributes["_FillValue"] = FillValueCoder.decode( 1242s > attributes["_FillValue"], original_zarr_dtype.value 1242s ) 1242s E AttributeError: 'Float64' object has no attribute 'value' 1242s 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1242s ______________________ test_chunking_consintency[chunks3] ______________________ 1242s 1242s chunks = {'x': 'auto'} 1242s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-1/test_chunking_consintency_chun1') 1242s 1242s @requires_zarr 1242s @requires_dask 1242s @pytest.mark.parametrize( 1242s "chunks", ["auto", -1, {}, {"x": "auto"}, {"x": -1}, {"x": "auto", "y": -1}] 1242s ) 1242s @pytest.mark.filterwarnings("ignore:The specified chunks separate") 1242s def test_chunking_consintency(chunks, tmp_path: Path) -> None: 1242s encoded_chunks: dict[str, Any] = {} 1242s dask_arr = da.from_array( 1242s np.ones((500, 500), dtype="float64"), chunks=encoded_chunks 1242s ) 1242s ds = xr.Dataset( 1242s { 1242s "test": xr.DataArray( 1242s dask_arr, 1242s dims=("x", "y"), 1242s ) 1242s } 1242s ) 1242s ds["test"].encoding["chunks"] = encoded_chunks 1242s ds.to_zarr(tmp_path / "test.zarr") 1242s ds.to_netcdf(tmp_path / "test.nc") 1242s 1242s with dask.config.set({"array.chunk-size": "1MiB"}): 1242s expected = ds.chunk(chunks) 1242s > with xr.open_dataset( 1242s tmp_path / "test.zarr", engine="zarr", chunks=chunks 1242s ) as actual: 1242s 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6074: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1242s backend_ds = backend.open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1242s ds = store_entrypoint.open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1242s vars, attrs = filename_or_obj.load() 1242s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1242s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1242s return Frozen(dict(*args, **kwargs)) 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s self = , name = 'test' 1242s 1242s def open_store_variable(self, name): 1242s zarr_array = self.members[name] 1242s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1242s try_nczarr = self._mode == "r" 1242s dimensions, attributes = _get_zarr_dims_and_attrs( 1242s zarr_array, DIMENSION_KEY, try_nczarr 1242s ) 1242s attributes = dict(attributes) 1242s 1242s encoding = { 1242s "chunks": zarr_array.chunks, 1242s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1242s } 1242s 1242s if _zarr_v3(): 1242s encoding.update( 1242s { 1242s "compressors": zarr_array.compressors, 1242s "filters": zarr_array.filters, 1242s "shards": zarr_array.shards, 1242s } 1242s ) 1242s if self.zarr_group.metadata.zarr_format == 3: 1242s encoding.update({"serializer": zarr_array.serializer}) 1242s else: 1242s encoding.update( 1242s { 1242s "compressor": zarr_array.compressor, 1242s "filters": zarr_array.filters, 1242s } 1242s ) 1242s 1242s if self._use_zarr_fill_value_as_mask: 1242s # Setting this attribute triggers CF decoding for missing values 1242s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1242s if zarr_array.fill_value is not None: 1242s attributes["_FillValue"] = zarr_array.fill_value 1242s elif "_FillValue" in attributes: 1242s original_zarr_dtype = zarr_array.metadata.data_type 1242s attributes["_FillValue"] = FillValueCoder.decode( 1242s > attributes["_FillValue"], original_zarr_dtype.value 1242s ) 1242s E AttributeError: 'Float64' object has no attribute 'value' 1242s 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1242s ______________________ test_chunking_consintency[chunks4] ______________________ 1242s 1242s chunks = {'x': -1} 1242s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-1/test_chunking_consintency_chun2') 1242s 1242s @requires_zarr 1242s @requires_dask 1242s @pytest.mark.parametrize( 1242s "chunks", ["auto", -1, {}, {"x": "auto"}, {"x": -1}, {"x": "auto", "y": -1}] 1242s ) 1242s @pytest.mark.filterwarnings("ignore:The specified chunks separate") 1242s def test_chunking_consintency(chunks, tmp_path: Path) -> None: 1242s encoded_chunks: dict[str, Any] = {} 1242s dask_arr = da.from_array( 1242s np.ones((500, 500), dtype="float64"), chunks=encoded_chunks 1242s ) 1242s ds = xr.Dataset( 1242s { 1242s "test": xr.DataArray( 1242s dask_arr, 1242s dims=("x", "y"), 1242s ) 1242s } 1242s ) 1242s ds["test"].encoding["chunks"] = encoded_chunks 1242s ds.to_zarr(tmp_path / "test.zarr") 1242s ds.to_netcdf(tmp_path / "test.nc") 1242s 1242s with dask.config.set({"array.chunk-size": "1MiB"}): 1242s expected = ds.chunk(chunks) 1242s > with xr.open_dataset( 1242s tmp_path / "test.zarr", engine="zarr", chunks=chunks 1242s ) as actual: 1242s 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6074: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1242s backend_ds = backend.open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1242s ds = store_entrypoint.open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1242s vars, attrs = filename_or_obj.load() 1242s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1242s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1242s return Frozen(dict(*args, **kwargs)) 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s self = , name = 'test' 1242s 1242s def open_store_variable(self, name): 1242s zarr_array = self.members[name] 1242s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1242s try_nczarr = self._mode == "r" 1242s dimensions, attributes = _get_zarr_dims_and_attrs( 1242s zarr_array, DIMENSION_KEY, try_nczarr 1242s ) 1242s attributes = dict(attributes) 1242s 1242s encoding = { 1242s "chunks": zarr_array.chunks, 1242s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1242s } 1242s 1242s if _zarr_v3(): 1242s encoding.update( 1242s { 1242s "compressors": zarr_array.compressors, 1242s "filters": zarr_array.filters, 1242s "shards": zarr_array.shards, 1242s } 1242s ) 1242s if self.zarr_group.metadata.zarr_format == 3: 1242s encoding.update({"serializer": zarr_array.serializer}) 1242s else: 1242s encoding.update( 1242s { 1242s "compressor": zarr_array.compressor, 1242s "filters": zarr_array.filters, 1242s } 1242s ) 1242s 1242s if self._use_zarr_fill_value_as_mask: 1242s # Setting this attribute triggers CF decoding for missing values 1242s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1242s if zarr_array.fill_value is not None: 1242s attributes["_FillValue"] = zarr_array.fill_value 1242s elif "_FillValue" in attributes: 1242s original_zarr_dtype = zarr_array.metadata.data_type 1242s attributes["_FillValue"] = FillValueCoder.decode( 1242s > attributes["_FillValue"], original_zarr_dtype.value 1242s ) 1242s E AttributeError: 'Float64' object has no attribute 'value' 1242s 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1242s ______________________ test_chunking_consintency[chunks5] ______________________ 1242s 1242s chunks = {'x': 'auto', 'y': -1} 1242s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-1/test_chunking_consintency_chun3') 1242s 1242s @requires_zarr 1242s @requires_dask 1242s @pytest.mark.parametrize( 1242s "chunks", ["auto", -1, {}, {"x": "auto"}, {"x": -1}, {"x": "auto", "y": -1}] 1242s ) 1242s @pytest.mark.filterwarnings("ignore:The specified chunks separate") 1242s def test_chunking_consintency(chunks, tmp_path: Path) -> None: 1242s encoded_chunks: dict[str, Any] = {} 1242s dask_arr = da.from_array( 1242s np.ones((500, 500), dtype="float64"), chunks=encoded_chunks 1242s ) 1242s ds = xr.Dataset( 1242s { 1242s "test": xr.DataArray( 1242s dask_arr, 1242s dims=("x", "y"), 1242s ) 1242s } 1242s ) 1242s ds["test"].encoding["chunks"] = encoded_chunks 1242s ds.to_zarr(tmp_path / "test.zarr") 1242s ds.to_netcdf(tmp_path / "test.nc") 1242s 1242s with dask.config.set({"array.chunk-size": "1MiB"}): 1242s expected = ds.chunk(chunks) 1242s > with xr.open_dataset( 1242s tmp_path / "test.zarr", engine="zarr", chunks=chunks 1242s ) as actual: 1242s 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6074: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1242s backend_ds = backend.open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1242s ds = store_entrypoint.open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1242s vars, attrs = filename_or_obj.load() 1242s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1242s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1242s return Frozen(dict(*args, **kwargs)) 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s self = , name = 'test' 1242s 1242s def open_store_variable(self, name): 1242s zarr_array = self.members[name] 1242s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1242s try_nczarr = self._mode == "r" 1242s dimensions, attributes = _get_zarr_dims_and_attrs( 1242s zarr_array, DIMENSION_KEY, try_nczarr 1242s ) 1242s attributes = dict(attributes) 1242s 1242s encoding = { 1242s "chunks": zarr_array.chunks, 1242s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1242s } 1242s 1242s if _zarr_v3(): 1242s encoding.update( 1242s { 1242s "compressors": zarr_array.compressors, 1242s "filters": zarr_array.filters, 1242s "shards": zarr_array.shards, 1242s } 1242s ) 1242s if self.zarr_group.metadata.zarr_format == 3: 1242s encoding.update({"serializer": zarr_array.serializer}) 1242s else: 1242s encoding.update( 1242s { 1242s "compressor": zarr_array.compressor, 1242s "filters": zarr_array.filters, 1242s } 1242s ) 1242s 1242s if self._use_zarr_fill_value_as_mask: 1242s # Setting this attribute triggers CF decoding for missing values 1242s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1242s if zarr_array.fill_value is not None: 1242s attributes["_FillValue"] = zarr_array.fill_value 1242s elif "_FillValue" in attributes: 1242s original_zarr_dtype = zarr_array.metadata.data_type 1242s attributes["_FillValue"] = FillValueCoder.decode( 1242s > attributes["_FillValue"], original_zarr_dtype.value 1242s ) 1242s E AttributeError: 'Float64' object has no attribute 'value' 1242s 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1242s ______________________ TestNCZarr.test_overwriting_nczarr ______________________ 1242s 1242s self = 1242s 1242s def test_overwriting_nczarr(self) -> None: 1242s with create_tmp_file(suffix=".zarr") as tmp: 1242s ds = self._create_nczarr(tmp) 1242s expected = ds[["var1"]] 1242s expected.to_zarr(tmp, mode="w") 1242s > actual = xr.open_zarr(tmp, consolidated=False) 1242s 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends.py:6223: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1535: in open_zarr 1242s ds = open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:687: in open_dataset 1242s backend_ds = backend.open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1625: in open_dataset 1242s ds = store_entrypoint.open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1242s vars, attrs = filename_or_obj.load() 1242s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1242s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1242s return Frozen(dict(*args, **kwargs)) 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s self = , name = 'dim2' 1242s 1242s def open_store_variable(self, name): 1242s zarr_array = self.members[name] 1242s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1242s try_nczarr = self._mode == "r" 1242s dimensions, attributes = _get_zarr_dims_and_attrs( 1242s zarr_array, DIMENSION_KEY, try_nczarr 1242s ) 1242s attributes = dict(attributes) 1242s 1242s encoding = { 1242s "chunks": zarr_array.chunks, 1242s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1242s } 1242s 1242s if _zarr_v3(): 1242s encoding.update( 1242s { 1242s "compressors": zarr_array.compressors, 1242s "filters": zarr_array.filters, 1242s "shards": zarr_array.shards, 1242s } 1242s ) 1242s if self.zarr_group.metadata.zarr_format == 3: 1242s encoding.update({"serializer": zarr_array.serializer}) 1242s else: 1242s encoding.update( 1242s { 1242s "compressor": zarr_array.compressor, 1242s "filters": zarr_array.filters, 1242s } 1242s ) 1242s 1242s if self._use_zarr_fill_value_as_mask: 1242s # Setting this attribute triggers CF decoding for missing values 1242s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1242s if zarr_array.fill_value is not None: 1242s attributes["_FillValue"] = zarr_array.fill_value 1242s elif "_FillValue" in attributes: 1242s original_zarr_dtype = zarr_array.metadata.data_type 1242s attributes["_FillValue"] = FillValueCoder.decode( 1242s > attributes["_FillValue"], original_zarr_dtype.value 1242s ) 1242s E AttributeError: 'Float64' object has no attribute 'value' 1242s 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1242s ________________ TestZarrDatatreeIO.test_to_zarr[zarr_format=3] ________________ 1242s 1242s self = 1242s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-1/test_to_zarr_zarr_format_3_0') 1242s simple_datatree = 1242s Group: / 1242s │ Dimensions: (y: 3, x: 2) 1242s │ Dimensions without coordinates: y, x 1242s │ Data variables: 1242s ... a (x) int64 16B 2 3 1242s │ │ b (x) float64 16B 0.1 0.2 1242s │ └── Group: /set2/set1 1242s └── Group: /set3 1242s zarr_format = 3 1242s 1242s def test_to_zarr(self, tmpdir, simple_datatree, zarr_format): 1242s filepath = str(tmpdir / "test.zarr") 1242s original_dt = simple_datatree 1242s original_dt.to_zarr(filepath, zarr_format=zarr_format) 1242s 1242s > with open_datatree(filepath, engine="zarr") as roundtrip_dt: 1242s 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends_datatree.py:459: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:1132: in open_datatree 1242s backend_tree = backend.open_datatree( 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1658: in open_datatree 1242s groups_dict = self.open_groups_as_dict( 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1725: in open_groups_as_dict 1242s group_ds = store_entrypoint.open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1242s vars, attrs = filename_or_obj.load() 1242s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1242s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1242s return Frozen(dict(*args, **kwargs)) 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s self = , name = 'b' 1242s 1242s def open_store_variable(self, name): 1242s zarr_array = self.members[name] 1242s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1242s try_nczarr = self._mode == "r" 1242s dimensions, attributes = _get_zarr_dims_and_attrs( 1242s zarr_array, DIMENSION_KEY, try_nczarr 1242s ) 1242s attributes = dict(attributes) 1242s 1242s encoding = { 1242s "chunks": zarr_array.chunks, 1242s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1242s } 1242s 1242s if _zarr_v3(): 1242s encoding.update( 1242s { 1242s "compressors": zarr_array.compressors, 1242s "filters": zarr_array.filters, 1242s "shards": zarr_array.shards, 1242s } 1242s ) 1242s if self.zarr_group.metadata.zarr_format == 3: 1242s encoding.update({"serializer": zarr_array.serializer}) 1242s else: 1242s encoding.update( 1242s { 1242s "compressor": zarr_array.compressor, 1242s "filters": zarr_array.filters, 1242s } 1242s ) 1242s 1242s if self._use_zarr_fill_value_as_mask: 1242s # Setting this attribute triggers CF decoding for missing values 1242s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1242s if zarr_array.fill_value is not None: 1242s attributes["_FillValue"] = zarr_array.fill_value 1242s elif "_FillValue" in attributes: 1242s original_zarr_dtype = zarr_array.metadata.data_type 1242s attributes["_FillValue"] = FillValueCoder.decode( 1242s > attributes["_FillValue"], original_zarr_dtype.value 1242s ) 1242s E AttributeError: 'Float64' object has no attribute 'value' 1242s 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1242s _____________ TestZarrDatatreeIO.test_zarr_encoding[zarr_format=3] _____________ 1242s 1242s self = 1242s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-1/test_zarr_encoding_zarr_format1') 1242s simple_datatree = 1242s Group: / 1242s │ Dimensions: (y: 3, x: 2) 1242s │ Dimensions without coordinates: y, x 1242s │ Data variables: 1242s ... a (x) int64 16B 2 3 1242s │ │ b (x) float64 16B 0.1 0.2 1242s │ └── Group: /set2/set1 1242s └── Group: /set3 1242s zarr_format = 3 1242s 1242s def test_zarr_encoding(self, tmpdir, simple_datatree, zarr_format): 1242s filepath = str(tmpdir / "test.zarr") 1242s original_dt = simple_datatree 1242s 1242s if zarr_format == 2: 1242s from numcodecs.blosc import Blosc 1242s 1242s codec = Blosc(cname="zstd", clevel=3, shuffle=2) 1242s comp = {"compressors": (codec,)} if has_zarr_v3 else {"compressor": codec} 1242s elif zarr_format == 3: 1242s # specifying codecs in zarr_format=3 requires importing from zarr 3 namespace 1242s import numcodecs.zarr3 1242s 1242s comp = {"compressors": (numcodecs.zarr3.Blosc(cname="zstd", clevel=3),)} 1242s 1242s enc = {"/set2": {var: comp for var in original_dt["/set2"].dataset.data_vars}} 1242s original_dt.to_zarr(filepath, encoding=enc, zarr_format=zarr_format) 1242s 1242s > with open_datatree(filepath, engine="zarr") as roundtrip_dt: 1242s 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends_datatree.py:480: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:1132: in open_datatree 1242s backend_tree = backend.open_datatree( 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1658: in open_datatree 1242s groups_dict = self.open_groups_as_dict( 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1725: in open_groups_as_dict 1242s group_ds = store_entrypoint.open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1242s vars, attrs = filename_or_obj.load() 1242s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1242s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1242s return Frozen(dict(*args, **kwargs)) 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s self = , name = 'b' 1242s 1242s def open_store_variable(self, name): 1242s zarr_array = self.members[name] 1242s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1242s try_nczarr = self._mode == "r" 1242s dimensions, attributes = _get_zarr_dims_and_attrs( 1242s zarr_array, DIMENSION_KEY, try_nczarr 1242s ) 1242s attributes = dict(attributes) 1242s 1242s encoding = { 1242s "chunks": zarr_array.chunks, 1242s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1242s } 1242s 1242s if _zarr_v3(): 1242s encoding.update( 1242s { 1242s "compressors": zarr_array.compressors, 1242s "filters": zarr_array.filters, 1242s "shards": zarr_array.shards, 1242s } 1242s ) 1242s if self.zarr_group.metadata.zarr_format == 3: 1242s encoding.update({"serializer": zarr_array.serializer}) 1242s else: 1242s encoding.update( 1242s { 1242s "compressor": zarr_array.compressor, 1242s "filters": zarr_array.filters, 1242s } 1242s ) 1242s 1242s if self._use_zarr_fill_value_as_mask: 1242s # Setting this attribute triggers CF decoding for missing values 1242s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1242s if zarr_array.fill_value is not None: 1242s attributes["_FillValue"] = zarr_array.fill_value 1242s elif "_FillValue" in attributes: 1242s original_zarr_dtype = zarr_array.metadata.data_type 1242s attributes["_FillValue"] = FillValueCoder.decode( 1242s > attributes["_FillValue"], original_zarr_dtype.value 1242s ) 1242s E AttributeError: 'Float64' object has no attribute 'value' 1242s 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1242s ___________ TestZarrDatatreeIO.test_to_zarr_zip_store[zarr_format=2] ___________ 1242s 1242s cls = 1242s store = ZipStore('zip:///tmp/pytest-of-ubuntu/pytest-1/test_to_zarr_zip_store_zarr_fo0/test.zarr.zip') 1242s path = '', mode = 'r' 1242s 1242s @classmethod 1242s async def open(cls, store: Store, path: str, mode: AccessModeLiteral | None = None) -> Self: 1242s """ 1242s Open StorePath based on the provided mode. 1242s 1242s * If the mode is None, return an opened version of the store with no changes. 1242s * If the mode is 'r+', 'w-', 'w', or 'a' and the store is read-only, raise a ValueError. 1242s * If the mode is 'r' and the store is not read-only, return a copy of the store with read_only set to True. 1242s * If the mode is 'w-' and the store is not read-only and the StorePath contains keys, raise a FileExistsError. 1242s * If the mode is 'w' and the store is not read-only, delete all keys nested within the StorePath. 1242s 1242s Parameters 1242s ---------- 1242s mode : AccessModeLiteral 1242s The mode to use when initializing the store path. 1242s 1242s The accepted values are: 1242s 1242s - ``'r'``: read only (must exist) 1242s - ``'r+'``: read/write (must exist) 1242s - ``'a'``: read/write (create if doesn't exist) 1242s - ``'w'``: read/write (overwrite if exists) 1242s - ``'w-'``: read/write (create if doesn't exist). 1242s 1242s Raises 1242s ------ 1242s FileExistsError 1242s If the mode is 'w-' and the store path already exists. 1242s ValueError 1242s If the mode is not "r" and the store is read-only, or 1242s """ 1242s 1242s # fastpath if mode is None 1242s if mode is None: 1242s return await cls._create_open_instance(store, path) 1242s 1242s if mode not in ANY_ACCESS_MODE: 1242s raise ValueError(f"Invalid mode: {mode}, expected one of {ANY_ACCESS_MODE}") 1242s 1242s if store.read_only: 1242s # Don't allow write operations on a read-only store 1242s if mode != "r": 1242s raise ValueError( 1242s f"Store is read-only but mode is {mode!r}. Create a writable store or use 'r' mode." 1242s ) 1242s self = await cls._create_open_instance(store, path) 1242s elif mode == "r": 1242s # Create read-only copy for read mode on writable store 1242s try: 1242s > read_only_store = store.with_read_only(True) 1242s 1242s /usr/lib/python3/dist-packages/zarr/storage/_common.py:123: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s self = ZipStore('zip:///tmp/pytest-of-ubuntu/pytest-1/test_to_zarr_zip_store_zarr_fo0/test.zarr.zip') 1242s read_only = True 1242s 1242s def with_read_only(self, read_only: bool = False) -> Store: 1242s """ 1242s Return a new store with a new read_only setting. 1242s 1242s The new store points to the same location with the specified new read_only state. 1242s The returned Store is not automatically opened, and this store is 1242s not automatically closed. 1242s 1242s Parameters 1242s ---------- 1242s read_only 1242s If True, the store will be created in read-only mode. Defaults to False. 1242s 1242s Returns 1242s ------- 1242s A new store of the same type with the new read only attribute. 1242s """ 1242s > raise NotImplementedError( 1242s f"with_read_only is not implemented for the {type(self)} store type." 1242s ) 1242s E NotImplementedError: with_read_only is not implemented for the store type. 1242s 1242s /usr/lib/python3/dist-packages/zarr/abc/store.py:98: NotImplementedError 1242s 1242s The above exception was the direct cause of the following exception: 1242s 1242s self = 1242s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-1/test_to_zarr_zip_store_zarr_fo0') 1242s simple_datatree = 1242s Group: / 1242s │ Dimensions: (y: 3, x: 2) 1242s │ Dimensions without coordinates: y, x 1242s │ Data variables: 1242s ... a (x) int64 16B 2 3 1242s │ │ b (x) float64 16B 0.1 0.2 1242s │ └── Group: /set2/set1 1242s └── Group: /set3 1242s zarr_format = 2 1242s 1242s def test_to_zarr_zip_store(self, tmpdir, simple_datatree, zarr_format): 1242s from zarr.storage import ZipStore 1242s 1242s filepath = str(tmpdir / "test.zarr.zip") 1242s original_dt = simple_datatree 1242s store = ZipStore(filepath, mode="w") 1242s original_dt.to_zarr(store, zarr_format=zarr_format) 1242s 1242s > with open_datatree(store, engine="zarr") as roundtrip_dt: # type: ignore[arg-type, unused-ignore] 1242s 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends_datatree.py:500: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:1132: in open_datatree 1242s backend_tree = backend.open_datatree( 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1658: in open_datatree 1242s groups_dict = self.open_groups_as_dict( 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1707: in open_groups_as_dict 1242s stores = ZarrStore.open_store( 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:665: in open_store 1242s ) = _get_open_params( 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1815: in _get_open_params 1242s zarr_root_group = zarr.open_group(store, **open_kwargs) 1242s /usr/lib/python3/dist-packages/zarr/api/synchronous.py:540: in open_group 1242s sync( 1242s /usr/lib/python3/dist-packages/zarr/core/sync.py:163: in sync 1242s raise return_result 1242s /usr/lib/python3/dist-packages/zarr/core/sync.py:119: in _runner 1242s return await coro 1242s /usr/lib/python3/dist-packages/zarr/api/asynchronous.py:851: in open_group 1242s store_path = await make_store_path(store, mode=mode, storage_options=storage_options, path=path) 1242s /usr/lib/python3/dist-packages/zarr/storage/_common.py:419: in make_store_path 1242s return await StorePath.open(store, path=path_normalized, mode=mode) 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s cls = 1242s store = ZipStore('zip:///tmp/pytest-of-ubuntu/pytest-1/test_to_zarr_zip_store_zarr_fo0/test.zarr.zip') 1242s path = '', mode = 'r' 1242s 1242s @classmethod 1242s async def open(cls, store: Store, path: str, mode: AccessModeLiteral | None = None) -> Self: 1242s """ 1242s Open StorePath based on the provided mode. 1242s 1242s * If the mode is None, return an opened version of the store with no changes. 1242s * If the mode is 'r+', 'w-', 'w', or 'a' and the store is read-only, raise a ValueError. 1242s * If the mode is 'r' and the store is not read-only, return a copy of the store with read_only set to True. 1242s * If the mode is 'w-' and the store is not read-only and the StorePath contains keys, raise a FileExistsError. 1242s * If the mode is 'w' and the store is not read-only, delete all keys nested within the StorePath. 1242s 1242s Parameters 1242s ---------- 1242s mode : AccessModeLiteral 1242s The mode to use when initializing the store path. 1242s 1242s The accepted values are: 1242s 1242s - ``'r'``: read only (must exist) 1242s - ``'r+'``: read/write (must exist) 1242s - ``'a'``: read/write (create if doesn't exist) 1242s - ``'w'``: read/write (overwrite if exists) 1242s - ``'w-'``: read/write (create if doesn't exist). 1242s 1242s Raises 1242s ------ 1242s FileExistsError 1242s If the mode is 'w-' and the store path already exists. 1242s ValueError 1242s If the mode is not "r" and the store is read-only, or 1242s """ 1242s 1242s # fastpath if mode is None 1242s if mode is None: 1242s return await cls._create_open_instance(store, path) 1242s 1242s if mode not in ANY_ACCESS_MODE: 1242s raise ValueError(f"Invalid mode: {mode}, expected one of {ANY_ACCESS_MODE}") 1242s 1242s if store.read_only: 1242s # Don't allow write operations on a read-only store 1242s if mode != "r": 1242s raise ValueError( 1242s f"Store is read-only but mode is {mode!r}. Create a writable store or use 'r' mode." 1242s ) 1242s self = await cls._create_open_instance(store, path) 1242s elif mode == "r": 1242s # Create read-only copy for read mode on writable store 1242s try: 1242s read_only_store = store.with_read_only(True) 1242s except NotImplementedError as e: 1242s > raise ValueError( 1242s "Store is not read-only but mode is 'r'. Unable to create a read-only copy of the store. " 1242s "Please use a read-only store or a storage class that implements .with_read_only()." 1242s ) from e 1242s E ValueError: Store is not read-only but mode is 'r'. Unable to create a read-only copy of the store. Please use a read-only store or a storage class that implements .with_read_only(). 1242s 1242s /usr/lib/python3/dist-packages/zarr/storage/_common.py:125: ValueError 1242s ___________ TestZarrDatatreeIO.test_to_zarr_zip_store[zarr_format=3] ___________ 1242s 1242s cls = 1242s store = ZipStore('zip:///tmp/pytest-of-ubuntu/pytest-1/test_to_zarr_zip_store_zarr_fo1/test.zarr.zip') 1242s path = '', mode = 'r' 1242s 1242s @classmethod 1242s async def open(cls, store: Store, path: str, mode: AccessModeLiteral | None = None) -> Self: 1242s """ 1242s Open StorePath based on the provided mode. 1242s 1242s * If the mode is None, return an opened version of the store with no changes. 1242s * If the mode is 'r+', 'w-', 'w', or 'a' and the store is read-only, raise a ValueError. 1242s * If the mode is 'r' and the store is not read-only, return a copy of the store with read_only set to True. 1242s * If the mode is 'w-' and the store is not read-only and the StorePath contains keys, raise a FileExistsError. 1242s * If the mode is 'w' and the store is not read-only, delete all keys nested within the StorePath. 1242s 1242s Parameters 1242s ---------- 1242s mode : AccessModeLiteral 1242s The mode to use when initializing the store path. 1242s 1242s The accepted values are: 1242s 1242s - ``'r'``: read only (must exist) 1242s - ``'r+'``: read/write (must exist) 1242s - ``'a'``: read/write (create if doesn't exist) 1242s - ``'w'``: read/write (overwrite if exists) 1242s - ``'w-'``: read/write (create if doesn't exist). 1242s 1242s Raises 1242s ------ 1242s FileExistsError 1242s If the mode is 'w-' and the store path already exists. 1242s ValueError 1242s If the mode is not "r" and the store is read-only, or 1242s """ 1242s 1242s # fastpath if mode is None 1242s if mode is None: 1242s return await cls._create_open_instance(store, path) 1242s 1242s if mode not in ANY_ACCESS_MODE: 1242s raise ValueError(f"Invalid mode: {mode}, expected one of {ANY_ACCESS_MODE}") 1242s 1242s if store.read_only: 1242s # Don't allow write operations on a read-only store 1242s if mode != "r": 1242s raise ValueError( 1242s f"Store is read-only but mode is {mode!r}. Create a writable store or use 'r' mode." 1242s ) 1242s self = await cls._create_open_instance(store, path) 1242s elif mode == "r": 1242s # Create read-only copy for read mode on writable store 1242s try: 1242s > read_only_store = store.with_read_only(True) 1242s 1242s /usr/lib/python3/dist-packages/zarr/storage/_common.py:123: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s self = ZipStore('zip:///tmp/pytest-of-ubuntu/pytest-1/test_to_zarr_zip_store_zarr_fo1/test.zarr.zip') 1242s read_only = True 1242s 1242s def with_read_only(self, read_only: bool = False) -> Store: 1242s """ 1242s Return a new store with a new read_only setting. 1242s 1242s The new store points to the same location with the specified new read_only state. 1242s The returned Store is not automatically opened, and this store is 1242s not automatically closed. 1242s 1242s Parameters 1242s ---------- 1242s read_only 1242s If True, the store will be created in read-only mode. Defaults to False. 1242s 1242s Returns 1242s ------- 1242s A new store of the same type with the new read only attribute. 1242s """ 1242s > raise NotImplementedError( 1242s f"with_read_only is not implemented for the {type(self)} store type." 1242s ) 1242s E NotImplementedError: with_read_only is not implemented for the store type. 1242s 1242s /usr/lib/python3/dist-packages/zarr/abc/store.py:98: NotImplementedError 1242s 1242s The above exception was the direct cause of the following exception: 1242s 1242s self = 1242s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-1/test_to_zarr_zip_store_zarr_fo1') 1242s simple_datatree = 1242s Group: / 1242s │ Dimensions: (y: 3, x: 2) 1242s │ Dimensions without coordinates: y, x 1242s │ Data variables: 1242s ... a (x) int64 16B 2 3 1242s │ │ b (x) float64 16B 0.1 0.2 1242s │ └── Group: /set2/set1 1242s └── Group: /set3 1242s zarr_format = 3 1242s 1242s def test_to_zarr_zip_store(self, tmpdir, simple_datatree, zarr_format): 1242s from zarr.storage import ZipStore 1242s 1242s filepath = str(tmpdir / "test.zarr.zip") 1242s original_dt = simple_datatree 1242s store = ZipStore(filepath, mode="w") 1242s original_dt.to_zarr(store, zarr_format=zarr_format) 1242s 1242s > with open_datatree(store, engine="zarr") as roundtrip_dt: # type: ignore[arg-type, unused-ignore] 1242s 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends_datatree.py:500: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:1132: in open_datatree 1242s backend_tree = backend.open_datatree( 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1658: in open_datatree 1242s groups_dict = self.open_groups_as_dict( 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1707: in open_groups_as_dict 1242s stores = ZarrStore.open_store( 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:665: in open_store 1242s ) = _get_open_params( 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1815: in _get_open_params 1242s zarr_root_group = zarr.open_group(store, **open_kwargs) 1242s /usr/lib/python3/dist-packages/zarr/api/synchronous.py:540: in open_group 1242s sync( 1242s /usr/lib/python3/dist-packages/zarr/core/sync.py:163: in sync 1242s raise return_result 1242s /usr/lib/python3/dist-packages/zarr/core/sync.py:119: in _runner 1242s return await coro 1242s /usr/lib/python3/dist-packages/zarr/api/asynchronous.py:851: in open_group 1242s store_path = await make_store_path(store, mode=mode, storage_options=storage_options, path=path) 1242s /usr/lib/python3/dist-packages/zarr/storage/_common.py:419: in make_store_path 1242s return await StorePath.open(store, path=path_normalized, mode=mode) 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s cls = 1242s store = ZipStore('zip:///tmp/pytest-of-ubuntu/pytest-1/test_to_zarr_zip_store_zarr_fo1/test.zarr.zip') 1242s path = '', mode = 'r' 1242s 1242s @classmethod 1242s async def open(cls, store: Store, path: str, mode: AccessModeLiteral | None = None) -> Self: 1242s """ 1242s Open StorePath based on the provided mode. 1242s 1242s * If the mode is None, return an opened version of the store with no changes. 1242s * If the mode is 'r+', 'w-', 'w', or 'a' and the store is read-only, raise a ValueError. 1242s * If the mode is 'r' and the store is not read-only, return a copy of the store with read_only set to True. 1242s * If the mode is 'w-' and the store is not read-only and the StorePath contains keys, raise a FileExistsError. 1242s * If the mode is 'w' and the store is not read-only, delete all keys nested within the StorePath. 1242s 1242s Parameters 1242s ---------- 1242s mode : AccessModeLiteral 1242s The mode to use when initializing the store path. 1242s 1242s The accepted values are: 1242s 1242s - ``'r'``: read only (must exist) 1242s - ``'r+'``: read/write (must exist) 1242s - ``'a'``: read/write (create if doesn't exist) 1242s - ``'w'``: read/write (overwrite if exists) 1242s - ``'w-'``: read/write (create if doesn't exist). 1242s 1242s Raises 1242s ------ 1242s FileExistsError 1242s If the mode is 'w-' and the store path already exists. 1242s ValueError 1242s If the mode is not "r" and the store is read-only, or 1242s """ 1242s 1242s # fastpath if mode is None 1242s if mode is None: 1242s return await cls._create_open_instance(store, path) 1242s 1242s if mode not in ANY_ACCESS_MODE: 1242s raise ValueError(f"Invalid mode: {mode}, expected one of {ANY_ACCESS_MODE}") 1242s 1242s if store.read_only: 1242s # Don't allow write operations on a read-only store 1242s if mode != "r": 1242s raise ValueError( 1242s f"Store is read-only but mode is {mode!r}. Create a writable store or use 'r' mode." 1242s ) 1242s self = await cls._create_open_instance(store, path) 1242s elif mode == "r": 1242s # Create read-only copy for read mode on writable store 1242s try: 1242s read_only_store = store.with_read_only(True) 1242s except NotImplementedError as e: 1242s > raise ValueError( 1242s "Store is not read-only but mode is 'r'. Unable to create a read-only copy of the store. " 1242s "Please use a read-only store or a storage class that implements .with_read_only()." 1242s ) from e 1242s E ValueError: Store is not read-only but mode is 'r'. Unable to create a read-only copy of the store. Please use a read-only store or a storage class that implements .with_read_only(). 1242s 1242s /usr/lib/python3/dist-packages/zarr/storage/_common.py:125: ValueError 1242s _______ TestZarrDatatreeIO.test_to_zarr_not_consolidated[zarr_format=3] ________ 1242s 1242s self = 1242s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-1/test_to_zarr_not_consolidated_1') 1242s simple_datatree = 1242s Group: / 1242s │ Dimensions: (y: 3, x: 2) 1242s │ Dimensions without coordinates: y, x 1242s │ Data variables: 1242s ... a (x) int64 16B 2 3 1242s │ │ b (x) float64 16B 0.1 0.2 1242s │ └── Group: /set2/set1 1242s └── Group: /set3 1242s zarr_format = 3 1242s 1242s def test_to_zarr_not_consolidated(self, tmpdir, simple_datatree, zarr_format): 1242s filepath = tmpdir / "test.zarr" 1242s zmetadata = filepath / ".zmetadata" 1242s s1zmetadata = filepath / "set1" / ".zmetadata" 1242s filepath = str(filepath) # casting to str avoids a pathlib bug in xarray 1242s original_dt = simple_datatree 1242s original_dt.to_zarr(filepath, consolidated=False, zarr_format=zarr_format) 1242s assert not zmetadata.exists() 1242s assert not s1zmetadata.exists() 1242s 1242s with pytest.warns(RuntimeWarning, match="consolidated"): 1242s > with open_datatree(filepath, engine="zarr") as roundtrip_dt: 1242s 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends_datatree.py:514: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:1132: in open_datatree 1242s backend_tree = backend.open_datatree( 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1658: in open_datatree 1242s groups_dict = self.open_groups_as_dict( 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1725: in open_groups_as_dict 1242s group_ds = store_entrypoint.open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1242s vars, attrs = filename_or_obj.load() 1242s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1242s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1242s return Frozen(dict(*args, **kwargs)) 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s self = , name = 'b' 1242s 1242s def open_store_variable(self, name): 1242s zarr_array = self.members[name] 1242s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1242s try_nczarr = self._mode == "r" 1242s dimensions, attributes = _get_zarr_dims_and_attrs( 1242s zarr_array, DIMENSION_KEY, try_nczarr 1242s ) 1242s attributes = dict(attributes) 1242s 1242s encoding = { 1242s "chunks": zarr_array.chunks, 1242s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1242s } 1242s 1242s if _zarr_v3(): 1242s encoding.update( 1242s { 1242s "compressors": zarr_array.compressors, 1242s "filters": zarr_array.filters, 1242s "shards": zarr_array.shards, 1242s } 1242s ) 1242s if self.zarr_group.metadata.zarr_format == 3: 1242s encoding.update({"serializer": zarr_array.serializer}) 1242s else: 1242s encoding.update( 1242s { 1242s "compressor": zarr_array.compressor, 1242s "filters": zarr_array.filters, 1242s } 1242s ) 1242s 1242s if self._use_zarr_fill_value_as_mask: 1242s # Setting this attribute triggers CF decoding for missing values 1242s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1242s if zarr_array.fill_value is not None: 1242s attributes["_FillValue"] = zarr_array.fill_value 1242s elif "_FillValue" in attributes: 1242s original_zarr_dtype = zarr_array.metadata.data_type 1242s attributes["_FillValue"] = FillValueCoder.decode( 1242s > attributes["_FillValue"], original_zarr_dtype.value 1242s ) 1242s E AttributeError: 'Float64' object has no attribute 'value' 1242s 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1242s ________ TestZarrDatatreeIO.test_open_groups_round_trip[zarr_format=3] _________ 1242s 1242s self = 1242s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-1/test_open_groups_round_trip_za1') 1242s simple_datatree = 1242s Group: / 1242s │ Dimensions: (y: 3, x: 2) 1242s │ Dimensions without coordinates: y, x 1242s │ Data variables: 1242s ... a (x) int64 16B 2 3 1242s │ │ b (x) float64 16B 0.1 0.2 1242s │ └── Group: /set2/set1 1242s └── Group: /set3 1242s zarr_format = 3 1242s 1242s def test_open_groups_round_trip(self, tmpdir, simple_datatree, zarr_format) -> None: 1242s """Test `open_groups` opens a zarr store with the `simple_datatree` structure.""" 1242s filepath = str(tmpdir / "test.zarr") 1242s original_dt = simple_datatree 1242s original_dt.to_zarr(filepath, zarr_format=zarr_format) 1242s 1242s > roundtrip_dict = open_groups(filepath, engine="zarr") 1242s 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends_datatree.py:631: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:1364: in open_groups 1242s backend_groups = backend.open_groups_as_dict( 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1725: in open_groups_as_dict 1242s group_ds = store_entrypoint.open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1242s vars, attrs = filename_or_obj.load() 1242s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1242s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1242s return Frozen(dict(*args, **kwargs)) 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s self = , name = 'b' 1242s 1242s def open_store_variable(self, name): 1242s zarr_array = self.members[name] 1242s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1242s try_nczarr = self._mode == "r" 1242s dimensions, attributes = _get_zarr_dims_and_attrs( 1242s zarr_array, DIMENSION_KEY, try_nczarr 1242s ) 1242s attributes = dict(attributes) 1242s 1242s encoding = { 1242s "chunks": zarr_array.chunks, 1242s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1242s } 1242s 1242s if _zarr_v3(): 1242s encoding.update( 1242s { 1242s "compressors": zarr_array.compressors, 1242s "filters": zarr_array.filters, 1242s "shards": zarr_array.shards, 1242s } 1242s ) 1242s if self.zarr_group.metadata.zarr_format == 3: 1242s encoding.update({"serializer": zarr_array.serializer}) 1242s else: 1242s encoding.update( 1242s { 1242s "compressor": zarr_array.compressor, 1242s "filters": zarr_array.filters, 1242s } 1242s ) 1242s 1242s if self._use_zarr_fill_value_as_mask: 1242s # Setting this attribute triggers CF decoding for missing values 1242s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1242s if zarr_array.fill_value is not None: 1242s attributes["_FillValue"] = zarr_array.fill_value 1242s elif "_FillValue" in attributes: 1242s original_zarr_dtype = zarr_array.metadata.data_type 1242s attributes["_FillValue"] = FillValueCoder.decode( 1242s > attributes["_FillValue"], original_zarr_dtype.value 1242s ) 1242s E AttributeError: 'Float64' object has no attribute 'value' 1242s 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1242s _____________ TestZarrDatatreeIO.test_open_datatree[zarr_format=3] _____________ 1242s 1242s self = 1242s unaligned_datatree_zarr_factory = ._unaligned_datatree_zarr at 0x7bec1c3c2200> 1242s zarr_format = 3 1242s 1242s @pytest.mark.filterwarnings( 1242s "ignore:Failed to open Zarr store with consolidated metadata:RuntimeWarning" 1242s ) 1242s def test_open_datatree(self, unaligned_datatree_zarr_factory, zarr_format) -> None: 1242s """Test if `open_datatree` fails to open a zarr store with an unaligned group hierarchy.""" 1242s storepath = unaligned_datatree_zarr_factory(zarr_format=zarr_format) 1242s 1242s with pytest.raises( 1242s ValueError, 1242s match=( 1242s re.escape("group '/Group2' is not aligned with its parents:") + ".*" 1242s ), 1242s ): 1242s > open_datatree(storepath, engine="zarr") 1242s 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends_datatree.py:653: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:1132: in open_datatree 1242s backend_tree = backend.open_datatree( 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1658: in open_datatree 1242s groups_dict = self.open_groups_as_dict( 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1725: in open_groups_as_dict 1242s group_ds = store_entrypoint.open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1242s vars, attrs = filename_or_obj.load() 1242s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1242s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1242s return Frozen(dict(*args, **kwargs)) 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s self = , name = 'b' 1242s 1242s def open_store_variable(self, name): 1242s zarr_array = self.members[name] 1242s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1242s try_nczarr = self._mode == "r" 1242s dimensions, attributes = _get_zarr_dims_and_attrs( 1242s zarr_array, DIMENSION_KEY, try_nczarr 1242s ) 1242s attributes = dict(attributes) 1242s 1242s encoding = { 1242s "chunks": zarr_array.chunks, 1242s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1242s } 1242s 1242s if _zarr_v3(): 1242s encoding.update( 1242s { 1242s "compressors": zarr_array.compressors, 1242s "filters": zarr_array.filters, 1242s "shards": zarr_array.shards, 1242s } 1242s ) 1242s if self.zarr_group.metadata.zarr_format == 3: 1242s encoding.update({"serializer": zarr_array.serializer}) 1242s else: 1242s encoding.update( 1242s { 1242s "compressor": zarr_array.compressor, 1242s "filters": zarr_array.filters, 1242s } 1242s ) 1242s 1242s if self._use_zarr_fill_value_as_mask: 1242s # Setting this attribute triggers CF decoding for missing values 1242s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1242s if zarr_array.fill_value is not None: 1242s attributes["_FillValue"] = zarr_array.fill_value 1242s elif "_FillValue" in attributes: 1242s original_zarr_dtype = zarr_array.metadata.data_type 1242s attributes["_FillValue"] = FillValueCoder.decode( 1242s > attributes["_FillValue"], original_zarr_dtype.value 1242s ) 1242s E AttributeError: 'Float64' object has no attribute 'value' 1242s 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1242s _________ TestZarrDatatreeIO.test_open_datatree_chunks[zarr_format=3] __________ 1242s 1242s self = 1242s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-1/test_open_datatree_chunks_zarr1') 1242s zarr_format = 3 1242s 1242s @requires_dask 1242s def test_open_datatree_chunks(self, tmpdir, zarr_format) -> None: 1242s filepath = str(tmpdir / "test.zarr") 1242s 1242s chunks = {"x": 2, "y": 1} 1242s 1242s root_data = xr.Dataset({"a": ("y", [6, 7, 8]), "set0": ("x", [9, 10])}) 1242s set1_data = xr.Dataset({"a": ("y", [-1, 0, 1]), "b": ("x", [-10, 6])}) 1242s set2_data = xr.Dataset({"a": ("y", [1, 2, 3]), "b": ("x", [0.1, 0.2])}) 1242s original_tree = DataTree.from_dict( 1242s { 1242s "/": root_data.chunk(chunks), 1242s "/group1": set1_data.chunk(chunks), 1242s "/group2": set2_data.chunk(chunks), 1242s } 1242s ) 1242s original_tree.to_zarr(filepath, zarr_format=zarr_format) 1242s 1242s > with open_datatree(filepath, engine="zarr", chunks=chunks) as tree: 1242s 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends_datatree.py:673: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:1132: in open_datatree 1242s backend_tree = backend.open_datatree( 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1658: in open_datatree 1242s groups_dict = self.open_groups_as_dict( 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1725: in open_groups_as_dict 1242s group_ds = store_entrypoint.open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1242s vars, attrs = filename_or_obj.load() 1242s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1242s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1242s return Frozen(dict(*args, **kwargs)) 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s self = , name = 'b' 1242s 1242s def open_store_variable(self, name): 1242s zarr_array = self.members[name] 1242s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1242s try_nczarr = self._mode == "r" 1242s dimensions, attributes = _get_zarr_dims_and_attrs( 1242s zarr_array, DIMENSION_KEY, try_nczarr 1242s ) 1242s attributes = dict(attributes) 1242s 1242s encoding = { 1242s "chunks": zarr_array.chunks, 1242s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1242s } 1242s 1242s if _zarr_v3(): 1242s encoding.update( 1242s { 1242s "compressors": zarr_array.compressors, 1242s "filters": zarr_array.filters, 1242s "shards": zarr_array.shards, 1242s } 1242s ) 1242s if self.zarr_group.metadata.zarr_format == 3: 1242s encoding.update({"serializer": zarr_array.serializer}) 1242s else: 1242s encoding.update( 1242s { 1242s "compressor": zarr_array.compressor, 1242s "filters": zarr_array.filters, 1242s } 1242s ) 1242s 1242s if self._use_zarr_fill_value_as_mask: 1242s # Setting this attribute triggers CF decoding for missing values 1242s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1242s if zarr_array.fill_value is not None: 1242s attributes["_FillValue"] = zarr_array.fill_value 1242s elif "_FillValue" in attributes: 1242s original_zarr_dtype = zarr_array.metadata.data_type 1242s attributes["_FillValue"] = FillValueCoder.decode( 1242s > attributes["_FillValue"], original_zarr_dtype.value 1242s ) 1242s E AttributeError: 'Float64' object has no attribute 'value' 1242s 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1242s ______________ TestZarrDatatreeIO.test_open_groups[zarr_format=3] ______________ 1242s 1242s self = 1242s unaligned_datatree_zarr_factory = ._unaligned_datatree_zarr at 0x7bec1c3c2200> 1242s zarr_format = 3 1242s 1242s @pytest.mark.filterwarnings( 1242s "ignore:Failed to open Zarr store with consolidated metadata:RuntimeWarning" 1242s ) 1242s def test_open_groups(self, unaligned_datatree_zarr_factory, zarr_format) -> None: 1242s """Test `open_groups` with a zarr store of an unaligned group hierarchy.""" 1242s 1242s storepath = unaligned_datatree_zarr_factory(zarr_format=zarr_format) 1242s > unaligned_dict_of_datasets = open_groups(storepath, engine="zarr") 1242s 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends_datatree.py:689: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:1364: in open_groups 1242s backend_groups = backend.open_groups_as_dict( 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1725: in open_groups_as_dict 1242s group_ds = store_entrypoint.open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1242s vars, attrs = filename_or_obj.load() 1242s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1242s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1242s return Frozen(dict(*args, **kwargs)) 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s self = , name = 'b' 1242s 1242s def open_store_variable(self, name): 1242s zarr_array = self.members[name] 1242s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1242s try_nczarr = self._mode == "r" 1242s dimensions, attributes = _get_zarr_dims_and_attrs( 1242s zarr_array, DIMENSION_KEY, try_nczarr 1242s ) 1242s attributes = dict(attributes) 1242s 1242s encoding = { 1242s "chunks": zarr_array.chunks, 1242s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1242s } 1242s 1242s if _zarr_v3(): 1242s encoding.update( 1242s { 1242s "compressors": zarr_array.compressors, 1242s "filters": zarr_array.filters, 1242s "shards": zarr_array.shards, 1242s } 1242s ) 1242s if self.zarr_group.metadata.zarr_format == 3: 1242s encoding.update({"serializer": zarr_array.serializer}) 1242s else: 1242s encoding.update( 1242s { 1242s "compressor": zarr_array.compressor, 1242s "filters": zarr_array.filters, 1242s } 1242s ) 1242s 1242s if self._use_zarr_fill_value_as_mask: 1242s # Setting this attribute triggers CF decoding for missing values 1242s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1242s if zarr_array.fill_value is not None: 1242s attributes["_FillValue"] = zarr_array.fill_value 1242s elif "_FillValue" in attributes: 1242s original_zarr_dtype = zarr_array.metadata.data_type 1242s attributes["_FillValue"] = FillValueCoder.decode( 1242s > attributes["_FillValue"], original_zarr_dtype.value 1242s ) 1242s E AttributeError: 'Float64' object has no attribute 'value' 1242s 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1242s ___ TestZarrDatatreeIO.test_open_datatree_specific_group[True-zarr_format=3] ___ 1242s 1242s self = 1242s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-1/test_open_datatree_specific_gr2') 1242s simple_datatree = 1242s Group: / 1242s │ Dimensions: (y: 3, x: 2) 1242s │ Dimensions without coordinates: y, x 1242s │ Data variables: 1242s ... a (x) int64 16B 2 3 1242s │ │ b (x) float64 16B 0.1 0.2 1242s │ └── Group: /set2/set1 1242s └── Group: /set3 1242s write_consolidated_metadata = True, zarr_format = 3 1242s 1242s @pytest.mark.filterwarnings( 1242s "ignore:Failed to open Zarr store with consolidated metadata:RuntimeWarning" 1242s ) 1242s @pytest.mark.parametrize("write_consolidated_metadata", [True, False, None]) 1242s def test_open_datatree_specific_group( 1242s self, 1242s tmpdir, 1242s simple_datatree, 1242s write_consolidated_metadata, 1242s zarr_format, 1242s ) -> None: 1242s """Test opening a specific group within a Zarr store using `open_datatree`.""" 1242s filepath = str(tmpdir / "test.zarr") 1242s group = "/set2" 1242s original_dt = simple_datatree 1242s original_dt.to_zarr( 1242s filepath, consolidated=write_consolidated_metadata, zarr_format=zarr_format 1242s ) 1242s expected_subtree = original_dt[group].copy() 1242s expected_subtree.orphan() 1242s > with open_datatree(filepath, group=group, engine=self.engine) as subgroup_tree: 1242s 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends_datatree.py:730: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:1132: in open_datatree 1242s backend_tree = backend.open_datatree( 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1658: in open_datatree 1242s groups_dict = self.open_groups_as_dict( 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1725: in open_groups_as_dict 1242s group_ds = store_entrypoint.open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1242s vars, attrs = filename_or_obj.load() 1242s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1242s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1242s return Frozen(dict(*args, **kwargs)) 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s self = , name = 'b' 1242s 1242s def open_store_variable(self, name): 1242s zarr_array = self.members[name] 1242s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1242s try_nczarr = self._mode == "r" 1242s dimensions, attributes = _get_zarr_dims_and_attrs( 1242s zarr_array, DIMENSION_KEY, try_nczarr 1242s ) 1242s attributes = dict(attributes) 1242s 1242s encoding = { 1242s "chunks": zarr_array.chunks, 1242s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1242s } 1242s 1242s if _zarr_v3(): 1242s encoding.update( 1242s { 1242s "compressors": zarr_array.compressors, 1242s "filters": zarr_array.filters, 1242s "shards": zarr_array.shards, 1242s } 1242s ) 1242s if self.zarr_group.metadata.zarr_format == 3: 1242s encoding.update({"serializer": zarr_array.serializer}) 1242s else: 1242s encoding.update( 1242s { 1242s "compressor": zarr_array.compressor, 1242s "filters": zarr_array.filters, 1242s } 1242s ) 1242s 1242s if self._use_zarr_fill_value_as_mask: 1242s # Setting this attribute triggers CF decoding for missing values 1242s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1242s if zarr_array.fill_value is not None: 1242s attributes["_FillValue"] = zarr_array.fill_value 1242s elif "_FillValue" in attributes: 1242s original_zarr_dtype = zarr_array.metadata.data_type 1242s attributes["_FillValue"] = FillValueCoder.decode( 1242s > attributes["_FillValue"], original_zarr_dtype.value 1242s ) 1242s E AttributeError: 'Float64' object has no attribute 'value' 1242s 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1242s __ TestZarrDatatreeIO.test_open_datatree_specific_group[False-zarr_format=3] ___ 1242s 1242s self = 1242s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-1/test_open_datatree_specific_gr4') 1242s simple_datatree = 1242s Group: / 1242s │ Dimensions: (y: 3, x: 2) 1242s │ Dimensions without coordinates: y, x 1242s │ Data variables: 1242s ... a (x) int64 16B 2 3 1242s │ │ b (x) float64 16B 0.1 0.2 1242s │ └── Group: /set2/set1 1242s └── Group: /set3 1242s write_consolidated_metadata = False, zarr_format = 3 1242s 1242s @pytest.mark.filterwarnings( 1242s "ignore:Failed to open Zarr store with consolidated metadata:RuntimeWarning" 1242s ) 1242s @pytest.mark.parametrize("write_consolidated_metadata", [True, False, None]) 1242s def test_open_datatree_specific_group( 1242s self, 1242s tmpdir, 1242s simple_datatree, 1242s write_consolidated_metadata, 1242s zarr_format, 1242s ) -> None: 1242s """Test opening a specific group within a Zarr store using `open_datatree`.""" 1242s filepath = str(tmpdir / "test.zarr") 1242s group = "/set2" 1242s original_dt = simple_datatree 1242s original_dt.to_zarr( 1242s filepath, consolidated=write_consolidated_metadata, zarr_format=zarr_format 1242s ) 1242s expected_subtree = original_dt[group].copy() 1242s expected_subtree.orphan() 1242s > with open_datatree(filepath, group=group, engine=self.engine) as subgroup_tree: 1242s 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends_datatree.py:730: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:1132: in open_datatree 1242s backend_tree = backend.open_datatree( 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1658: in open_datatree 1242s groups_dict = self.open_groups_as_dict( 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1725: in open_groups_as_dict 1242s group_ds = store_entrypoint.open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1242s vars, attrs = filename_or_obj.load() 1242s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1242s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1242s return Frozen(dict(*args, **kwargs)) 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s self = , name = 'b' 1242s 1242s def open_store_variable(self, name): 1242s zarr_array = self.members[name] 1242s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1242s try_nczarr = self._mode == "r" 1242s dimensions, attributes = _get_zarr_dims_and_attrs( 1242s zarr_array, DIMENSION_KEY, try_nczarr 1242s ) 1242s attributes = dict(attributes) 1242s 1242s encoding = { 1242s "chunks": zarr_array.chunks, 1242s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1242s } 1242s 1242s if _zarr_v3(): 1242s encoding.update( 1242s { 1242s "compressors": zarr_array.compressors, 1242s "filters": zarr_array.filters, 1242s "shards": zarr_array.shards, 1242s } 1242s ) 1242s if self.zarr_group.metadata.zarr_format == 3: 1242s encoding.update({"serializer": zarr_array.serializer}) 1242s else: 1242s encoding.update( 1242s { 1242s "compressor": zarr_array.compressor, 1242s "filters": zarr_array.filters, 1242s } 1242s ) 1242s 1242s if self._use_zarr_fill_value_as_mask: 1242s # Setting this attribute triggers CF decoding for missing values 1242s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1242s if zarr_array.fill_value is not None: 1242s attributes["_FillValue"] = zarr_array.fill_value 1242s elif "_FillValue" in attributes: 1242s original_zarr_dtype = zarr_array.metadata.data_type 1242s attributes["_FillValue"] = FillValueCoder.decode( 1242s > attributes["_FillValue"], original_zarr_dtype.value 1242s ) 1242s E AttributeError: 'Float64' object has no attribute 'value' 1242s 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1242s ___ TestZarrDatatreeIO.test_open_datatree_specific_group[None-zarr_format=3] ___ 1242s 1242s self = 1242s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-1/test_open_datatree_specific_gr6') 1242s simple_datatree = 1242s Group: / 1242s │ Dimensions: (y: 3, x: 2) 1242s │ Dimensions without coordinates: y, x 1242s │ Data variables: 1242s ... a (x) int64 16B 2 3 1242s │ │ b (x) float64 16B 0.1 0.2 1242s │ └── Group: /set2/set1 1242s └── Group: /set3 1242s write_consolidated_metadata = None, zarr_format = 3 1242s 1242s @pytest.mark.filterwarnings( 1242s "ignore:Failed to open Zarr store with consolidated metadata:RuntimeWarning" 1242s ) 1242s @pytest.mark.parametrize("write_consolidated_metadata", [True, False, None]) 1242s def test_open_datatree_specific_group( 1242s self, 1242s tmpdir, 1242s simple_datatree, 1242s write_consolidated_metadata, 1242s zarr_format, 1242s ) -> None: 1242s """Test opening a specific group within a Zarr store using `open_datatree`.""" 1242s filepath = str(tmpdir / "test.zarr") 1242s group = "/set2" 1242s original_dt = simple_datatree 1242s original_dt.to_zarr( 1242s filepath, consolidated=write_consolidated_metadata, zarr_format=zarr_format 1242s ) 1242s expected_subtree = original_dt[group].copy() 1242s expected_subtree.orphan() 1242s > with open_datatree(filepath, group=group, engine=self.engine) as subgroup_tree: 1242s 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends_datatree.py:730: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:1132: in open_datatree 1242s backend_tree = backend.open_datatree( 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1658: in open_datatree 1242s groups_dict = self.open_groups_as_dict( 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1725: in open_groups_as_dict 1242s group_ds = store_entrypoint.open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1242s vars, attrs = filename_or_obj.load() 1242s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1242s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1242s return Frozen(dict(*args, **kwargs)) 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s self = , name = 'b' 1242s 1242s def open_store_variable(self, name): 1242s zarr_array = self.members[name] 1242s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1242s try_nczarr = self._mode == "r" 1242s dimensions, attributes = _get_zarr_dims_and_attrs( 1242s zarr_array, DIMENSION_KEY, try_nczarr 1242s ) 1242s attributes = dict(attributes) 1242s 1242s encoding = { 1242s "chunks": zarr_array.chunks, 1242s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1242s } 1242s 1242s if _zarr_v3(): 1242s encoding.update( 1242s { 1242s "compressors": zarr_array.compressors, 1242s "filters": zarr_array.filters, 1242s "shards": zarr_array.shards, 1242s } 1242s ) 1242s if self.zarr_group.metadata.zarr_format == 3: 1242s encoding.update({"serializer": zarr_array.serializer}) 1242s else: 1242s encoding.update( 1242s { 1242s "compressor": zarr_array.compressor, 1242s "filters": zarr_array.filters, 1242s } 1242s ) 1242s 1242s if self._use_zarr_fill_value_as_mask: 1242s # Setting this attribute triggers CF decoding for missing values 1242s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1242s if zarr_array.fill_value is not None: 1242s attributes["_FillValue"] = zarr_array.fill_value 1242s elif "_FillValue" in attributes: 1242s original_zarr_dtype = zarr_array.metadata.data_type 1242s attributes["_FillValue"] = FillValueCoder.decode( 1242s > attributes["_FillValue"], original_zarr_dtype.value 1242s ) 1242s E AttributeError: 'Float64' object has no attribute 'value' 1242s 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1242s __________ TestZarrDatatreeIO.test_open_groups_chunks[zarr_format=3] ___________ 1242s 1242s self = 1242s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-1/test_open_groups_chunks_zarr_f1') 1242s zarr_format = 3 1242s 1242s @requires_dask 1242s def test_open_groups_chunks(self, tmpdir, zarr_format) -> None: 1242s """Test `open_groups` with chunks on a zarr store.""" 1242s 1242s chunks = {"x": 2, "y": 1} 1242s filepath = str(tmpdir / "test.zarr") 1242s root_data = xr.Dataset({"a": ("y", [6, 7, 8]), "set0": ("x", [9, 10])}) 1242s set1_data = xr.Dataset({"a": ("y", [-1, 0, 1]), "b": ("x", [-10, 6])}) 1242s set2_data = xr.Dataset({"a": ("y", [1, 2, 3]), "b": ("x", [0.1, 0.2])}) 1242s original_tree = DataTree.from_dict( 1242s { 1242s "/": root_data.chunk(chunks), 1242s "/group1": set1_data.chunk(chunks), 1242s "/group2": set2_data.chunk(chunks), 1242s } 1242s ) 1242s original_tree.to_zarr(filepath, mode="w", zarr_format=zarr_format) 1242s 1242s > dict_of_datasets = open_groups(filepath, engine="zarr", chunks=chunks) 1242s 1242s /usr/lib/python3/dist-packages/xarray/tests/test_backends_datatree.py:752: 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s /usr/lib/python3/dist-packages/xarray/backends/api.py:1364: in open_groups 1242s backend_groups = backend.open_groups_as_dict( 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:1725: in open_groups_as_dict 1242s group_ds = store_entrypoint.open_dataset( 1242s /usr/lib/python3/dist-packages/xarray/backends/store.py:44: in open_dataset 1242s vars, attrs = filename_or_obj.load() 1242s /usr/lib/python3/dist-packages/xarray/backends/common.py:312: in load 1242s (_decode_variable_name(k), v) for k, v in self.get_variables().items() 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in get_variables 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s /usr/lib/python3/dist-packages/xarray/core/utils.py:457: in FrozenDict 1242s return Frozen(dict(*args, **kwargs)) 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:888: in 1242s return FrozenDict((k, self.open_store_variable(k)) for k in self.array_keys()) 1242s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1242s 1242s self = , name = 'b' 1242s 1242s def open_store_variable(self, name): 1242s zarr_array = self.members[name] 1242s data = indexing.LazilyIndexedArray(ZarrArrayWrapper(zarr_array)) 1242s try_nczarr = self._mode == "r" 1242s dimensions, attributes = _get_zarr_dims_and_attrs( 1242s zarr_array, DIMENSION_KEY, try_nczarr 1242s ) 1242s attributes = dict(attributes) 1242s 1242s encoding = { 1242s "chunks": zarr_array.chunks, 1242s "preferred_chunks": dict(zip(dimensions, zarr_array.chunks, strict=True)), 1242s } 1242s 1242s if _zarr_v3(): 1242s encoding.update( 1242s { 1242s "compressors": zarr_array.compressors, 1242s "filters": zarr_array.filters, 1242s "shards": zarr_array.shards, 1242s } 1242s ) 1242s if self.zarr_group.metadata.zarr_format == 3: 1242s encoding.update({"serializer": zarr_array.serializer}) 1242s else: 1242s encoding.update( 1242s { 1242s "compressor": zarr_array.compressor, 1242s "filters": zarr_array.filters, 1242s } 1242s ) 1242s 1242s if self._use_zarr_fill_value_as_mask: 1242s # Setting this attribute triggers CF decoding for missing values 1242s # by interpreting Zarr's fill_value to mean the same as netCDF's _FillValue 1242s if zarr_array.fill_value is not None: 1242s attributes["_FillValue"] = zarr_array.fill_value 1242s elif "_FillValue" in attributes: 1242s original_zarr_dtype = zarr_array.metadata.data_type 1242s attributes["_FillValue"] = FillValueCoder.decode( 1242s > attributes["_FillValue"], original_zarr_dtype.value 1242s ) 1242s E AttributeError: 'Float64' object has no attribute 'value' 1242s 1242s /usr/lib/python3/dist-packages/xarray/backends/zarr.py:882: AttributeError 1242s =============================== warnings summary =============================== 1242s tests/test_backends.py: 540 warnings 1242s tests/test_backends_datatree.py: 15 warnings 1242s /usr/lib/python3/dist-packages/zarr/api/asynchronous.py:244: ZarrUserWarning: Consolidated metadata is currently not part in the Zarr format 3 specification. It may not be supported by other zarr implementations and may change in the future. 1242s warnings.warn( 1242s 1242s tests/test_backends.py::TestZarrDictStore::test_zero_dimensional_variable[3] 1242s tests/test_backends.py::TestZarrDirectoryStore::test_zero_dimensional_variable[3] 1242s tests/test_backends.py::TestZarrWriteEmpty::test_zero_dimensional_variable[3] 1242s /usr/lib/python3/dist-packages/zarr/core/dtype/npy/string.py:248: UnstableSpecificationWarning: The data type (FixedLengthUTF32(length=6, endianness='little')) does not have a Zarr V3 specification. That means that the representation of arrays saved with this data type may change without warning in a future version of Zarr Python. Arrays stored with this data type may be unreadable by other Zarr libraries. Use this data type at your own risk! Check https://github.com/zarr-developers/zarr-extensions/tree/main/data-types for the status of data type specifications for Zarr V3. 1242s v3_unstable_dtype_warning(self) 1242s 1242s tests/test_backends.py: 117 warnings 1242s /usr/lib/python3/dist-packages/zarr/core/dtype/npy/string.py:248: UnstableSpecificationWarning: The data type (FixedLengthUTF32(length=1, endianness='little')) does not have a Zarr V3 specification. That means that the representation of arrays saved with this data type may change without warning in a future version of Zarr Python. Arrays stored with this data type may be unreadable by other Zarr libraries. Use this data type at your own risk! Check https://github.com/zarr-developers/zarr-extensions/tree/main/data-types for the status of data type specifications for Zarr V3. 1242s v3_unstable_dtype_warning(self) 1242s 1242s tests/test_backends.py::TestZarrDictStore::test_zero_dimensional_variable[3] 1242s tests/test_backends.py::TestZarrDirectoryStore::test_zero_dimensional_variable[3] 1242s tests/test_backends.py::TestZarrWriteEmpty::test_zero_dimensional_variable[3] 1242s /usr/lib/python3/dist-packages/zarr/core/dtype/npy/bytes.py:383: UnstableSpecificationWarning: The data type (NullTerminatedBytes(length=6)) does not have a Zarr V3 specification. That means that the representation of arrays saved with this data type may change without warning in a future version of Zarr Python. Arrays stored with this data type may be unreadable by other Zarr libraries. Use this data type at your own risk! Check https://github.com/zarr-developers/zarr-extensions/tree/main/data-types for the status of data type specifications for Zarr V3. 1242s v3_unstable_dtype_warning(self) 1242s 1242s tests/test_backends.py: 12 warnings 1242s /usr/lib/python3/dist-packages/zarr/core/dtype/npy/bytes.py:383: UnstableSpecificationWarning: The data type (NullTerminatedBytes(length=4)) does not have a Zarr V3 specification. That means that the representation of arrays saved with this data type may change without warning in a future version of Zarr Python. Arrays stored with this data type may be unreadable by other Zarr libraries. Use this data type at your own risk! Check https://github.com/zarr-developers/zarr-extensions/tree/main/data-types for the status of data type specifications for Zarr V3. 1242s v3_unstable_dtype_warning(self) 1242s 1242s tests/test_backends.py::TestZarrDictStore::test_roundtrip_string_data[3] 1242s tests/test_backends.py::TestZarrDirectoryStore::test_roundtrip_string_data[3] 1242s tests/test_backends.py::TestZarrWriteEmpty::test_roundtrip_string_data[3] 1242s /usr/lib/python3/dist-packages/zarr/core/dtype/npy/string.py:248: UnstableSpecificationWarning: The data type (FixedLengthUTF32(length=4, endianness='little')) does not have a Zarr V3 specification. That means that the representation of arrays saved with this data type may change without warning in a future version of Zarr Python. Arrays stored with this data type may be unreadable by other Zarr libraries. Use this data type at your own risk! Check https://github.com/zarr-developers/zarr-extensions/tree/main/data-types for the status of data type specifications for Zarr V3. 1242s v3_unstable_dtype_warning(self) 1242s 1242s tests/test_backends.py: 33 warnings 1242s /usr/lib/python3/dist-packages/zarr/core/dtype/npy/bytes.py:383: UnstableSpecificationWarning: The data type (NullTerminatedBytes(length=2)) does not have a Zarr V3 specification. That means that the representation of arrays saved with this data type may change without warning in a future version of Zarr Python. Arrays stored with this data type may be unreadable by other Zarr libraries. Use this data type at your own risk! Check https://github.com/zarr-developers/zarr-extensions/tree/main/data-types for the status of data type specifications for Zarr V3. 1242s v3_unstable_dtype_warning(self) 1242s 1242s tests/test_backends.py: 33 warnings 1242s /usr/lib/python3/dist-packages/zarr/core/dtype/npy/string.py:248: UnstableSpecificationWarning: The data type (FixedLengthUTF32(length=2, endianness='little')) does not have a Zarr V3 specification. That means that the representation of arrays saved with this data type may change without warning in a future version of Zarr Python. Arrays stored with this data type may be unreadable by other Zarr libraries. Use this data type at your own risk! Check https://github.com/zarr-developers/zarr-extensions/tree/main/data-types for the status of data type specifications for Zarr V3. 1242s v3_unstable_dtype_warning(self) 1242s 1242s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_zarr_encoding[zarr_format=3] 1242s /usr/lib/python3/dist-packages/numcodecs/zarr3.py:164: UserWarning: Numcodecs codecs are not in the Zarr version 3 specification and may not be supported by other zarr implementations. 1242s super().__init__(**codec_config) 1242s 1242s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_zarr_encoding[zarr_format=3] 1242s /usr/lib/python3/dist-packages/zarr/codecs/numcodecs/_codecs.py:139: ZarrUserWarning: Numcodecs codecs are not in the Zarr version 3 specification and may not be supported by other zarr implementations. 1242s super().__init__(**codec_config) 1242s 1242s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 1242s /usr/lib/python3.13/zipfile/__init__.py:1642: UserWarning: Duplicate name: '.zgroup' 1242s return self._open_to_write(zinfo, force_zip64=force_zip64) 1242s 1242s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 1242s /usr/lib/python3.13/zipfile/__init__.py:1642: UserWarning: Duplicate name: '.zattrs' 1242s return self._open_to_write(zinfo, force_zip64=force_zip64) 1242s 1242s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 1242s /usr/lib/python3.13/zipfile/__init__.py:1642: UserWarning: Duplicate name: 'a/.zarray' 1242s return self._open_to_write(zinfo, force_zip64=force_zip64) 1242s 1242s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 1242s /usr/lib/python3.13/zipfile/__init__.py:1642: UserWarning: Duplicate name: 'a/.zattrs' 1242s return self._open_to_write(zinfo, force_zip64=force_zip64) 1242s 1242s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 1242s /usr/lib/python3.13/zipfile/__init__.py:1642: UserWarning: Duplicate name: 'set0/.zarray' 1242s return self._open_to_write(zinfo, force_zip64=force_zip64) 1242s 1242s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 1242s /usr/lib/python3.13/zipfile/__init__.py:1642: UserWarning: Duplicate name: 'set0/.zattrs' 1242s return self._open_to_write(zinfo, force_zip64=force_zip64) 1242s 1242s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 1242s /usr/lib/python3.13/zipfile/__init__.py:1642: UserWarning: Duplicate name: 'set1/.zgroup' 1242s return self._open_to_write(zinfo, force_zip64=force_zip64) 1242s 1242s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 1242s /usr/lib/python3.13/zipfile/__init__.py:1642: UserWarning: Duplicate name: 'set1/.zattrs' 1242s return self._open_to_write(zinfo, force_zip64=force_zip64) 1242s 1242s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 1242s /usr/lib/python3.13/zipfile/__init__.py:1642: UserWarning: Duplicate name: 'set1/a/.zarray' 1242s return self._open_to_write(zinfo, force_zip64=force_zip64) 1242s 1242s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 1242s /usr/lib/python3.13/zipfile/__init__.py:1642: UserWarning: Duplicate name: 'set1/a/.zattrs' 1242s return self._open_to_write(zinfo, force_zip64=force_zip64) 1242s 1242s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 1242s /usr/lib/python3.13/zipfile/__init__.py:1642: UserWarning: Duplicate name: 'set1/b/.zarray' 1242s return self._open_to_write(zinfo, force_zip64=force_zip64) 1242s 1242s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 1242s /usr/lib/python3.13/zipfile/__init__.py:1642: UserWarning: Duplicate name: 'set1/b/.zattrs' 1242s return self._open_to_write(zinfo, force_zip64=force_zip64) 1242s 1242s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 1242s /usr/lib/python3.13/zipfile/__init__.py:1642: UserWarning: Duplicate name: 'set2/.zgroup' 1242s return self._open_to_write(zinfo, force_zip64=force_zip64) 1242s 1242s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 1242s /usr/lib/python3.13/zipfile/__init__.py:1642: UserWarning: Duplicate name: 'set2/.zattrs' 1242s return self._open_to_write(zinfo, force_zip64=force_zip64) 1242s 1242s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 1242s /usr/lib/python3.13/zipfile/__init__.py:1642: UserWarning: Duplicate name: 'set2/a/.zarray' 1242s return self._open_to_write(zinfo, force_zip64=force_zip64) 1242s 1242s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 1242s /usr/lib/python3.13/zipfile/__init__.py:1642: UserWarning: Duplicate name: 'set2/a/.zattrs' 1242s return self._open_to_write(zinfo, force_zip64=force_zip64) 1242s 1242s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 1242s /usr/lib/python3.13/zipfile/__init__.py:1642: UserWarning: Duplicate name: 'set2/b/.zarray' 1242s return self._open_to_write(zinfo, force_zip64=force_zip64) 1242s 1242s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 1242s /usr/lib/python3.13/zipfile/__init__.py:1642: UserWarning: Duplicate name: 'set2/b/.zattrs' 1242s return self._open_to_write(zinfo, force_zip64=force_zip64) 1242s 1242s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 1242s /usr/lib/python3.13/zipfile/__init__.py:1642: UserWarning: Duplicate name: 'set3/.zgroup' 1242s return self._open_to_write(zinfo, force_zip64=force_zip64) 1242s 1242s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 1242s /usr/lib/python3.13/zipfile/__init__.py:1642: UserWarning: Duplicate name: 'set3/.zattrs' 1242s return self._open_to_write(zinfo, force_zip64=force_zip64) 1242s 1242s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 1242s /usr/lib/python3.13/zipfile/__init__.py:1642: UserWarning: Duplicate name: 'set1/set1/.zgroup' 1242s return self._open_to_write(zinfo, force_zip64=force_zip64) 1242s 1242s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 1242s /usr/lib/python3.13/zipfile/__init__.py:1642: UserWarning: Duplicate name: 'set1/set1/.zattrs' 1242s return self._open_to_write(zinfo, force_zip64=force_zip64) 1242s 1242s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 1242s /usr/lib/python3.13/zipfile/__init__.py:1642: UserWarning: Duplicate name: 'set1/set2/.zgroup' 1242s return self._open_to_write(zinfo, force_zip64=force_zip64) 1242s 1242s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 1242s /usr/lib/python3.13/zipfile/__init__.py:1642: UserWarning: Duplicate name: 'set1/set2/.zattrs' 1242s return self._open_to_write(zinfo, force_zip64=force_zip64) 1242s 1242s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 1242s /usr/lib/python3.13/zipfile/__init__.py:1642: UserWarning: Duplicate name: 'set2/set1/.zgroup' 1242s return self._open_to_write(zinfo, force_zip64=force_zip64) 1242s 1242s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 1242s /usr/lib/python3.13/zipfile/__init__.py:1642: UserWarning: Duplicate name: 'set2/set1/.zattrs' 1242s return self._open_to_write(zinfo, force_zip64=force_zip64) 1242s 1242s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=3] 1242s /usr/lib/python3.13/zipfile/__init__.py:1642: UserWarning: Duplicate name: 'zarr.json' 1242s return self._open_to_write(zinfo, force_zip64=force_zip64) 1242s 1242s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=3] 1242s /usr/lib/python3.13/zipfile/__init__.py:1642: UserWarning: Duplicate name: 'a/zarr.json' 1242s return self._open_to_write(zinfo, force_zip64=force_zip64) 1242s 1242s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=3] 1242s /usr/lib/python3.13/zipfile/__init__.py:1642: UserWarning: Duplicate name: 'set0/zarr.json' 1242s return self._open_to_write(zinfo, force_zip64=force_zip64) 1242s 1242s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=3] 1242s /usr/lib/python3.13/zipfile/__init__.py:1642: UserWarning: Duplicate name: 'set1/zarr.json' 1242s return self._open_to_write(zinfo, force_zip64=force_zip64) 1242s 1242s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=3] 1242s /usr/lib/python3.13/zipfile/__init__.py:1642: UserWarning: Duplicate name: 'set1/a/zarr.json' 1242s return self._open_to_write(zinfo, force_zip64=force_zip64) 1242s 1242s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=3] 1242s /usr/lib/python3.13/zipfile/__init__.py:1642: UserWarning: Duplicate name: 'set1/b/zarr.json' 1242s return self._open_to_write(zinfo, force_zip64=force_zip64) 1242s 1242s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=3] 1242s /usr/lib/python3.13/zipfile/__init__.py:1642: UserWarning: Duplicate name: 'set2/zarr.json' 1242s return self._open_to_write(zinfo, force_zip64=force_zip64) 1242s 1242s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=3] 1242s /usr/lib/python3.13/zipfile/__init__.py:1642: UserWarning: Duplicate name: 'set2/a/zarr.json' 1242s return self._open_to_write(zinfo, force_zip64=force_zip64) 1242s 1242s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=3] 1242s /usr/lib/python3.13/zipfile/__init__.py:1642: UserWarning: Duplicate name: 'set2/b/zarr.json' 1242s return self._open_to_write(zinfo, force_zip64=force_zip64) 1242s 1242s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=3] 1242s /usr/lib/python3.13/zipfile/__init__.py:1642: UserWarning: Duplicate name: 'set3/zarr.json' 1242s return self._open_to_write(zinfo, force_zip64=force_zip64) 1242s 1242s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=3] 1242s /usr/lib/python3.13/zipfile/__init__.py:1642: UserWarning: Duplicate name: 'set1/set1/zarr.json' 1242s return self._open_to_write(zinfo, force_zip64=force_zip64) 1242s 1242s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=3] 1242s /usr/lib/python3.13/zipfile/__init__.py:1642: UserWarning: Duplicate name: 'set1/set2/zarr.json' 1242s return self._open_to_write(zinfo, force_zip64=force_zip64) 1242s 1242s tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=3] 1242s /usr/lib/python3.13/zipfile/__init__.py:1642: UserWarning: Duplicate name: 'set2/set1/zarr.json' 1242s return self._open_to_write(zinfo, force_zip64=force_zip64) 1242s 1242s tests/test_conventions.py: 1 warning 1242s tests/test_rolling.py: 36 warnings 1242s /usr/lib/python3/dist-packages/xarray/core/duck_array_ops.py:237: RuntimeWarning: invalid value encountered in cast 1242s return data.astype(dtype, **kwargs) 1242s 1242s tests/test_dask.py: 12 warnings 1242s tests/test_units.py: 10 warnings 1242s /usr/lib/python3/dist-packages/numpy/_core/numeric.py:476: RuntimeWarning: invalid value encountered in cast 1242s multiarray.copyto(res, fill_value, casting='unsafe') 1242s 1242s tests/test_duck_array_ops.py: 16 warnings 1242s /usr/lib/python3/dist-packages/dask/array/core.py:5083: RuntimeWarning: overflow encountered in scalar add 1242s result = function(*args, **kwargs) 1242s 1242s tests/test_duck_array_ops.py::test_cftime_datetime_mean[True] 1242s /usr/lib/python3/dist-packages/dask/array/core.py:5083: DeprecationWarning: Bitwise inversion '~' on bool is deprecated and will be removed in Python 3.16. This returns the bitwise inversion of the underlying int object and is usually not what you expect from negating a bool. Use the 'not' operator for boolean negation or ~int(x) if you really want the bitwise inversion of the underlying int. 1242s result = function(*args, **kwargs) 1242s 1242s tests/test_duck_array_wrapping.py::TestDataArrayMethods::test_astype[pint] 1242s /usr/lib/python3/dist-packages/pint/facets/numpy/quantity.py:88: RuntimeWarning: invalid value encountered in cast 1242s value = func(*args, **kwargs) 1242s 1242s tests/test_strategies.py::TestReduction::test_mean 1242s tests/test_strategies.py::TestReduction::test_mean 1242s tests/test_strategies.py::TestReduction::test_mean 1242s tests/test_strategies.py::TestReduction::test_mean 1242s tests/test_strategies.py::TestReduction::test_mean 1242s tests/test_strategies.py::TestReduction::test_mean 1242s tests/test_strategies.py::TestReduction::test_mean 1242s /usr/lib/python3/dist-packages/xarray/tests/test_strategies.py:277: RuntimeWarning: Mean of empty slice 1242s expected = np.nanmean(var.data, axis=reduction_axes) 1242s 1242s tests/test_strategies.py::TestReduction::test_mean 1242s tests/test_strategies.py::TestReduction::test_mean 1242s tests/test_strategies.py::TestReduction::test_mean 1242s tests/test_strategies.py::TestReduction::test_mean 1242s tests/test_strategies.py::TestReduction::test_mean 1242s tests/test_strategies.py::TestReduction::test_mean 1242s /usr/lib/python3/dist-packages/numpy/_core/fromnumeric.py:86: RuntimeWarning: invalid value encountered in reduce 1242s return ufunc.reduce(obj, axis, dtype, out, **passkwargs) 1242s 1242s tests/test_strategies.py::TestReduction::test_mean 1242s tests/test_strategies.py::TestReduction::test_mean 1242s /usr/lib/python3/dist-packages/numpy/_core/fromnumeric.py:86: RuntimeWarning: overflow encountered in reduce 1242s return ufunc.reduce(obj, axis, dtype, out, **passkwargs) 1242s 1242s tests/test_tutorial.py::TestLoadDataset::test_download_from_github 1242s /usr/lib/python3/dist-packages/_pytest/python.py:159: RuntimeWarning: deallocating CachingFileManager(, '/tmp/pytest-of-ubuntu/pytest-1/test_download_from_github0/xarray_tutorial_data/4c5c606840191d085ac934c9665f7387-tiny.nc', mode='r', kwargs={'clobber': True, 'diskless': False, 'persist': False, 'format': 'NETCDF4'}, manager_id='e0969e99-8e8a-494b-b14c-f937fa16e6e8'), but file is not already closed. This may indicate a bug. 1242s result = testfunction(**testargs) 1242s 1242s tests/test_tutorial.py::TestLoadDataset::test_download_from_github_load_without_cache 1242s /usr/lib/python3/dist-packages/_pytest/python.py:159: RuntimeWarning: deallocating CachingFileManager(, '/tmp/pytest-of-ubuntu/pytest-1/test_download_from_github_load0/xarray_tutorial_data/4c5c606840191d085ac934c9665f7387-tiny.nc', mode='r', kwargs={'clobber': True, 'diskless': False, 'persist': False, 'format': 'NETCDF4'}, manager_id='536b5516-0833-44a6-88ca-73aa2aa6499a'), but file is not already closed. This may indicate a bug. 1242s result = testfunction(**testargs) 1242s 1242s tests/test_tutorial.py::TestLoadDataset::test_download_from_github_load_without_cache 1242s /usr/lib/python3/dist-packages/_pytest/python.py:159: RuntimeWarning: deallocating CachingFileManager(, '/tmp/pytest-of-ubuntu/pytest-1/test_download_from_github_load0/xarray_tutorial_data/4c5c606840191d085ac934c9665f7387-tiny.nc', mode='r', kwargs={'clobber': True, 'diskless': False, 'persist': False, 'format': 'NETCDF4'}, manager_id='3bf41e99-cd63-440d-b1be-9524e88d7f02'), but file is not already closed. This may indicate a bug. 1242s result = testfunction(**testargs) 1242s 1242s tests/test_units.py::TestDataArray::test_numpy_methods_with_args[float64-compatible_unit-function_clip] 1242s tests/test_units.py::TestDataArray::test_numpy_methods_with_args[float64-identical_unit-function_clip] 1242s tests/test_units.py::TestDataArray::test_numpy_methods_with_args[int64-compatible_unit-function_clip] 1242s tests/test_units.py::TestDataArray::test_numpy_methods_with_args[int64-identical_unit-function_clip] 1242s /usr/lib/python3/dist-packages/numpy/_core/fromnumeric.py:48: DeprecationWarning: __array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0) 1242s return conv.wrap(result, to_scalar=False) 1242s 1242s tests/test_units.py::TestDataArray::test_missing_value_filling[int64-method_ffill] 1242s tests/test_units.py::TestDataArray::test_missing_value_filling[int64-method_bfill] 1242s /usr/lib/python3/dist-packages/xarray/tests/test_units.py:2766: RuntimeWarning: invalid value encountered in cast 1242s np.array([1.4, np.nan, 2.3, np.nan, np.nan, 9.1]).astype(dtype) 1242s 1242s tests/test_units.py: 15 warnings 1242s /usr/lib/python3/dist-packages/xarray/tests/test_units.py:2803: RuntimeWarning: invalid value encountered in cast 1242s np.array([1.4, np.nan, 2.3, np.nan, np.nan, 9.1]).astype(dtype) 1242s 1242s tests/test_units.py::TestDataArray::test_dropna[int64] 1242s /usr/lib/python3/dist-packages/xarray/tests/test_units.py:2831: RuntimeWarning: invalid value encountered in cast 1242s np.array([1.4, np.nan, 2.3, np.nan, np.nan, 9.1]).astype(dtype) 1242s 1242s tests/test_units.py::TestDataArray::test_isin[int64-no_unit] 1242s tests/test_units.py::TestDataArray::test_isin[int64-dimensionless] 1242s tests/test_units.py::TestDataArray::test_isin[int64-incompatible_unit] 1242s tests/test_units.py::TestDataArray::test_isin[int64-compatible_unit] 1242s tests/test_units.py::TestDataArray::test_isin[int64-identical_unit] 1242s /usr/lib/python3/dist-packages/xarray/tests/test_units.py:2856: RuntimeWarning: invalid value encountered in cast 1242s np.array([1.4, np.nan, 2.3, np.nan, np.nan, 9.1]).astype(dtype) 1242s 1242s tests/test_units.py::TestDataArray::test_isin[int64-no_unit] 1242s tests/test_units.py::TestDataArray::test_isin[int64-dimensionless] 1242s tests/test_units.py::TestDataArray::test_isin[int64-incompatible_unit] 1242s tests/test_units.py::TestDataArray::test_isin[int64-compatible_unit] 1242s tests/test_units.py::TestDataArray::test_isin[int64-identical_unit] 1242s /usr/lib/python3/dist-packages/xarray/tests/test_units.py:2861: RuntimeWarning: invalid value encountered in cast 1242s raw_values = np.array([1.4, np.nan, 2.3]).astype(dtype) 1242s 1242s tests/test_units.py::TestDataset::test_missing_value_filling[int64-method_ffill] 1242s tests/test_units.py::TestDataset::test_missing_value_filling[int64-method_bfill] 1242s /usr/lib/python3/dist-packages/xarray/tests/test_units.py:4252: RuntimeWarning: invalid value encountered in cast 1242s np.array([1.4, np.nan, 2.3, np.nan, np.nan, 9.1]).astype(dtype) 1242s 1242s tests/test_units.py::TestDataset::test_missing_value_filling[int64-method_ffill] 1242s tests/test_units.py::TestDataset::test_missing_value_filling[int64-method_bfill] 1242s /usr/lib/python3/dist-packages/xarray/tests/test_units.py:4256: RuntimeWarning: invalid value encountered in cast 1242s np.array([4.3, 9.8, 7.5, np.nan, 8.2, np.nan]).astype(dtype) 1242s 1242s tests/test_units.py: 15 warnings 1242s /usr/lib/python3/dist-packages/xarray/tests/test_units.py:4295: RuntimeWarning: invalid value encountered in cast 1242s np.array([1.4, np.nan, 2.3, np.nan, np.nan, 9.1]).astype(dtype) 1242s 1242s tests/test_units.py: 15 warnings 1242s /usr/lib/python3/dist-packages/xarray/tests/test_units.py:4299: RuntimeWarning: invalid value encountered in cast 1242s np.array([4.3, 9.8, 7.5, np.nan, 8.2, np.nan]).astype(dtype) 1242s 1242s tests/test_units.py::TestDataset::test_dropna[int64] 1242s /usr/lib/python3/dist-packages/xarray/tests/test_units.py:4325: RuntimeWarning: invalid value encountered in cast 1242s np.array([1.4, np.nan, 2.3, np.nan, np.nan, 9.1]).astype(dtype) 1242s 1242s tests/test_units.py::TestDataset::test_dropna[int64] 1242s /usr/lib/python3/dist-packages/xarray/tests/test_units.py:4329: RuntimeWarning: invalid value encountered in cast 1242s np.array([4.3, 9.8, 7.5, np.nan, 8.2, np.nan]).astype(dtype) 1242s 1242s tests/test_units.py::TestDataset::test_isin[int64-no_unit] 1242s tests/test_units.py::TestDataset::test_isin[int64-dimensionless] 1242s tests/test_units.py::TestDataset::test_isin[int64-incompatible_unit] 1242s tests/test_units.py::TestDataset::test_isin[int64-compatible_unit] 1242s tests/test_units.py::TestDataset::test_isin[int64-same_unit] 1242s /usr/lib/python3/dist-packages/xarray/tests/test_units.py:4353: RuntimeWarning: invalid value encountered in cast 1242s np.array([1.4, np.nan, 2.3, np.nan, np.nan, 9.1]).astype(dtype) 1242s 1242s tests/test_units.py::TestDataset::test_isin[int64-no_unit] 1242s tests/test_units.py::TestDataset::test_isin[int64-dimensionless] 1242s tests/test_units.py::TestDataset::test_isin[int64-incompatible_unit] 1242s tests/test_units.py::TestDataset::test_isin[int64-compatible_unit] 1242s tests/test_units.py::TestDataset::test_isin[int64-same_unit] 1242s /usr/lib/python3/dist-packages/xarray/tests/test_units.py:4357: RuntimeWarning: invalid value encountered in cast 1242s np.array([4.3, 9.8, 7.5, np.nan, 8.2, np.nan]).astype(dtype) 1242s 1242s tests/test_units.py::TestDataset::test_isin[int64-no_unit] 1242s tests/test_units.py::TestDataset::test_isin[int64-dimensionless] 1242s tests/test_units.py::TestDataset::test_isin[int64-incompatible_unit] 1242s tests/test_units.py::TestDataset::test_isin[int64-compatible_unit] 1242s tests/test_units.py::TestDataset::test_isin[int64-same_unit] 1242s /usr/lib/python3/dist-packages/xarray/tests/test_units.py:4362: RuntimeWarning: invalid value encountered in cast 1242s raw_values = np.array([1.4, np.nan, 2.3]).astype(dtype) 1242s 1242s tests/test_units.py::TestDataset::test_interpolate_na[int64] 1242s /usr/lib/python3/dist-packages/xarray/tests/test_units.py:4438: RuntimeWarning: invalid value encountered in cast 1242s np.array([1.4, np.nan, 2.3, np.nan, np.nan, 9.1]).astype(dtype) 1242s 1242s tests/test_units.py::TestDataset::test_interpolate_na[int64] 1242s /usr/lib/python3/dist-packages/xarray/tests/test_units.py:4442: RuntimeWarning: invalid value encountered in cast 1242s np.array([4.3, 9.8, 7.5, np.nan, 8.2, np.nan]).astype(dtype) 1242s 1242s tests/test_units.py::TestDataset::test_combine_first[int64-data-no_unit] 1242s tests/test_units.py::TestDataset::test_combine_first[int64-data-dimensionless] 1242s tests/test_units.py::TestDataset::test_combine_first[int64-data-incompatible_unit] 1242s tests/test_units.py::TestDataset::test_combine_first[int64-data-compatible_unit] 1242s tests/test_units.py::TestDataset::test_combine_first[int64-data-same_unit] 1242s /usr/lib/python3/dist-packages/xarray/tests/test_units.py:4487: RuntimeWarning: invalid value encountered in cast 1242s np.array([1.4, np.nan, 2.3, np.nan, np.nan, 9.1]).astype(dtype) * data_unit 1242s 1242s tests/test_units.py::TestDataset::test_combine_first[int64-data-no_unit] 1242s tests/test_units.py::TestDataset::test_combine_first[int64-data-dimensionless] 1242s tests/test_units.py::TestDataset::test_combine_first[int64-data-incompatible_unit] 1242s tests/test_units.py::TestDataset::test_combine_first[int64-data-compatible_unit] 1242s tests/test_units.py::TestDataset::test_combine_first[int64-data-same_unit] 1242s /usr/lib/python3/dist-packages/xarray/tests/test_units.py:4490: RuntimeWarning: invalid value encountered in cast 1242s np.array([4.3, 9.8, 7.5, np.nan, 8.2, np.nan]).astype(dtype) * data_unit 1242s 1242s tests/test_variable.py::TestIndexVariable::test_to_index_multiindex_level 1242s /usr/lib/python3/dist-packages/xarray/tests/test_variable.py:2447: FutureWarning: the `pandas.MultiIndex` object(s) passed as 'x' coordinate(s) or data variable(s) will no longer be implicitly promoted and wrapped into multiple indexed coordinates in the future (i.e., one coordinate for each multi-index level + one dimension coordinate). If you want to keep this behavior, you need to first wrap it explicitly using `mindex_coords = xarray.Coordinates.from_pandas_multiindex(mindex_obj, 'dim')` and pass it as coordinates, e.g., `xarray.Dataset(coords=mindex_coords)`, `dataset.assign_coords(mindex_coords)` or `dataarray.assign_coords(mindex_coords)`. 1242s ds = Dataset(coords={"x": midx}) 1242s 1242s tests/test_weighted.py::test_weighted_quantile_3D[None-True-q1-a] 1242s tests/test_weighted.py::test_weighted_quantile_3D[True-True-0.5-a] 1242s /usr/lib/python3/dist-packages/numpy/lib/_nanfunctions_impl.py:1617: RuntimeWarning: All-NaN slice encountered 1242s return fnb._ureduce(a, 1242s 1242s -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html 1242s =========================== short test summary info ============================ 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_non_existent_store[2] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_non_existent_store[2] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_non_existent_store[2] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_empty[2-True-True] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_empty[2-True-False] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_empty[2-True-None] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_zero_dimensional_variable[3] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_write_store[3] - Attri... 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_roundtrip_test_data[3] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_load[3] - AttributeErr... 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_dataset_compute[3] - A... 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_roundtrip_object_dtype[3] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_roundtrip_float64_data[3] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_orthogonal_indexing[3] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_vectorized_indexing[3] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_vectorized_indexing_negative_step[3] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_outer_indexing_reversed[3] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_isel_dataarray[3] - At... 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_array_type_after_indexing[3] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_dropna[3] - AttributeE... 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_ondisk_after_print[3] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_roundtrip_bytes_with_fill_value[3] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_roundtrip_unsigned[3-fill_value0-False] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_roundtrip_unsigned[3-fill_value1-True] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_roundtrip_unsigned[3--1-False] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_roundtrip_unsigned[3-255-True] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_grid_mapping_and_bounds_are_not_coordinates_in_file[3] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_coordinate_variables_after_dataset_roundtrip[3] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_grid_mapping_and_bounds_are_coordinates_after_dataarray_roundtrip[3] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_encoding_kwarg[3] - At... 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_default_fill_value[3] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_explicitly_omit_fill_value_in_coord[3] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_explicitly_omit_fill_value_in_coord_via_encoding_kwarg[3] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_encoding_same_dtype[3] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_append_overwrite_values[3] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_roundtrip_consolidated[3-False] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_roundtrip_consolidated[3-True] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_roundtrip_consolidated[3-None] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_read_non_consolidated_warning[3] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_non_existent_store[3] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_auto_chunk[3] - Attrib... 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_manual_chunk[3] - Attr... 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_warning_on_bad_chunks[3] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_write_uneven_dask_chunks[3] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_chunk_encoding[3] - At... 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_shard_encoding[3] - At... 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_write_persistence_modes[3-None] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_write_persistence_modes[3-group1] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_compressor_encoding[3] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_group[3] - AttributeEr... 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_append_write[3] - Attr... 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_append_with_append_dim_not_set_raises[3] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_append_string_length_mismatch_works[3-U] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_append_string_length_mismatch_works[3-S] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_check_encoding_is_consistent_after_append[3] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_append_with_new_variable[3] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_append_with_append_dim_no_overwrite[3] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_to_zarr_compute_false_roundtrip[3] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_to_zarr_append_compute_false_roundtrip[3] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_save_emptydim[3-False] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_save_emptydim[3-True] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_no_warning_from_open_emptydim_with_chunks[3] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-False-False-False-False] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-False-False-False-True] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-False-False-False-None] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-False-False-True-False] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-False-False-True-True] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-False-False-True-None] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-False-True-False-False] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-False-True-False-True] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-False-True-False-None] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-False-True-True-False] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-False-True-True-True] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-False-True-True-None] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-True-False-False-False] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-True-False-False-True] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-True-False-False-None] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-True-False-True-False] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-True-False-True-True] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-True-False-True-None] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-True-True-False-False] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-True-True-False-True] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-True-True-False-None] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-True-True-True-False] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-True-True-True-True] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-True-True-True-None] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-None-False-False-False] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-None-False-False-True] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-None-False-False-None] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-None-False-True-False] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-None-False-True-True] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-None-False-True-None] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-None-True-False-False] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-None-True-False-True] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-None-True-False-None] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-None-True-True-False] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-None-True-True-True] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region[3-None-True-True-None] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region_mode[3-None] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region_mode[3-r+] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_write_region_mode[3-a] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_write_preexisting_override_metadata[3] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_encoding_chunksizes[3] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_chunk_encoding_with_partial_dask_chunks[3] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_open_zarr_use_cftime[3] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_write_read_select_write[3] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_attributes[3-obj1] - A... 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_chunked_datetime64_or_timedelta64[3-datetime64[ns]] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_chunked_datetime64_or_timedelta64[3-timedelta64[ns]] 1242s FAILED tests/test_backends.py::TestZarrDictStore::test_zarr_fill_value_setting[3-float] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_zero_dimensional_variable[3] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_store[3] - ... 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_roundtrip_test_data[3] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_load[3] - Attribu... 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_dataset_compute[3] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_roundtrip_object_dtype[3] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_roundtrip_float64_data[3] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_orthogonal_indexing[3] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_vectorized_indexing[3] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_vectorized_indexing_negative_step[3] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_outer_indexing_reversed[3] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_isel_dataarray[3] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_array_type_after_indexing[3] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_dropna[3] - Attri... 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_ondisk_after_print[3] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_roundtrip_bytes_with_fill_value[3] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_roundtrip_unsigned[3-fill_value0-False] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_roundtrip_unsigned[3-fill_value1-True] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_roundtrip_unsigned[3--1-False] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_roundtrip_unsigned[3-255-True] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_grid_mapping_and_bounds_are_not_coordinates_in_file[3] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_coordinate_variables_after_dataset_roundtrip[3] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_grid_mapping_and_bounds_are_coordinates_after_dataarray_roundtrip[3] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_encoding_kwarg[3] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_default_fill_value[3] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_explicitly_omit_fill_value_in_coord[3] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_explicitly_omit_fill_value_in_coord_via_encoding_kwarg[3] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_encoding_same_dtype[3] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_append_overwrite_values[3] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_roundtrip_consolidated[3-False] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_roundtrip_consolidated[3-True] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_roundtrip_consolidated[3-None] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_read_non_consolidated_warning[3] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_non_existent_store[3] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_auto_chunk[3] - A... 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_manual_chunk[3] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_warning_on_bad_chunks[3] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_uneven_dask_chunks[3] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_chunk_encoding[3] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_shard_encoding[3] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_persistence_modes[3-None] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_persistence_modes[3-group1] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_compressor_encoding[3] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_group[3] - Attrib... 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_append_write[3] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_append_with_append_dim_not_set_raises[3] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_append_string_length_mismatch_works[3-U] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_append_string_length_mismatch_works[3-S] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_check_encoding_is_consistent_after_append[3] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_append_with_new_variable[3] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_append_with_append_dim_no_overwrite[3] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_to_zarr_compute_false_roundtrip[3] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_to_zarr_append_compute_false_roundtrip[3] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_save_emptydim[3-False] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_save_emptydim[3-True] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_no_warning_from_open_emptydim_with_chunks[3] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-False-False-False-False] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-False-False-False-True] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-False-False-False-None] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-False-False-True-False] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-False-False-True-True] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-False-False-True-None] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-False-True-False-False] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-False-True-False-True] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-False-True-False-None] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-False-True-True-False] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-False-True-True-True] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-False-True-True-None] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-True-False-False-False] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-True-False-False-True] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-True-False-False-None] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-True-False-True-False] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-True-False-True-True] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-True-False-True-None] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-True-True-False-False] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-True-True-False-True] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-True-True-False-None] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-True-True-True-False] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-True-True-True-True] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-True-True-True-None] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-None-False-False-False] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-None-False-False-True] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-None-False-False-None] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-None-False-True-False] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-None-False-True-True] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-None-False-True-None] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-None-True-False-False] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-None-True-False-True] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-None-True-False-None] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-None-True-True-False] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-None-True-True-True] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region[3-None-True-True-None] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region_mode[3-None] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region_mode[3-r+] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_region_mode[3-a] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_preexisting_override_metadata[3] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_encoding_chunksizes[3] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_chunk_encoding_with_partial_dask_chunks[3] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_open_zarr_use_cftime[3] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_write_read_select_write[3] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_attributes[3-obj1] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_chunked_datetime64_or_timedelta64[3-datetime64[ns]] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_chunked_datetime64_or_timedelta64[3-timedelta64[ns]] 1242s FAILED tests/test_backends.py::TestZarrDirectoryStore::test_zarr_fill_value_setting[3-float] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_zero_dimensional_variable[3] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_store[3] - Attr... 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_roundtrip_test_data[3] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_load[3] - AttributeEr... 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_dataset_compute[3] - ... 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_roundtrip_object_dtype[3] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_roundtrip_float64_data[3] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_orthogonal_indexing[3] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_vectorized_indexing[3] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_vectorized_indexing_negative_step[3] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_outer_indexing_reversed[3] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_isel_dataarray[3] - A... 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_array_type_after_indexing[3] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_dropna[3] - Attribute... 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_ondisk_after_print[3] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_roundtrip_bytes_with_fill_value[3] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_roundtrip_unsigned[3-fill_value0-False] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_roundtrip_unsigned[3-fill_value1-True] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_roundtrip_unsigned[3--1-False] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_roundtrip_unsigned[3-255-True] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_grid_mapping_and_bounds_are_not_coordinates_in_file[3] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_coordinate_variables_after_dataset_roundtrip[3] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_grid_mapping_and_bounds_are_coordinates_after_dataarray_roundtrip[3] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_encoding_kwarg[3] - A... 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_default_fill_value[3] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_explicitly_omit_fill_value_in_coord[3] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_explicitly_omit_fill_value_in_coord_via_encoding_kwarg[3] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_encoding_same_dtype[3] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_append_overwrite_values[3] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_roundtrip_consolidated[3-False] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_roundtrip_consolidated[3-True] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_roundtrip_consolidated[3-None] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_read_non_consolidated_warning[3] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_non_existent_store[3] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_auto_chunk[3] - Attri... 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_manual_chunk[3] - Att... 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_warning_on_bad_chunks[3] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_uneven_dask_chunks[3] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_chunk_encoding[3] - A... 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_shard_encoding[3] - A... 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_persistence_modes[3-None] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_persistence_modes[3-group1] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_compressor_encoding[3] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_group[3] - AttributeE... 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_append_write[3] - Att... 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_append_with_append_dim_not_set_raises[3] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_append_string_length_mismatch_works[3-U] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_append_string_length_mismatch_works[3-S] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_check_encoding_is_consistent_after_append[3] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_append_with_new_variable[3] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_append_with_append_dim_no_overwrite[3] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_to_zarr_compute_false_roundtrip[3] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_to_zarr_append_compute_false_roundtrip[3] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_save_emptydim[3-False] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_save_emptydim[3-True] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_no_warning_from_open_emptydim_with_chunks[3] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-False-False-False-False] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-False-False-False-True] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-False-False-False-None] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-False-False-True-False] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-False-False-True-True] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-False-False-True-None] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-False-True-False-False] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-False-True-False-True] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-False-True-False-None] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-False-True-True-False] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-False-True-True-True] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-False-True-True-None] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-True-False-False-False] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-True-False-False-True] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-True-False-False-None] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-True-False-True-False] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-True-False-True-True] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-True-False-True-None] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-True-True-False-False] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-True-True-False-True] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-True-True-False-None] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-True-True-True-False] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-True-True-True-True] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-True-True-True-None] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-None-False-False-False] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-None-False-False-True] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-None-False-False-None] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-None-False-True-False] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-None-False-True-True] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-None-False-True-None] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-None-True-False-False] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-None-True-False-True] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-None-True-False-None] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-None-True-True-False] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-None-True-True-True] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region[3-None-True-True-None] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region_mode[3-None] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region_mode[3-r+] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_region_mode[3-a] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_preexisting_override_metadata[3] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_encoding_chunksizes[3] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_chunk_encoding_with_partial_dask_chunks[3] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_open_zarr_use_cftime[3] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_read_select_write[3] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_attributes[3-obj1] - ... 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_chunked_datetime64_or_timedelta64[3-datetime64[ns]] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_chunked_datetime64_or_timedelta64[3-timedelta64[ns]] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_zarr_fill_value_setting[3-float] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_empty[3-True-True] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_empty[3-True-False] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_empty[3-True-None] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_empty[3-False-True] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_empty[3-False-False] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_empty[3-False-None] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_empty[3-None-True] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_empty[3-None-False] 1242s FAILED tests/test_backends.py::TestZarrWriteEmpty::test_write_empty[3-None-None] 1242s FAILED tests/test_backends.py::TestZarrRegionAuto::test_zarr_region_auto[3-full-auto] 1242s FAILED tests/test_backends.py::TestZarrRegionAuto::test_zarr_region_auto[3-mixed-auto] 1242s FAILED tests/test_backends.py::TestZarrRegionAuto::test_zarr_region_index_write[3] 1242s FAILED tests/test_backends.py::TestZarrRegionAuto::test_zarr_region[3] - Attr... 1242s FAILED tests/test_backends.py::TestZarrRegionAuto::test_zarr_append_chunk_partial[3] 1242s FAILED tests/test_backends.py::TestZarrRegionAuto::test_zarr_region_chunk_partial_offset[3] 1242s FAILED tests/test_backends.py::TestZarrRegionAuto::test_zarr_safe_chunk_append_dim[3] 1242s FAILED tests/test_backends.py::TestZarrRegionAuto::test_zarr_safe_chunk_region[3-r+] 1242s FAILED tests/test_backends.py::TestZarrRegionAuto::test_zarr_safe_chunk_region[3-a] 1242s FAILED tests/test_backends.py::test_open_dataset_chunking_zarr[auto] - Attrib... 1242s FAILED tests/test_backends.py::test_open_dataset_chunking_zarr[-1] - Attribut... 1242s FAILED tests/test_backends.py::test_open_dataset_chunking_zarr[chunks2] - Att... 1242s FAILED tests/test_backends.py::test_open_dataset_chunking_zarr[chunks3] - Att... 1242s FAILED tests/test_backends.py::test_open_dataset_chunking_zarr[chunks4] - Att... 1242s FAILED tests/test_backends.py::test_open_dataset_chunking_zarr[chunks5] - Att... 1242s FAILED tests/test_backends.py::test_chunking_consintency[auto] - AttributeErr... 1242s FAILED tests/test_backends.py::test_chunking_consintency[-1] - AttributeError... 1242s FAILED tests/test_backends.py::test_chunking_consintency[chunks2] - Attribute... 1242s FAILED tests/test_backends.py::test_chunking_consintency[chunks3] - Attribute... 1242s FAILED tests/test_backends.py::test_chunking_consintency[chunks4] - Attribute... 1242s FAILED tests/test_backends.py::test_chunking_consintency[chunks5] - Attribute... 1242s FAILED tests/test_backends.py::TestNCZarr::test_overwriting_nczarr - Attribut... 1242s FAILED tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr[zarr_format=3] 1242s FAILED tests/test_backends_datatree.py::TestZarrDatatreeIO::test_zarr_encoding[zarr_format=3] 1242s FAILED tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=2] 1242s FAILED tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_zip_store[zarr_format=3] 1242s FAILED tests/test_backends_datatree.py::TestZarrDatatreeIO::test_to_zarr_not_consolidated[zarr_format=3] 1242s FAILED tests/test_backends_datatree.py::TestZarrDatatreeIO::test_open_groups_round_trip[zarr_format=3] 1242s FAILED tests/test_backends_datatree.py::TestZarrDatatreeIO::test_open_datatree[zarr_format=3] 1242s FAILED tests/test_backends_datatree.py::TestZarrDatatreeIO::test_open_datatree_chunks[zarr_format=3] 1242s FAILED tests/test_backends_datatree.py::TestZarrDatatreeIO::test_open_groups[zarr_format=3] 1242s FAILED tests/test_backends_datatree.py::TestZarrDatatreeIO::test_open_datatree_specific_group[True-zarr_format=3] 1242s FAILED tests/test_backends_datatree.py::TestZarrDatatreeIO::test_open_datatree_specific_group[False-zarr_format=3] 1242s FAILED tests/test_backends_datatree.py::TestZarrDatatreeIO::test_open_datatree_specific_group[None-zarr_format=3] 1242s FAILED tests/test_backends_datatree.py::TestZarrDatatreeIO::test_open_groups_chunks[zarr_format=3] 1242s = 362 failed, 19245 passed, 1887 skipped, 51 deselected, 239 xfailed, 108 xpassed, 993 warnings in 519.16s (0:08:39) = 1245s E: pybuild pybuild:389: test: plugin pyproject failed with: exit code=1: cd /tmp/autopkgtest.cdpOi4/autopkgtest_tmp/build; python3.13 -m pytest --deselect=tests/test_weighted.py::test_weighted_operations_keep_attr --deselect=tests/test_variable.py::TestVariable::test_reduce_keepdims --deselect=tests/test_backends.py::test_zarr_region_chunk_partial_offset --deselect=tests/test_backends.py::test_chunk_encoding_with_dask --pyargs xarray 1245s pybuild-autopkgtest: error: pybuild --autopkgtest --test-pytest -i python{version} -p "3.14 3.13" returned exit code 13 1245s make: *** [/tmp/5X38NM_xB8/run:4: pybuild-autopkgtest] Error 25 1245s pybuild-autopkgtest: error: /tmp/5X38NM_xB8/run pybuild-autopkgtest returned exit code 2 1245s autopkgtest [10:52:31]: test pybuild-autopkgtest: -----------------------] 1246s pybuild-autopkgtest FAIL non-zero exit status 25 1246s autopkgtest [10:52:32]: test pybuild-autopkgtest: - - - - - - - - - - results - - - - - - - - - - 1246s autopkgtest [10:52:32]: @@@@@@@@@@@@@@@@@@@@ summary 1246s pybuild-autopkgtest FAIL non-zero exit status 25