Mock Version: 3.5 Mock Version: 3.5 Mock Version: 3.5 ENTER ['do_with_status'](['bash', '--login', '-c', '/usr/bin/rpmbuild -bs --noclean --target noarch --nodeps /builddir/build/SPECS/python-xarray.spec'], chrootPath='/var/lib/mock/f38-build-side-42-init-devel-1090490-30049/root'env={'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8'}shell=Falselogger=timeout=864000uid=996gid=135user='mockbuild'nspawn_args=[]unshare_net=TrueprintOutput=False) Executing command: ['bash', '--login', '-c', '/usr/bin/rpmbuild -bs --noclean --target noarch --nodeps /builddir/build/SPECS/python-xarray.spec'] with env {'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8'} and shell False Building target platforms: noarch Building for target noarch setting SOURCE_DATE_EPOCH=1691798400 Wrote: /builddir/build/SRPMS/python-xarray-2023.1.0-1.fc38.src.rpm Child return code was: 0 ENTER ['do_with_status'](['bash', '--login', '-c', '/usr/bin/rpmbuild -br --noclean --target noarch --nodeps /builddir/build/SPECS/python-xarray.spec'], chrootPath='/var/lib/mock/f38-build-side-42-init-devel-1090490-30049/root'env={'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8'}shell=Falselogger=timeout=864000uid=996gid=135user='mockbuild'nspawn_args=[]unshare_net=TrueraiseExc=FalseprintOutput=False) Executing command: ['bash', '--login', '-c', '/usr/bin/rpmbuild -br --noclean --target noarch --nodeps /builddir/build/SPECS/python-xarray.spec'] with env {'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8'} and shell False Building target platforms: noarch Building for target noarch setting SOURCE_DATE_EPOCH=1691798400 Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.fXhZW9 + umask 022 + cd /builddir/build/BUILD + cd /builddir/build/BUILD + rm -rf xarray-2023.1.0 + /usr/lib/rpm/rpmuncompress -x /builddir/build/SOURCES/xarray-2023.1.0.tar.gz + STATUS=0 + '[' 0 -ne 0 ']' + cd xarray-2023.1.0 + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w . + /usr/lib/rpm/rpmuncompress /builddir/build/SOURCES/0001-DOC-Don-t-download-RGB.byte.tif-during-build.patch + /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f + /usr/lib/rpm/rpmuncompress /builddir/build/SOURCES/0002-DOC-Skip-examples-using-unpackaged-dependencies.patch + /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f + /usr/lib/rpm/rpmuncompress /builddir/build/SOURCES/0003-DOC-Don-t-print-out-conda-pip-environment.patch + /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f + RPM_EC=0 ++ jobs -p + exit 0 Executing(%generate_buildrequires): /bin/sh -e /var/tmp/rpm-tmp.ViqNVw + umask 022 + cd /builddir/build/BUILD + cd xarray-2023.1.0 + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer ' + export CFLAGS + CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer ' + export CXXFLAGS + FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -I/usr/lib/gfortran/modules ' + export FFLAGS + FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -I/usr/lib/gfortran/modules ' + export FCFLAGS + VALAFLAGS=-g + export VALAFLAGS + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 ' + export LDFLAGS + LT_SYS_LIBRARY_PATH=/usr/lib: + export LT_SYS_LIBRARY_PATH + CC=gcc + export CC + CXX=g++ + export CXX + echo pyproject-rpm-macros + echo python3-devel + echo 'python3dist(pip) >= 19' + echo 'python3dist(packaging)' + '[' -f pyproject.toml ']' + echo '(python3dist(toml) if python3-devel < 3.11)' + rm -rfv '*.dist-info/' + '[' -f /usr/bin/python3 ']' + mkdir -p /builddir/build/BUILD/xarray-2023.1.0/.pyproject-builddir + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer ' + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 ' + TMPDIR=/builddir/build/BUILD/xarray-2023.1.0/.pyproject-builddir + RPM_TOXENV=py311 + HOSTNAME=rpmbuild + /usr/bin/python3 -Bs /usr/lib/rpm/redhat/pyproject_buildrequires.py --generate-extras --python3_pkgversion 3 --wheeldir /builddir/build/BUILD/xarray-2023.1.0/pyproject-wheeldir -r Handling setuptools>=42 from build-system.requires Requirement satisfied: setuptools>=42 (installed: setuptools 65.5.1) Handling setuptools-scm>=7 from build-system.requires Requirement not satisfied: setuptools-scm>=7 Exiting dependency generation pass: build backend + rm -rfv '*.dist-info/' + RPM_EC=0 ++ jobs -p + exit 0 Wrote: /builddir/build/SRPMS/python-xarray-2023.1.0-1.fc38.buildreqs.nosrc.rpm Child return code was: 11 Dynamic buildrequires detected Going to install missing buildrequires. See root.log for details. ENTER ['do_with_status'](['bash', '--login', '-c', '/usr/bin/rpmbuild -br --noclean --target noarch --nodeps /builddir/build/SPECS/python-xarray.spec'], chrootPath='/var/lib/mock/f38-build-side-42-init-devel-1090490-30049/root'env={'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8'}shell=Falselogger=timeout=864000uid=996gid=135user='mockbuild'nspawn_args=[]unshare_net=TrueraiseExc=FalseprintOutput=False) Executing command: ['bash', '--login', '-c', '/usr/bin/rpmbuild -br --noclean --target noarch --nodeps /builddir/build/SPECS/python-xarray.spec'] with env {'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8'} and shell False Building target platforms: noarch Building for target noarch setting SOURCE_DATE_EPOCH=1691798400 Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.g5gedW + umask 022 + cd /builddir/build/BUILD + cd /builddir/build/BUILD + rm -rf xarray-2023.1.0 + /usr/lib/rpm/rpmuncompress -x /builddir/build/SOURCES/xarray-2023.1.0.tar.gz + STATUS=0 + '[' 0 -ne 0 ']' + cd xarray-2023.1.0 + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w . + /usr/lib/rpm/rpmuncompress /builddir/build/SOURCES/0001-DOC-Don-t-download-RGB.byte.tif-during-build.patch + /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f + /usr/lib/rpm/rpmuncompress /builddir/build/SOURCES/0002-DOC-Skip-examples-using-unpackaged-dependencies.patch + /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f + /usr/lib/rpm/rpmuncompress /builddir/build/SOURCES/0003-DOC-Don-t-print-out-conda-pip-environment.patch + /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f + RPM_EC=0 ++ jobs -p + exit 0 Executing(%generate_buildrequires): /bin/sh -e /var/tmp/rpm-tmp.nlJF6I + umask 022 + cd /builddir/build/BUILD + cd xarray-2023.1.0 + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer ' + export CFLAGS + CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer ' + export CXXFLAGS + FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -I/usr/lib/gfortran/modules ' + export FFLAGS + FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -I/usr/lib/gfortran/modules ' + export FCFLAGS + VALAFLAGS=-g + export VALAFLAGS + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 ' + export LDFLAGS + LT_SYS_LIBRARY_PATH=/usr/lib: + export LT_SYS_LIBRARY_PATH + CC=gcc + export CC + CXX=g++ + export CXX + echo pyproject-rpm-macros + echo python3-devel + echo 'python3dist(pip) >= 19' + echo 'python3dist(packaging)' + '[' -f pyproject.toml ']' + echo '(python3dist(toml) if python3-devel < 3.11)' + rm -rfv '*.dist-info/' + '[' -f /usr/bin/python3 ']' + mkdir -p /builddir/build/BUILD/xarray-2023.1.0/.pyproject-builddir + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer ' + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 ' + TMPDIR=/builddir/build/BUILD/xarray-2023.1.0/.pyproject-builddir + RPM_TOXENV=py311 + HOSTNAME=rpmbuild + /usr/bin/python3 -Bs /usr/lib/rpm/redhat/pyproject_buildrequires.py --generate-extras --python3_pkgversion 3 --wheeldir /builddir/build/BUILD/xarray-2023.1.0/pyproject-wheeldir -r Handling setuptools>=42 from build-system.requires Requirement satisfied: setuptools>=42 (installed: setuptools 65.5.1) Handling setuptools-scm>=7 from build-system.requires Requirement satisfied: setuptools-scm>=7 (installed: setuptools-scm 7.1.0) /usr/lib/python3.11/site-packages/setuptools_scm/git.py:295: UserWarning: git archive did not support describe output warnings.warn("git archive did not support describe output") /usr/lib/python3.11/site-packages/setuptools_scm/git.py:312: UserWarning: unexported git archival found warnings.warn("unexported git archival found") HOOK STDOUT: running egg_info HOOK STDOUT: writing xarray.egg-info/PKG-INFO HOOK STDOUT: writing dependency_links to xarray.egg-info/dependency_links.txt HOOK STDOUT: writing requirements to xarray.egg-info/requires.txt HOOK STDOUT: writing top-level names to xarray.egg-info/top_level.txt HOOK STDOUT: reading manifest file 'xarray.egg-info/SOURCES.txt' HOOK STDOUT: adding license file 'LICENSE' HOOK STDOUT: writing manifest file 'xarray.egg-info/SOURCES.txt' Handling wheel from get_requires_for_build_wheel Requirement not satisfied: wheel Exiting dependency generation pass: get_requires_for_build_wheel + rm -rfv '*.dist-info/' + RPM_EC=0 ++ jobs -p + exit 0 Wrote: /builddir/build/SRPMS/python-xarray-2023.1.0-1.fc38.buildreqs.nosrc.rpm Child return code was: 11 Dynamic buildrequires detected Going to install missing buildrequires. See root.log for details. ENTER ['do_with_status'](['bash', '--login', '-c', '/usr/bin/rpmbuild -br --noclean --target noarch --nodeps /builddir/build/SPECS/python-xarray.spec'], chrootPath='/var/lib/mock/f38-build-side-42-init-devel-1090490-30049/root'env={'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8'}shell=Falselogger=timeout=864000uid=996gid=135user='mockbuild'nspawn_args=[]unshare_net=TrueraiseExc=FalseprintOutput=False) Executing command: ['bash', '--login', '-c', '/usr/bin/rpmbuild -br --noclean --target noarch --nodeps /builddir/build/SPECS/python-xarray.spec'] with env {'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8'} and shell False Building target platforms: noarch Building for target noarch setting SOURCE_DATE_EPOCH=1691798400 Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.UAmP82 + umask 022 + cd /builddir/build/BUILD + cd /builddir/build/BUILD + rm -rf xarray-2023.1.0 + /usr/lib/rpm/rpmuncompress -x /builddir/build/SOURCES/xarray-2023.1.0.tar.gz + STATUS=0 + '[' 0 -ne 0 ']' + cd xarray-2023.1.0 + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w . + /usr/lib/rpm/rpmuncompress /builddir/build/SOURCES/0001-DOC-Don-t-download-RGB.byte.tif-during-build.patch + /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f + /usr/lib/rpm/rpmuncompress /builddir/build/SOURCES/0002-DOC-Skip-examples-using-unpackaged-dependencies.patch + /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f + /usr/lib/rpm/rpmuncompress /builddir/build/SOURCES/0003-DOC-Don-t-print-out-conda-pip-environment.patch + /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f + RPM_EC=0 ++ jobs -p + exit 0 Executing(%generate_buildrequires): /bin/sh -e /var/tmp/rpm-tmp.YocfGr + umask 022 + cd /builddir/build/BUILD + cd xarray-2023.1.0 + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer ' + export CFLAGS + CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer ' + export CXXFLAGS + FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -I/usr/lib/gfortran/modules ' + export FFLAGS + FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -I/usr/lib/gfortran/modules ' + export FCFLAGS + VALAFLAGS=-g + export VALAFLAGS + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 ' + export LDFLAGS + LT_SYS_LIBRARY_PATH=/usr/lib: + export LT_SYS_LIBRARY_PATH + CC=gcc + export CC + CXX=g++ + export CXX + echo pyproject-rpm-macros + echo python3-devel + echo 'python3dist(pip) >= 19' + echo 'python3dist(packaging)' + '[' -f pyproject.toml ']' + echo '(python3dist(toml) if python3-devel < 3.11)' + rm -rfv '*.dist-info/' + '[' -f /usr/bin/python3 ']' + mkdir -p /builddir/build/BUILD/xarray-2023.1.0/.pyproject-builddir + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer ' + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 ' + TMPDIR=/builddir/build/BUILD/xarray-2023.1.0/.pyproject-builddir + RPM_TOXENV=py311 + HOSTNAME=rpmbuild + /usr/bin/python3 -Bs /usr/lib/rpm/redhat/pyproject_buildrequires.py --generate-extras --python3_pkgversion 3 --wheeldir /builddir/build/BUILD/xarray-2023.1.0/pyproject-wheeldir -r Handling setuptools>=42 from build-system.requires Requirement satisfied: setuptools>=42 (installed: setuptools 65.5.1) Handling setuptools-scm>=7 from build-system.requires Requirement satisfied: setuptools-scm>=7 (installed: setuptools-scm 7.1.0) /usr/lib/python3.11/site-packages/setuptools_scm/git.py:295: UserWarning: git archive did not support describe output warnings.warn("git archive did not support describe output") /usr/lib/python3.11/site-packages/setuptools_scm/git.py:312: UserWarning: unexported git archival found warnings.warn("unexported git archival found") HOOK STDOUT: running egg_info HOOK STDOUT: writing xarray.egg-info/PKG-INFO HOOK STDOUT: writing dependency_links to xarray.egg-info/dependency_links.txt HOOK STDOUT: writing requirements to xarray.egg-info/requires.txt HOOK STDOUT: writing top-level names to xarray.egg-info/top_level.txt HOOK STDOUT: reading manifest file 'xarray.egg-info/SOURCES.txt' HOOK STDOUT: adding license file 'LICENSE' HOOK STDOUT: writing manifest file 'xarray.egg-info/SOURCES.txt' Handling wheel from get_requires_for_build_wheel Requirement satisfied: wheel (installed: wheel 0.38.4) /usr/lib/python3.11/site-packages/setuptools_scm/git.py:295: UserWarning: git archive did not support describe output warnings.warn("git archive did not support describe output") /usr/lib/python3.11/site-packages/setuptools_scm/git.py:312: UserWarning: unexported git archival found warnings.warn("unexported git archival found") HOOK STDOUT: running dist_info HOOK STDOUT: writing xarray.egg-info/PKG-INFO HOOK STDOUT: writing dependency_links to xarray.egg-info/dependency_links.txt HOOK STDOUT: writing requirements to xarray.egg-info/requires.txt HOOK STDOUT: writing top-level names to xarray.egg-info/top_level.txt HOOK STDOUT: reading manifest file 'xarray.egg-info/SOURCES.txt' HOOK STDOUT: adding license file 'LICENSE' HOOK STDOUT: writing manifest file 'xarray.egg-info/SOURCES.txt' HOOK STDOUT: creating '/builddir/build/BUILD/xarray-2023.1.0/xarray-2023.1.0.dist-info' Handling numpy (>=1.20) from hook generated metadata: Requires-Dist Requirement satisfied: numpy (>=1.20) (installed: numpy 1.24.3) Handling pandas (>=1.3) from hook generated metadata: Requires-Dist Requirement satisfied: pandas (>=1.3) (installed: pandas 1.5.3) Handling packaging (>=21.3) from hook generated metadata: Requires-Dist Requirement satisfied: packaging (>=21.3) (installed: packaging 23.0) Handling scipy ; extra == 'accel' from hook generated metadata: Requires-Dist Ignoring alien requirement: scipy ; extra == 'accel' Handling bottleneck ; extra == 'accel' from hook generated metadata: Requires-Dist Ignoring alien requirement: bottleneck ; extra == 'accel' Handling numbagg ; extra == 'accel' from hook generated metadata: Requires-Dist Ignoring alien requirement: numbagg ; extra == 'accel' Handling flox ; extra == 'accel' from hook generated metadata: Requires-Dist Ignoring alien requirement: flox ; extra == 'accel' Handling netCDF4 ; extra == 'complete' from hook generated metadata: Requires-Dist Ignoring alien requirement: netCDF4 ; extra == 'complete' Handling h5netcdf ; extra == 'complete' from hook generated metadata: Requires-Dist Ignoring alien requirement: h5netcdf ; extra == 'complete' Handling scipy ; extra == 'complete' from hook generated metadata: Requires-Dist Ignoring alien requirement: scipy ; extra == 'complete' Handling zarr ; extra == 'complete' from hook generated metadata: Requires-Dist Ignoring alien requirement: zarr ; extra == 'complete' Handling fsspec ; extra == 'complete' from hook generated metadata: Requires-Dist Ignoring alien requirement: fsspec ; extra == 'complete' Handling cftime ; extra == 'complete' from hook generated metadata: Requires-Dist Ignoring alien requirement: cftime ; extra == 'complete' Handling rasterio ; extra == 'complete' from hook generated metadata: Requires-Dist Ignoring alien requirement: rasterio ; extra == 'complete' Handling cfgrib ; extra == 'complete' from hook generated metadata: Requires-Dist Ignoring alien requirement: cfgrib ; extra == 'complete' Handling pooch ; extra == 'complete' from hook generated metadata: Requires-Dist Ignoring alien requirement: pooch ; extra == 'complete' Handling bottleneck ; extra == 'complete' from hook generated metadata: Requires-Dist Ignoring alien requirement: bottleneck ; extra == 'complete' Handling numbagg ; extra == 'complete' from hook generated metadata: Requires-Dist Ignoring alien requirement: numbagg ; extra == 'complete' Handling flox ; extra == 'complete' from hook generated metadata: Requires-Dist Ignoring alien requirement: flox ; extra == 'complete' Handling dask[complete] ; extra == 'complete' from hook generated metadata: Requires-Dist Ignoring alien requirement: dask[complete] ; extra == 'complete' Handling matplotlib ; extra == 'complete' from hook generated metadata: Requires-Dist Ignoring alien requirement: matplotlib ; extra == 'complete' Handling seaborn ; extra == 'complete' from hook generated metadata: Requires-Dist Ignoring alien requirement: seaborn ; extra == 'complete' Handling nc-time-axis ; extra == 'complete' from hook generated metadata: Requires-Dist Ignoring alien requirement: nc-time-axis ; extra == 'complete' Handling pydap ; (python_version < "3.10") and extra == 'complete' from hook generated metadata: Requires-Dist Ignoring alien requirement: pydap ; (python_version < "3.10") and extra == 'complete' Handling netCDF4 ; extra == 'docs' from hook generated metadata: Requires-Dist Ignoring alien requirement: netCDF4 ; extra == 'docs' Handling h5netcdf ; extra == 'docs' from hook generated metadata: Requires-Dist Ignoring alien requirement: h5netcdf ; extra == 'docs' Handling scipy ; extra == 'docs' from hook generated metadata: Requires-Dist Ignoring alien requirement: scipy ; extra == 'docs' Handling zarr ; extra == 'docs' from hook generated metadata: Requires-Dist Ignoring alien requirement: zarr ; extra == 'docs' Handling fsspec ; extra == 'docs' from hook generated metadata: Requires-Dist Ignoring alien requirement: fsspec ; extra == 'docs' Handling cftime ; extra == 'docs' from hook generated metadata: Requires-Dist Ignoring alien requirement: cftime ; extra == 'docs' Handling rasterio ; extra == 'docs' from hook generated metadata: Requires-Dist Ignoring alien requirement: rasterio ; extra == 'docs' Handling cfgrib ; extra == 'docs' from hook generated metadata: Requires-Dist Ignoring alien requirement: cfgrib ; extra == 'docs' Handling pooch ; extra == 'docs' from hook generated metadata: Requires-Dist Ignoring alien requirement: pooch ; extra == 'docs' Handling bottleneck ; extra == 'docs' from hook generated metadata: Requires-Dist Ignoring alien requirement: bottleneck ; extra == 'docs' Handling numbagg ; extra == 'docs' from hook generated metadata: Requires-Dist Ignoring alien requirement: numbagg ; extra == 'docs' Handling flox ; extra == 'docs' from hook generated metadata: Requires-Dist Ignoring alien requirement: flox ; extra == 'docs' Handling dask[complete] ; extra == 'docs' from hook generated metadata: Requires-Dist Ignoring alien requirement: dask[complete] ; extra == 'docs' Handling matplotlib ; extra == 'docs' from hook generated metadata: Requires-Dist Ignoring alien requirement: matplotlib ; extra == 'docs' Handling seaborn ; extra == 'docs' from hook generated metadata: Requires-Dist Ignoring alien requirement: seaborn ; extra == 'docs' Handling nc-time-axis ; extra == 'docs' from hook generated metadata: Requires-Dist Ignoring alien requirement: nc-time-axis ; extra == 'docs' Handling sphinx-autosummary-accessors ; extra == 'docs' from hook generated metadata: Requires-Dist Ignoring alien requirement: sphinx-autosummary-accessors ; extra == 'docs' Handling sphinx-rtd-theme ; extra == 'docs' from hook generated metadata: Requires-Dist Ignoring alien requirement: sphinx-rtd-theme ; extra == 'docs' Handling ipython ; extra == 'docs' from hook generated metadata: Requires-Dist Ignoring alien requirement: ipython ; extra == 'docs' Handling ipykernel ; extra == 'docs' from hook generated metadata: Requires-Dist Ignoring alien requirement: ipykernel ; extra == 'docs' Handling jupyter-client ; extra == 'docs' from hook generated metadata: Requires-Dist Ignoring alien requirement: jupyter-client ; extra == 'docs' Handling nbsphinx ; extra == 'docs' from hook generated metadata: Requires-Dist Ignoring alien requirement: nbsphinx ; extra == 'docs' Handling scanpydoc ; extra == 'docs' from hook generated metadata: Requires-Dist Ignoring alien requirement: scanpydoc ; extra == 'docs' Handling pydap ; (python_version < "3.10") and extra == 'docs' from hook generated metadata: Requires-Dist Ignoring alien requirement: pydap ; (python_version < "3.10") and extra == 'docs' Handling netCDF4 ; extra == 'io' from hook generated metadata: Requires-Dist Ignoring alien requirement: netCDF4 ; extra == 'io' Handling h5netcdf ; extra == 'io' from hook generated metadata: Requires-Dist Ignoring alien requirement: h5netcdf ; extra == 'io' Handling scipy ; extra == 'io' from hook generated metadata: Requires-Dist Ignoring alien requirement: scipy ; extra == 'io' Handling zarr ; extra == 'io' from hook generated metadata: Requires-Dist Ignoring alien requirement: zarr ; extra == 'io' Handling fsspec ; extra == 'io' from hook generated metadata: Requires-Dist Ignoring alien requirement: fsspec ; extra == 'io' Handling cftime ; extra == 'io' from hook generated metadata: Requires-Dist Ignoring alien requirement: cftime ; extra == 'io' Handling rasterio ; extra == 'io' from hook generated metadata: Requires-Dist Ignoring alien requirement: rasterio ; extra == 'io' Handling cfgrib ; extra == 'io' from hook generated metadata: Requires-Dist Ignoring alien requirement: cfgrib ; extra == 'io' Handling pooch ; extra == 'io' from hook generated metadata: Requires-Dist Ignoring alien requirement: pooch ; extra == 'io' Handling pydap ; (python_version < "3.10") and extra == 'io' from hook generated metadata: Requires-Dist Ignoring alien requirement: pydap ; (python_version < "3.10") and extra == 'io' Handling dask[complete] ; extra == 'parallel' from hook generated metadata: Requires-Dist Ignoring alien requirement: dask[complete] ; extra == 'parallel' Handling matplotlib ; extra == 'viz' from hook generated metadata: Requires-Dist Ignoring alien requirement: matplotlib ; extra == 'viz' Handling seaborn ; extra == 'viz' from hook generated metadata: Requires-Dist Ignoring alien requirement: seaborn ; extra == 'viz' Handling nc-time-axis ; extra == 'viz' from hook generated metadata: Requires-Dist Ignoring alien requirement: nc-time-axis ; extra == 'viz' + rm -rfv xarray-2023.1.0.dist-info/ removed 'xarray-2023.1.0.dist-info/LICENSE' removed 'xarray-2023.1.0.dist-info/top_level.txt' removed 'xarray-2023.1.0.dist-info/METADATA' removed directory 'xarray-2023.1.0.dist-info/' + RPM_EC=0 ++ jobs -p + exit 0 Wrote: /builddir/build/SRPMS/python-xarray-2023.1.0-1.fc38.buildreqs.nosrc.rpm Child return code was: 11 Dynamic buildrequires detected Going to install missing buildrequires. See root.log for details. ENTER ['do_with_status'](['bash', '--login', '-c', '/usr/bin/rpmbuild -ba --noprep --noclean --target noarch --nodeps /builddir/build/SPECS/python-xarray.spec'], chrootPath='/var/lib/mock/f38-build-side-42-init-devel-1090490-30049/root'env={'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8'}shell=Falselogger=timeout=864000uid=996gid=135user='mockbuild'nspawn_args=[]unshare_net=TrueprintOutput=False) Executing command: ['bash', '--login', '-c', '/usr/bin/rpmbuild -ba --noprep --noclean --target noarch --nodeps /builddir/build/SPECS/python-xarray.spec'] with env {'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8'} and shell False Building target platforms: noarch Building for target noarch setting SOURCE_DATE_EPOCH=1691798400 Executing(%generate_buildrequires): /bin/sh -e /var/tmp/rpm-tmp.e6k1Ir + umask 022 + cd /builddir/build/BUILD + cd xarray-2023.1.0 + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer ' + export CFLAGS + CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer ' + export CXXFLAGS + FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -I/usr/lib/gfortran/modules ' + export FFLAGS + FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -I/usr/lib/gfortran/modules ' + export FCFLAGS + VALAFLAGS=-g + export VALAFLAGS + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 ' + export LDFLAGS + LT_SYS_LIBRARY_PATH=/usr/lib: + export LT_SYS_LIBRARY_PATH + CC=gcc + export CC + CXX=g++ + export CXX + echo pyproject-rpm-macros + echo python3-devel + echo 'python3dist(pip) >= 19' + echo 'python3dist(packaging)' + '[' -f pyproject.toml ']' + echo '(python3dist(toml) if python3-devel < 3.11)' + rm -rfv '*.dist-info/' + '[' -f /usr/bin/python3 ']' + mkdir -p /builddir/build/BUILD/xarray-2023.1.0/.pyproject-builddir + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer ' + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 ' + TMPDIR=/builddir/build/BUILD/xarray-2023.1.0/.pyproject-builddir + RPM_TOXENV=py311 + HOSTNAME=rpmbuild + /usr/bin/python3 -Bs /usr/lib/rpm/redhat/pyproject_buildrequires.py --generate-extras --python3_pkgversion 3 --wheeldir /builddir/build/BUILD/xarray-2023.1.0/pyproject-wheeldir -r Handling setuptools>=42 from build-system.requires Requirement satisfied: setuptools>=42 (installed: setuptools 65.5.1) Handling setuptools-scm>=7 from build-system.requires Requirement satisfied: setuptools-scm>=7 (installed: setuptools-scm 7.1.0) /usr/lib/python3.11/site-packages/setuptools_scm/git.py:295: UserWarning: git archive did not support describe output warnings.warn("git archive did not support describe output") /usr/lib/python3.11/site-packages/setuptools_scm/git.py:312: UserWarning: unexported git archival found warnings.warn("unexported git archival found") HOOK STDOUT: running egg_info HOOK STDOUT: writing xarray.egg-info/PKG-INFO HOOK STDOUT: writing dependency_links to xarray.egg-info/dependency_links.txt HOOK STDOUT: writing requirements to xarray.egg-info/requires.txt HOOK STDOUT: writing top-level names to xarray.egg-info/top_level.txt HOOK STDOUT: reading manifest file 'xarray.egg-info/SOURCES.txt' HOOK STDOUT: adding license file 'LICENSE' HOOK STDOUT: writing manifest file 'xarray.egg-info/SOURCES.txt' Handling wheel from get_requires_for_build_wheel Requirement satisfied: wheel (installed: wheel 0.38.4) /usr/lib/python3.11/site-packages/setuptools_scm/git.py:295: UserWarning: git archive did not support describe output warnings.warn("git archive did not support describe output") /usr/lib/python3.11/site-packages/setuptools_scm/git.py:312: UserWarning: unexported git archival found warnings.warn("unexported git archival found") HOOK STDOUT: running dist_info HOOK STDOUT: writing xarray.egg-info/PKG-INFO HOOK STDOUT: writing dependency_links to xarray.egg-info/dependency_links.txt HOOK STDOUT: writing requirements to xarray.egg-info/requires.txt HOOK STDOUT: writing top-level names to xarray.egg-info/top_level.txt HOOK STDOUT: reading manifest file 'xarray.egg-info/SOURCES.txt' HOOK STDOUT: adding license file 'LICENSE' HOOK STDOUT: writing manifest file 'xarray.egg-info/SOURCES.txt' HOOK STDOUT: creating '/builddir/build/BUILD/xarray-2023.1.0/xarray-2023.1.0.dist-info' Handling numpy (>=1.20) from hook generated metadata: Requires-Dist Requirement satisfied: numpy (>=1.20) (installed: numpy 1.24.3) Handling pandas (>=1.3) from hook generated metadata: Requires-Dist Requirement satisfied: pandas (>=1.3) (installed: pandas 1.5.3) Handling packaging (>=21.3) from hook generated metadata: Requires-Dist Requirement satisfied: packaging (>=21.3) (installed: packaging 23.0) Handling scipy ; extra == 'accel' from hook generated metadata: Requires-Dist Ignoring alien requirement: scipy ; extra == 'accel' Handling bottleneck ; extra == 'accel' from hook generated metadata: Requires-Dist Ignoring alien requirement: bottleneck ; extra == 'accel' Handling numbagg ; extra == 'accel' from hook generated metadata: Requires-Dist Ignoring alien requirement: numbagg ; extra == 'accel' Handling flox ; extra == 'accel' from hook generated metadata: Requires-Dist Ignoring alien requirement: flox ; extra == 'accel' Handling netCDF4 ; extra == 'complete' from hook generated metadata: Requires-Dist Ignoring alien requirement: netCDF4 ; extra == 'complete' Handling h5netcdf ; extra == 'complete' from hook generated metadata: Requires-Dist Ignoring alien requirement: h5netcdf ; extra == 'complete' Handling scipy ; extra == 'complete' from hook generated metadata: Requires-Dist Ignoring alien requirement: scipy ; extra == 'complete' Handling zarr ; extra == 'complete' from hook generated metadata: Requires-Dist Ignoring alien requirement: zarr ; extra == 'complete' Handling fsspec ; extra == 'complete' from hook generated metadata: Requires-Dist Ignoring alien requirement: fsspec ; extra == 'complete' Handling cftime ; extra == 'complete' from hook generated metadata: Requires-Dist Ignoring alien requirement: cftime ; extra == 'complete' Handling rasterio ; extra == 'complete' from hook generated metadata: Requires-Dist Ignoring alien requirement: rasterio ; extra == 'complete' Handling cfgrib ; extra == 'complete' from hook generated metadata: Requires-Dist Ignoring alien requirement: cfgrib ; extra == 'complete' Handling pooch ; extra == 'complete' from hook generated metadata: Requires-Dist Ignoring alien requirement: pooch ; extra == 'complete' Handling bottleneck ; extra == 'complete' from hook generated metadata: Requires-Dist Ignoring alien requirement: bottleneck ; extra == 'complete' Handling numbagg ; extra == 'complete' from hook generated metadata: Requires-Dist Ignoring alien requirement: numbagg ; extra == 'complete' Handling flox ; extra == 'complete' from hook generated metadata: Requires-Dist Ignoring alien requirement: flox ; extra == 'complete' Handling dask[complete] ; extra == 'complete' from hook generated metadata: Requires-Dist Ignoring alien requirement: dask[complete] ; extra == 'complete' Handling matplotlib ; extra == 'complete' from hook generated metadata: Requires-Dist Ignoring alien requirement: matplotlib ; extra == 'complete' Handling seaborn ; extra == 'complete' from hook generated metadata: Requires-Dist Ignoring alien requirement: seaborn ; extra == 'complete' Handling nc-time-axis ; extra == 'complete' from hook generated metadata: Requires-Dist Ignoring alien requirement: nc-time-axis ; extra == 'complete' Handling pydap ; (python_version < "3.10") and extra == 'complete' from hook generated metadata: Requires-Dist Ignoring alien requirement: pydap ; (python_version < "3.10") and extra == 'complete' Handling netCDF4 ; extra == 'docs' from hook generated metadata: Requires-Dist Ignoring alien requirement: netCDF4 ; extra == 'docs' Handling h5netcdf ; extra == 'docs' from hook generated metadata: Requires-Dist Ignoring alien requirement: h5netcdf ; extra == 'docs' Handling scipy ; extra == 'docs' from hook generated metadata: Requires-Dist Ignoring alien requirement: scipy ; extra == 'docs' Handling zarr ; extra == 'docs' from hook generated metadata: Requires-Dist Ignoring alien requirement: zarr ; extra == 'docs' Handling fsspec ; extra == 'docs' from hook generated metadata: Requires-Dist Ignoring alien requirement: fsspec ; extra == 'docs' Handling cftime ; extra == 'docs' from hook generated metadata: Requires-Dist Ignoring alien requirement: cftime ; extra == 'docs' Handling rasterio ; extra == 'docs' from hook generated metadata: Requires-Dist Ignoring alien requirement: rasterio ; extra == 'docs' Handling cfgrib ; extra == 'docs' from hook generated metadata: Requires-Dist Ignoring alien requirement: cfgrib ; extra == 'docs' Handling pooch ; extra == 'docs' from hook generated metadata: Requires-Dist Ignoring alien requirement: pooch ; extra == 'docs' Handling bottleneck ; extra == 'docs' from hook generated metadata: Requires-Dist Ignoring alien requirement: bottleneck ; extra == 'docs' Handling numbagg ; extra == 'docs' from hook generated metadata: Requires-Dist Ignoring alien requirement: numbagg ; extra == 'docs' Handling flox ; extra == 'docs' from hook generated metadata: Requires-Dist Ignoring alien requirement: flox ; extra == 'docs' Handling dask[complete] ; extra == 'docs' from hook generated metadata: Requires-Dist Ignoring alien requirement: dask[complete] ; extra == 'docs' Handling matplotlib ; extra == 'docs' from hook generated metadata: Requires-Dist Ignoring alien requirement: matplotlib ; extra == 'docs' Handling seaborn ; extra == 'docs' from hook generated metadata: Requires-Dist Ignoring alien requirement: seaborn ; extra == 'docs' Handling nc-time-axis ; extra == 'docs' from hook generated metadata: Requires-Dist Ignoring alien requirement: nc-time-axis ; extra == 'docs' Handling sphinx-autosummary-accessors ; extra == 'docs' from hook generated metadata: Requires-Dist Ignoring alien requirement: sphinx-autosummary-accessors ; extra == 'docs' Handling sphinx-rtd-theme ; extra == 'docs' from hook generated metadata: Requires-Dist Ignoring alien requirement: sphinx-rtd-theme ; extra == 'docs' Handling ipython ; extra == 'docs' from hook generated metadata: Requires-Dist Ignoring alien requirement: ipython ; extra == 'docs' Handling ipykernel ; extra == 'docs' from hook generated metadata: Requires-Dist Ignoring alien requirement: ipykernel ; extra == 'docs' Handling jupyter-client ; extra == 'docs' from hook generated metadata: Requires-Dist Ignoring alien requirement: jupyter-client ; extra == 'docs' Handling nbsphinx ; extra == 'docs' from hook generated metadata: Requires-Dist Ignoring alien requirement: nbsphinx ; extra == 'docs' Handling scanpydoc ; extra == 'docs' from hook generated metadata: Requires-Dist Ignoring alien requirement: scanpydoc ; extra == 'docs' Handling pydap ; (python_version < "3.10") and extra == 'docs' from hook generated metadata: Requires-Dist Ignoring alien requirement: pydap ; (python_version < "3.10") and extra == 'docs' Handling netCDF4 ; extra == 'io' from hook generated metadata: Requires-Dist Ignoring alien requirement: netCDF4 ; extra == 'io' Handling h5netcdf ; extra == 'io' from hook generated metadata: Requires-Dist Ignoring alien requirement: h5netcdf ; extra == 'io' Handling scipy ; extra == 'io' from hook generated metadata: Requires-Dist Ignoring alien requirement: scipy ; extra == 'io' Handling zarr ; extra == 'io' from hook generated metadata: Requires-Dist Ignoring alien requirement: zarr ; extra == 'io' Handling fsspec ; extra == 'io' from hook generated metadata: Requires-Dist Ignoring alien requirement: fsspec ; extra == 'io' Handling cftime ; extra == 'io' from hook generated metadata: Requires-Dist Ignoring alien requirement: cftime ; extra == 'io' Handling rasterio ; extra == 'io' from hook generated metadata: Requires-Dist Ignoring alien requirement: rasterio ; extra == 'io' Handling cfgrib ; extra == 'io' from hook generated metadata: Requires-Dist Ignoring alien requirement: cfgrib ; extra == 'io' Handling pooch ; extra == 'io' from hook generated metadata: Requires-Dist Ignoring alien requirement: pooch ; extra == 'io' Handling pydap ; (python_version < "3.10") and extra == 'io' from hook generated metadata: Requires-Dist Ignoring alien requirement: pydap ; (python_version < "3.10") and extra == 'io' Handling dask[complete] ; extra == 'parallel' from hook generated metadata: Requires-Dist Ignoring alien requirement: dask[complete] ; extra == 'parallel' Handling matplotlib ; extra == 'viz' from hook generated metadata: Requires-Dist Ignoring alien requirement: matplotlib ; extra == 'viz' Handling seaborn ; extra == 'viz' from hook generated metadata: Requires-Dist Ignoring alien requirement: seaborn ; extra == 'viz' Handling nc-time-axis ; extra == 'viz' from hook generated metadata: Requires-Dist Ignoring alien requirement: nc-time-axis ; extra == 'viz' + rm -rfv xarray-2023.1.0.dist-info/ removed 'xarray-2023.1.0.dist-info/LICENSE' removed 'xarray-2023.1.0.dist-info/top_level.txt' removed 'xarray-2023.1.0.dist-info/METADATA' removed directory 'xarray-2023.1.0.dist-info/' + RPM_EC=0 ++ jobs -p + exit 0 Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.DYbax3 + umask 022 + cd /builddir/build/BUILD + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer ' + export CFLAGS + CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer ' + export CXXFLAGS + FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -I/usr/lib/gfortran/modules ' + export FFLAGS + FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -I/usr/lib/gfortran/modules ' + export FCFLAGS + VALAFLAGS=-g + export VALAFLAGS + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 ' + export LDFLAGS + LT_SYS_LIBRARY_PATH=/usr/lib: + export LT_SYS_LIBRARY_PATH + CC=gcc + export CC + CXX=g++ + export CXX + cd xarray-2023.1.0 + mkdir -p /builddir/build/BUILD/xarray-2023.1.0/.pyproject-builddir + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer ' + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 ' + TMPDIR=/builddir/build/BUILD/xarray-2023.1.0/.pyproject-builddir + /usr/bin/python3 -Bs /usr/lib/rpm/redhat/pyproject_wheel.py /builddir/build/BUILD/xarray-2023.1.0/pyproject-wheeldir Processing /builddir/build/BUILD/xarray-2023.1.0 Preparing metadata (pyproject.toml): started Running command Preparing metadata (pyproject.toml) /usr/lib/python3.11/site-packages/setuptools_scm/git.py:295: UserWarning: git archive did not support describe output warnings.warn("git archive did not support describe output") /usr/lib/python3.11/site-packages/setuptools_scm/git.py:312: UserWarning: unexported git archival found warnings.warn("unexported git archival found") running dist_info creating /builddir/build/BUILD/xarray-2023.1.0/.pyproject-builddir/pip-modern-metadata-hvx9wz8u/xarray.egg-info writing /builddir/build/BUILD/xarray-2023.1.0/.pyproject-builddir/pip-modern-metadata-hvx9wz8u/xarray.egg-info/PKG-INFO writing dependency_links to /builddir/build/BUILD/xarray-2023.1.0/.pyproject-builddir/pip-modern-metadata-hvx9wz8u/xarray.egg-info/dependency_links.txt writing requirements to /builddir/build/BUILD/xarray-2023.1.0/.pyproject-builddir/pip-modern-metadata-hvx9wz8u/xarray.egg-info/requires.txt writing top-level names to /builddir/build/BUILD/xarray-2023.1.0/.pyproject-builddir/pip-modern-metadata-hvx9wz8u/xarray.egg-info/top_level.txt writing manifest file '/builddir/build/BUILD/xarray-2023.1.0/.pyproject-builddir/pip-modern-metadata-hvx9wz8u/xarray.egg-info/SOURCES.txt' reading manifest file '/builddir/build/BUILD/xarray-2023.1.0/.pyproject-builddir/pip-modern-metadata-hvx9wz8u/xarray.egg-info/SOURCES.txt' adding license file 'LICENSE' writing manifest file '/builddir/build/BUILD/xarray-2023.1.0/.pyproject-builddir/pip-modern-metadata-hvx9wz8u/xarray.egg-info/SOURCES.txt' creating '/builddir/build/BUILD/xarray-2023.1.0/.pyproject-builddir/pip-modern-metadata-hvx9wz8u/xarray-2023.1.0.dist-info' Preparing metadata (pyproject.toml): finished with status 'done' Building wheels for collected packages: xarray Building wheel for xarray (pyproject.toml): started Running command Building wheel for xarray (pyproject.toml) /usr/lib/python3.11/site-packages/setuptools_scm/git.py:295: UserWarning: git archive did not support describe output warnings.warn("git archive did not support describe output") /usr/lib/python3.11/site-packages/setuptools_scm/git.py:312: UserWarning: unexported git archival found warnings.warn("unexported git archival found") running bdist_wheel running build running build_py creating build creating build/lib creating build/lib/xarray copying xarray/conventions.py -> build/lib/xarray copying xarray/tutorial.py -> build/lib/xarray copying xarray/convert.py -> build/lib/xarray copying xarray/__init__.py -> build/lib/xarray copying xarray/testing.py -> build/lib/xarray creating build/lib/xarray/coding copying xarray/coding/strings.py -> build/lib/xarray/coding copying xarray/coding/variables.py -> build/lib/xarray/coding copying xarray/coding/cftime_offsets.py -> build/lib/xarray/coding copying xarray/coding/times.py -> build/lib/xarray/coding copying xarray/coding/cftimeindex.py -> build/lib/xarray/coding copying xarray/coding/calendar_ops.py -> build/lib/xarray/coding copying xarray/coding/__init__.py -> build/lib/xarray/coding copying xarray/coding/frequencies.py -> build/lib/xarray/coding creating build/lib/xarray/static copying xarray/static/__init__.py -> build/lib/xarray/static creating build/lib/xarray/plot copying xarray/plot/dataarray_plot.py -> build/lib/xarray/plot copying xarray/plot/facetgrid.py -> build/lib/xarray/plot copying xarray/plot/accessor.py -> build/lib/xarray/plot copying xarray/plot/__init__.py -> build/lib/xarray/plot copying xarray/plot/utils.py -> build/lib/xarray/plot copying xarray/plot/dataset_plot.py -> build/lib/xarray/plot creating build/lib/xarray/util copying xarray/util/deprecation_helpers.py -> build/lib/xarray/util copying xarray/util/generate_aggregations.py -> build/lib/xarray/util copying xarray/util/print_versions.py -> build/lib/xarray/util copying xarray/util/generate_ops.py -> build/lib/xarray/util copying xarray/util/__init__.py -> build/lib/xarray/util creating build/lib/xarray/tests copying xarray/tests/test_weighted.py -> build/lib/xarray/tests copying xarray/tests/test_concat.py -> build/lib/xarray/tests copying xarray/tests/test_ufuncs.py -> build/lib/xarray/tests copying xarray/tests/test_coding_times.py -> build/lib/xarray/tests copying xarray/tests/test_deprecation_helpers.py -> build/lib/xarray/tests copying xarray/tests/test_accessor_dt.py -> build/lib/xarray/tests copying xarray/tests/test_backends_common.py -> build/lib/xarray/tests copying xarray/tests/test_cupy.py -> build/lib/xarray/tests copying xarray/tests/test_utils.py -> build/lib/xarray/tests copying xarray/tests/test_distributed.py -> build/lib/xarray/tests copying xarray/tests/test_dataset.py -> build/lib/xarray/tests copying xarray/tests/test_plot.py -> build/lib/xarray/tests copying xarray/tests/test_interp.py -> build/lib/xarray/tests copying xarray/tests/test_cftimeindex_resample.py -> build/lib/xarray/tests copying xarray/tests/test_merge.py -> build/lib/xarray/tests copying xarray/tests/test_cftimeindex.py -> build/lib/xarray/tests copying xarray/tests/test_testing.py -> build/lib/xarray/tests copying xarray/tests/test_dtypes.py -> build/lib/xarray/tests copying xarray/tests/test_duck_array_ops.py -> build/lib/xarray/tests copying xarray/tests/test_formatting.py -> build/lib/xarray/tests copying xarray/tests/test_calendar_ops.py -> build/lib/xarray/tests copying xarray/tests/test_tutorial.py -> build/lib/xarray/tests copying xarray/tests/test_formatting_html.py -> build/lib/xarray/tests copying xarray/tests/test_backends_api.py -> build/lib/xarray/tests copying xarray/tests/test_backends_file_manager.py -> build/lib/xarray/tests copying xarray/tests/test_array_api.py -> build/lib/xarray/tests copying xarray/tests/test_extensions.py -> build/lib/xarray/tests copying xarray/tests/test_combine.py -> build/lib/xarray/tests copying xarray/tests/test_units.py -> build/lib/xarray/tests copying xarray/tests/test_coding_strings.py -> build/lib/xarray/tests copying xarray/tests/test_dataarray.py -> build/lib/xarray/tests copying xarray/tests/test_coding.py -> build/lib/xarray/tests copying xarray/tests/test_indexing.py -> build/lib/xarray/tests copying xarray/tests/test_options.py -> build/lib/xarray/tests copying xarray/tests/test_accessor_str.py -> build/lib/xarray/tests copying xarray/tests/test_indexes.py -> build/lib/xarray/tests copying xarray/tests/test_cftime_offsets.py -> build/lib/xarray/tests copying xarray/tests/test_backends_lru_cache.py -> build/lib/xarray/tests copying xarray/tests/test_plugins.py -> build/lib/xarray/tests copying xarray/tests/test_backends_locks.py -> build/lib/xarray/tests copying xarray/tests/test_missing.py -> build/lib/xarray/tests copying xarray/tests/test_nputils.py -> build/lib/xarray/tests copying xarray/tests/test_rolling.py -> build/lib/xarray/tests copying xarray/tests/test_dask.py -> build/lib/xarray/tests copying xarray/tests/conftest.py -> build/lib/xarray/tests copying xarray/tests/__init__.py -> build/lib/xarray/tests copying xarray/tests/test_conventions.py -> build/lib/xarray/tests copying xarray/tests/test_variable.py -> build/lib/xarray/tests copying xarray/tests/test_groupby.py -> build/lib/xarray/tests copying xarray/tests/test_print_versions.py -> build/lib/xarray/tests copying xarray/tests/test_sparse.py -> build/lib/xarray/tests copying xarray/tests/test_backends.py -> build/lib/xarray/tests copying xarray/tests/test_computation.py -> build/lib/xarray/tests copying xarray/tests/test_coarsen.py -> build/lib/xarray/tests creating build/lib/xarray/indexes copying xarray/indexes/__init__.py -> build/lib/xarray/indexes creating build/lib/xarray/core copying xarray/core/npcompat.py -> build/lib/xarray/core copying xarray/core/dataarray.py -> build/lib/xarray/core copying xarray/core/common.py -> build/lib/xarray/core copying xarray/core/nanops.py -> build/lib/xarray/core copying xarray/core/dataset.py -> build/lib/xarray/core copying xarray/core/arithmetic.py -> build/lib/xarray/core copying xarray/core/ops.py -> build/lib/xarray/core copying xarray/core/dask_array_ops.py -> build/lib/xarray/core copying xarray/core/rolling_exp.py -> build/lib/xarray/core copying xarray/core/accessor_dt.py -> build/lib/xarray/core copying xarray/core/merge.py -> build/lib/xarray/core copying xarray/core/_aggregations.py -> build/lib/xarray/core copying xarray/core/extensions.py -> build/lib/xarray/core copying xarray/core/formatting_html.py -> build/lib/xarray/core copying xarray/core/formatting.py -> build/lib/xarray/core copying xarray/core/resample.py -> build/lib/xarray/core copying xarray/core/indexes.py -> build/lib/xarray/core copying xarray/core/groupby.py -> build/lib/xarray/core copying xarray/core/weighted.py -> build/lib/xarray/core copying xarray/core/parallel.py -> build/lib/xarray/core copying xarray/core/concat.py -> build/lib/xarray/core copying xarray/core/indexing.py -> build/lib/xarray/core copying xarray/core/nputils.py -> build/lib/xarray/core copying xarray/core/pycompat.py -> build/lib/xarray/core copying xarray/core/rolling.py -> build/lib/xarray/core copying xarray/core/resample_cftime.py -> build/lib/xarray/core copying xarray/core/alignment.py -> build/lib/xarray/core copying xarray/core/dtypes.py -> build/lib/xarray/core copying xarray/core/pdcompat.py -> build/lib/xarray/core copying xarray/core/options.py -> build/lib/xarray/core copying xarray/core/types.py -> build/lib/xarray/core copying xarray/core/variable.py -> build/lib/xarray/core copying xarray/core/missing.py -> build/lib/xarray/core copying xarray/core/accessor_str.py -> build/lib/xarray/core copying xarray/core/duck_array_ops.py -> build/lib/xarray/core copying xarray/core/computation.py -> build/lib/xarray/core copying xarray/core/_typed_ops.py -> build/lib/xarray/core copying xarray/core/__init__.py -> build/lib/xarray/core copying xarray/core/utils.py -> build/lib/xarray/core copying xarray/core/coordinates.py -> build/lib/xarray/core copying xarray/core/combine.py -> build/lib/xarray/core creating build/lib/xarray/backends copying xarray/backends/pydap_.py -> build/lib/xarray/backends copying xarray/backends/common.py -> build/lib/xarray/backends copying xarray/backends/plugins.py -> build/lib/xarray/backends copying xarray/backends/api.py -> build/lib/xarray/backends copying xarray/backends/netcdf3.py -> build/lib/xarray/backends copying xarray/backends/netCDF4_.py -> build/lib/xarray/backends copying xarray/backends/h5netcdf_.py -> build/lib/xarray/backends copying xarray/backends/scipy_.py -> build/lib/xarray/backends copying xarray/backends/pseudonetcdf_.py -> build/lib/xarray/backends copying xarray/backends/lru_cache.py -> build/lib/xarray/backends copying xarray/backends/locks.py -> build/lib/xarray/backends copying xarray/backends/store.py -> build/lib/xarray/backends copying xarray/backends/pynio_.py -> build/lib/xarray/backends copying xarray/backends/file_manager.py -> build/lib/xarray/backends copying xarray/backends/memory.py -> build/lib/xarray/backends copying xarray/backends/cfgrib_.py -> build/lib/xarray/backends copying xarray/backends/zarr.py -> build/lib/xarray/backends copying xarray/backends/__init__.py -> build/lib/xarray/backends copying xarray/backends/rasterio_.py -> build/lib/xarray/backends creating build/lib/xarray/static/html copying xarray/static/html/__init__.py -> build/lib/xarray/static/html creating build/lib/xarray/static/css copying xarray/static/css/__init__.py -> build/lib/xarray/static/css running egg_info writing xarray.egg-info/PKG-INFO writing dependency_links to xarray.egg-info/dependency_links.txt writing requirements to xarray.egg-info/requires.txt writing top-level names to xarray.egg-info/top_level.txt reading manifest file 'xarray.egg-info/SOURCES.txt' adding license file 'LICENSE' writing manifest file 'xarray.egg-info/SOURCES.txt' /usr/lib/python3.11/site-packages/setuptools/command/build_py.py:202: SetuptoolsDeprecationWarning: Installing 'xarray.tests.data' as data is deprecated, please list it in `packages`. !! ############################ # Package would be ignored # ############################ Python recognizes 'xarray.tests.data' as an importable package, but it is not listed in the `packages` configuration of setuptools. 'xarray.tests.data' has been automatically added to the distribution only because it may contain data files, but this behavior is likely to change in future versions of setuptools (and therefore is considered deprecated). Please make sure that 'xarray.tests.data' is included as a package by using the `packages` configuration field or the proper discovery methods (for example by using `find_namespace_packages(...)`/`find_namespace:` instead of `find_packages(...)`/`find:`). You can read more about "package discovery" and "data files" on setuptools documentation page. !! check.warn(importable) copying xarray/py.typed -> build/lib/xarray creating build/lib/xarray/tests/data copying xarray/tests/data/example.grib -> build/lib/xarray/tests/data copying xarray/tests/data/example_1.nc -> build/lib/xarray/tests/data copying xarray/tests/data/bears.nc -> build/lib/xarray/tests/data copying xarray/tests/data/example.uamiv -> build/lib/xarray/tests/data copying xarray/tests/data/example.ict -> build/lib/xarray/tests/data copying xarray/tests/data/example_1.nc.gz -> build/lib/xarray/tests/data copying xarray/static/css/style.css -> build/lib/xarray/static/css copying xarray/static/html/icons-svg-inline.html -> build/lib/xarray/static/html copying xarray/core/_typed_ops.pyi -> build/lib/xarray/core installing to build/bdist.linux-riscv64/wheel running install running install_lib creating build/bdist.linux-riscv64 creating build/bdist.linux-riscv64/wheel creating build/bdist.linux-riscv64/wheel/xarray creating build/bdist.linux-riscv64/wheel/xarray/coding copying build/lib/xarray/coding/strings.py -> build/bdist.linux-riscv64/wheel/xarray/coding copying build/lib/xarray/coding/variables.py -> build/bdist.linux-riscv64/wheel/xarray/coding copying build/lib/xarray/coding/cftime_offsets.py -> build/bdist.linux-riscv64/wheel/xarray/coding copying build/lib/xarray/coding/times.py -> build/bdist.linux-riscv64/wheel/xarray/coding copying build/lib/xarray/coding/cftimeindex.py -> build/bdist.linux-riscv64/wheel/xarray/coding copying build/lib/xarray/coding/calendar_ops.py -> build/bdist.linux-riscv64/wheel/xarray/coding copying build/lib/xarray/coding/__init__.py -> build/bdist.linux-riscv64/wheel/xarray/coding copying build/lib/xarray/coding/frequencies.py -> build/bdist.linux-riscv64/wheel/xarray/coding copying build/lib/xarray/conventions.py -> build/bdist.linux-riscv64/wheel/xarray copying build/lib/xarray/tutorial.py -> build/bdist.linux-riscv64/wheel/xarray creating build/bdist.linux-riscv64/wheel/xarray/static creating build/bdist.linux-riscv64/wheel/xarray/static/html copying build/lib/xarray/static/html/icons-svg-inline.html -> build/bdist.linux-riscv64/wheel/xarray/static/html copying build/lib/xarray/static/html/__init__.py -> build/bdist.linux-riscv64/wheel/xarray/static/html creating build/bdist.linux-riscv64/wheel/xarray/static/css copying build/lib/xarray/static/css/style.css -> build/bdist.linux-riscv64/wheel/xarray/static/css copying build/lib/xarray/static/css/__init__.py -> build/bdist.linux-riscv64/wheel/xarray/static/css copying build/lib/xarray/static/__init__.py -> build/bdist.linux-riscv64/wheel/xarray/static creating build/bdist.linux-riscv64/wheel/xarray/plot copying build/lib/xarray/plot/dataarray_plot.py -> build/bdist.linux-riscv64/wheel/xarray/plot copying build/lib/xarray/plot/facetgrid.py -> build/bdist.linux-riscv64/wheel/xarray/plot copying build/lib/xarray/plot/accessor.py -> build/bdist.linux-riscv64/wheel/xarray/plot copying build/lib/xarray/plot/__init__.py -> build/bdist.linux-riscv64/wheel/xarray/plot copying build/lib/xarray/plot/utils.py -> build/bdist.linux-riscv64/wheel/xarray/plot copying build/lib/xarray/plot/dataset_plot.py -> build/bdist.linux-riscv64/wheel/xarray/plot creating build/bdist.linux-riscv64/wheel/xarray/util copying build/lib/xarray/util/deprecation_helpers.py -> build/bdist.linux-riscv64/wheel/xarray/util copying build/lib/xarray/util/generate_aggregations.py -> build/bdist.linux-riscv64/wheel/xarray/util copying build/lib/xarray/util/print_versions.py -> build/bdist.linux-riscv64/wheel/xarray/util copying build/lib/xarray/util/generate_ops.py -> build/bdist.linux-riscv64/wheel/xarray/util copying build/lib/xarray/util/__init__.py -> build/bdist.linux-riscv64/wheel/xarray/util copying build/lib/xarray/convert.py -> build/bdist.linux-riscv64/wheel/xarray copying build/lib/xarray/py.typed -> build/bdist.linux-riscv64/wheel/xarray creating build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_weighted.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_concat.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_ufuncs.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_coding_times.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_deprecation_helpers.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_accessor_dt.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_backends_common.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_cupy.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_utils.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_distributed.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_dataset.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_plot.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_interp.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_cftimeindex_resample.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_merge.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_cftimeindex.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_testing.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_dtypes.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_duck_array_ops.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_formatting.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_calendar_ops.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_tutorial.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_formatting_html.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_backends_api.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_backends_file_manager.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_array_api.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_extensions.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_combine.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_units.py -> build/bdist.linux-riscv64/wheel/xarray/tests creating build/bdist.linux-riscv64/wheel/xarray/tests/data copying build/lib/xarray/tests/data/example.grib -> build/bdist.linux-riscv64/wheel/xarray/tests/data copying build/lib/xarray/tests/data/example_1.nc -> build/bdist.linux-riscv64/wheel/xarray/tests/data copying build/lib/xarray/tests/data/bears.nc -> build/bdist.linux-riscv64/wheel/xarray/tests/data copying build/lib/xarray/tests/data/example.uamiv -> build/bdist.linux-riscv64/wheel/xarray/tests/data copying build/lib/xarray/tests/data/example.ict -> build/bdist.linux-riscv64/wheel/xarray/tests/data copying build/lib/xarray/tests/data/example_1.nc.gz -> build/bdist.linux-riscv64/wheel/xarray/tests/data copying build/lib/xarray/tests/test_coding_strings.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_dataarray.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_coding.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_indexing.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_options.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_accessor_str.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_indexes.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_cftime_offsets.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_backends_lru_cache.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_plugins.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_backends_locks.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_missing.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_nputils.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_rolling.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_dask.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/conftest.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/__init__.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_conventions.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_variable.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_groupby.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_print_versions.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_sparse.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_backends.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_computation.py -> build/bdist.linux-riscv64/wheel/xarray/tests copying build/lib/xarray/tests/test_coarsen.py -> build/bdist.linux-riscv64/wheel/xarray/tests creating build/bdist.linux-riscv64/wheel/xarray/indexes copying build/lib/xarray/indexes/__init__.py -> build/bdist.linux-riscv64/wheel/xarray/indexes copying build/lib/xarray/__init__.py -> build/bdist.linux-riscv64/wheel/xarray creating build/bdist.linux-riscv64/wheel/xarray/core copying build/lib/xarray/core/npcompat.py -> build/bdist.linux-riscv64/wheel/xarray/core copying build/lib/xarray/core/dataarray.py -> build/bdist.linux-riscv64/wheel/xarray/core copying build/lib/xarray/core/common.py -> build/bdist.linux-riscv64/wheel/xarray/core copying build/lib/xarray/core/nanops.py -> build/bdist.linux-riscv64/wheel/xarray/core copying build/lib/xarray/core/dataset.py -> build/bdist.linux-riscv64/wheel/xarray/core copying build/lib/xarray/core/arithmetic.py -> build/bdist.linux-riscv64/wheel/xarray/core copying build/lib/xarray/core/ops.py -> build/bdist.linux-riscv64/wheel/xarray/core copying build/lib/xarray/core/dask_array_ops.py -> build/bdist.linux-riscv64/wheel/xarray/core copying build/lib/xarray/core/rolling_exp.py -> build/bdist.linux-riscv64/wheel/xarray/core copying build/lib/xarray/core/accessor_dt.py -> build/bdist.linux-riscv64/wheel/xarray/core copying build/lib/xarray/core/merge.py -> build/bdist.linux-riscv64/wheel/xarray/core copying build/lib/xarray/core/_aggregations.py -> build/bdist.linux-riscv64/wheel/xarray/core copying build/lib/xarray/core/extensions.py -> build/bdist.linux-riscv64/wheel/xarray/core copying build/lib/xarray/core/formatting_html.py -> build/bdist.linux-riscv64/wheel/xarray/core copying build/lib/xarray/core/formatting.py -> build/bdist.linux-riscv64/wheel/xarray/core copying build/lib/xarray/core/resample.py -> build/bdist.linux-riscv64/wheel/xarray/core copying build/lib/xarray/core/indexes.py -> build/bdist.linux-riscv64/wheel/xarray/core copying build/lib/xarray/core/groupby.py -> build/bdist.linux-riscv64/wheel/xarray/core copying build/lib/xarray/core/weighted.py -> build/bdist.linux-riscv64/wheel/xarray/core copying build/lib/xarray/core/parallel.py -> build/bdist.linux-riscv64/wheel/xarray/core copying build/lib/xarray/core/concat.py -> build/bdist.linux-riscv64/wheel/xarray/core copying build/lib/xarray/core/indexing.py -> build/bdist.linux-riscv64/wheel/xarray/core copying build/lib/xarray/core/nputils.py -> build/bdist.linux-riscv64/wheel/xarray/core copying build/lib/xarray/core/pycompat.py -> build/bdist.linux-riscv64/wheel/xarray/core copying build/lib/xarray/core/rolling.py -> build/bdist.linux-riscv64/wheel/xarray/core copying build/lib/xarray/core/resample_cftime.py -> build/bdist.linux-riscv64/wheel/xarray/core copying build/lib/xarray/core/alignment.py -> build/bdist.linux-riscv64/wheel/xarray/core copying build/lib/xarray/core/dtypes.py -> build/bdist.linux-riscv64/wheel/xarray/core copying build/lib/xarray/core/pdcompat.py -> build/bdist.linux-riscv64/wheel/xarray/core copying build/lib/xarray/core/_typed_ops.pyi -> build/bdist.linux-riscv64/wheel/xarray/core copying build/lib/xarray/core/options.py -> build/bdist.linux-riscv64/wheel/xarray/core copying build/lib/xarray/core/types.py -> build/bdist.linux-riscv64/wheel/xarray/core copying build/lib/xarray/core/variable.py -> build/bdist.linux-riscv64/wheel/xarray/core copying build/lib/xarray/core/missing.py -> build/bdist.linux-riscv64/wheel/xarray/core copying build/lib/xarray/core/accessor_str.py -> build/bdist.linux-riscv64/wheel/xarray/core copying build/lib/xarray/core/duck_array_ops.py -> build/bdist.linux-riscv64/wheel/xarray/core copying build/lib/xarray/core/computation.py -> build/bdist.linux-riscv64/wheel/xarray/core copying build/lib/xarray/core/_typed_ops.py -> build/bdist.linux-riscv64/wheel/xarray/core copying build/lib/xarray/core/__init__.py -> build/bdist.linux-riscv64/wheel/xarray/core copying build/lib/xarray/core/utils.py -> build/bdist.linux-riscv64/wheel/xarray/core copying build/lib/xarray/core/coordinates.py -> build/bdist.linux-riscv64/wheel/xarray/core copying build/lib/xarray/core/combine.py -> build/bdist.linux-riscv64/wheel/xarray/core copying build/lib/xarray/testing.py -> build/bdist.linux-riscv64/wheel/xarray creating build/bdist.linux-riscv64/wheel/xarray/backends copying build/lib/xarray/backends/pydap_.py -> build/bdist.linux-riscv64/wheel/xarray/backends copying build/lib/xarray/backends/common.py -> build/bdist.linux-riscv64/wheel/xarray/backends copying build/lib/xarray/backends/plugins.py -> build/bdist.linux-riscv64/wheel/xarray/backends copying build/lib/xarray/backends/api.py -> build/bdist.linux-riscv64/wheel/xarray/backends copying build/lib/xarray/backends/netcdf3.py -> build/bdist.linux-riscv64/wheel/xarray/backends copying build/lib/xarray/backends/netCDF4_.py -> build/bdist.linux-riscv64/wheel/xarray/backends copying build/lib/xarray/backends/h5netcdf_.py -> build/bdist.linux-riscv64/wheel/xarray/backends copying build/lib/xarray/backends/scipy_.py -> build/bdist.linux-riscv64/wheel/xarray/backends copying build/lib/xarray/backends/pseudonetcdf_.py -> build/bdist.linux-riscv64/wheel/xarray/backends copying build/lib/xarray/backends/lru_cache.py -> build/bdist.linux-riscv64/wheel/xarray/backends copying build/lib/xarray/backends/locks.py -> build/bdist.linux-riscv64/wheel/xarray/backends copying build/lib/xarray/backends/store.py -> build/bdist.linux-riscv64/wheel/xarray/backends copying build/lib/xarray/backends/pynio_.py -> build/bdist.linux-riscv64/wheel/xarray/backends copying build/lib/xarray/backends/file_manager.py -> build/bdist.linux-riscv64/wheel/xarray/backends copying build/lib/xarray/backends/memory.py -> build/bdist.linux-riscv64/wheel/xarray/backends copying build/lib/xarray/backends/cfgrib_.py -> build/bdist.linux-riscv64/wheel/xarray/backends copying build/lib/xarray/backends/zarr.py -> build/bdist.linux-riscv64/wheel/xarray/backends copying build/lib/xarray/backends/__init__.py -> build/bdist.linux-riscv64/wheel/xarray/backends copying build/lib/xarray/backends/rasterio_.py -> build/bdist.linux-riscv64/wheel/xarray/backends running install_egg_info Copying xarray.egg-info to build/bdist.linux-riscv64/wheel/xarray-2023.1.0-py3.11.egg-info running install_scripts creating build/bdist.linux-riscv64/wheel/xarray-2023.1.0.dist-info/WHEEL creating '/builddir/build/BUILD/xarray-2023.1.0/.pyproject-builddir/pip-wheel-70w5i0i3/tmpvcdq2cfs/xarray-2023.1.0-py3-none-any.whl' and adding 'build/bdist.linux-riscv64/wheel' to it adding 'xarray/__init__.py' adding 'xarray/conventions.py' adding 'xarray/convert.py' adding 'xarray/py.typed' adding 'xarray/testing.py' adding 'xarray/tutorial.py' adding 'xarray/backends/__init__.py' adding 'xarray/backends/api.py' adding 'xarray/backends/cfgrib_.py' adding 'xarray/backends/common.py' adding 'xarray/backends/file_manager.py' adding 'xarray/backends/h5netcdf_.py' adding 'xarray/backends/locks.py' adding 'xarray/backends/lru_cache.py' adding 'xarray/backends/memory.py' adding 'xarray/backends/netCDF4_.py' adding 'xarray/backends/netcdf3.py' adding 'xarray/backends/plugins.py' adding 'xarray/backends/pseudonetcdf_.py' adding 'xarray/backends/pydap_.py' adding 'xarray/backends/pynio_.py' adding 'xarray/backends/rasterio_.py' adding 'xarray/backends/scipy_.py' adding 'xarray/backends/store.py' adding 'xarray/backends/zarr.py' adding 'xarray/coding/__init__.py' adding 'xarray/coding/calendar_ops.py' adding 'xarray/coding/cftime_offsets.py' adding 'xarray/coding/cftimeindex.py' adding 'xarray/coding/frequencies.py' adding 'xarray/coding/strings.py' adding 'xarray/coding/times.py' adding 'xarray/coding/variables.py' adding 'xarray/core/__init__.py' adding 'xarray/core/_aggregations.py' adding 'xarray/core/_typed_ops.py' adding 'xarray/core/_typed_ops.pyi' adding 'xarray/core/accessor_dt.py' adding 'xarray/core/accessor_str.py' adding 'xarray/core/alignment.py' adding 'xarray/core/arithmetic.py' adding 'xarray/core/combine.py' adding 'xarray/core/common.py' adding 'xarray/core/computation.py' adding 'xarray/core/concat.py' adding 'xarray/core/coordinates.py' adding 'xarray/core/dask_array_ops.py' adding 'xarray/core/dataarray.py' adding 'xarray/core/dataset.py' adding 'xarray/core/dtypes.py' adding 'xarray/core/duck_array_ops.py' adding 'xarray/core/extensions.py' adding 'xarray/core/formatting.py' adding 'xarray/core/formatting_html.py' adding 'xarray/core/groupby.py' adding 'xarray/core/indexes.py' adding 'xarray/core/indexing.py' adding 'xarray/core/merge.py' adding 'xarray/core/missing.py' adding 'xarray/core/nanops.py' adding 'xarray/core/npcompat.py' adding 'xarray/core/nputils.py' adding 'xarray/core/ops.py' adding 'xarray/core/options.py' adding 'xarray/core/parallel.py' adding 'xarray/core/pdcompat.py' adding 'xarray/core/pycompat.py' adding 'xarray/core/resample.py' adding 'xarray/core/resample_cftime.py' adding 'xarray/core/rolling.py' adding 'xarray/core/rolling_exp.py' adding 'xarray/core/types.py' adding 'xarray/core/utils.py' adding 'xarray/core/variable.py' adding 'xarray/core/weighted.py' adding 'xarray/indexes/__init__.py' adding 'xarray/plot/__init__.py' adding 'xarray/plot/accessor.py' adding 'xarray/plot/dataarray_plot.py' adding 'xarray/plot/dataset_plot.py' adding 'xarray/plot/facetgrid.py' adding 'xarray/plot/utils.py' adding 'xarray/static/__init__.py' adding 'xarray/static/css/__init__.py' adding 'xarray/static/css/style.css' adding 'xarray/static/html/__init__.py' adding 'xarray/static/html/icons-svg-inline.html' adding 'xarray/tests/__init__.py' adding 'xarray/tests/conftest.py' adding 'xarray/tests/test_accessor_dt.py' adding 'xarray/tests/test_accessor_str.py' adding 'xarray/tests/test_array_api.py' adding 'xarray/tests/test_backends.py' adding 'xarray/tests/test_backends_api.py' adding 'xarray/tests/test_backends_common.py' adding 'xarray/tests/test_backends_file_manager.py' adding 'xarray/tests/test_backends_locks.py' adding 'xarray/tests/test_backends_lru_cache.py' adding 'xarray/tests/test_calendar_ops.py' adding 'xarray/tests/test_cftime_offsets.py' adding 'xarray/tests/test_cftimeindex.py' adding 'xarray/tests/test_cftimeindex_resample.py' adding 'xarray/tests/test_coarsen.py' adding 'xarray/tests/test_coding.py' adding 'xarray/tests/test_coding_strings.py' adding 'xarray/tests/test_coding_times.py' adding 'xarray/tests/test_combine.py' adding 'xarray/tests/test_computation.py' adding 'xarray/tests/test_concat.py' adding 'xarray/tests/test_conventions.py' adding 'xarray/tests/test_cupy.py' adding 'xarray/tests/test_dask.py' adding 'xarray/tests/test_dataarray.py' adding 'xarray/tests/test_dataset.py' adding 'xarray/tests/test_deprecation_helpers.py' adding 'xarray/tests/test_distributed.py' adding 'xarray/tests/test_dtypes.py' adding 'xarray/tests/test_duck_array_ops.py' adding 'xarray/tests/test_extensions.py' adding 'xarray/tests/test_formatting.py' adding 'xarray/tests/test_formatting_html.py' adding 'xarray/tests/test_groupby.py' adding 'xarray/tests/test_indexes.py' adding 'xarray/tests/test_indexing.py' adding 'xarray/tests/test_interp.py' adding 'xarray/tests/test_merge.py' adding 'xarray/tests/test_missing.py' adding 'xarray/tests/test_nputils.py' adding 'xarray/tests/test_options.py' adding 'xarray/tests/test_plot.py' adding 'xarray/tests/test_plugins.py' adding 'xarray/tests/test_print_versions.py' adding 'xarray/tests/test_rolling.py' adding 'xarray/tests/test_sparse.py' adding 'xarray/tests/test_testing.py' adding 'xarray/tests/test_tutorial.py' adding 'xarray/tests/test_ufuncs.py' adding 'xarray/tests/test_units.py' adding 'xarray/tests/test_utils.py' adding 'xarray/tests/test_variable.py' adding 'xarray/tests/test_weighted.py' adding 'xarray/tests/data/bears.nc' adding 'xarray/tests/data/example.grib' adding 'xarray/tests/data/example.ict' adding 'xarray/tests/data/example.uamiv' adding 'xarray/tests/data/example_1.nc' adding 'xarray/tests/data/example_1.nc.gz' adding 'xarray/util/__init__.py' adding 'xarray/util/deprecation_helpers.py' adding 'xarray/util/generate_aggregations.py' adding 'xarray/util/generate_ops.py' adding 'xarray/util/print_versions.py' adding 'xarray-2023.1.0.dist-info/LICENSE' adding 'xarray-2023.1.0.dist-info/METADATA' adding 'xarray-2023.1.0.dist-info/WHEEL' adding 'xarray-2023.1.0.dist-info/top_level.txt' adding 'xarray-2023.1.0.dist-info/RECORD' removing build/bdist.linux-riscv64/wheel Building wheel for xarray (pyproject.toml): finished with status 'done' Created wheel for xarray: filename=xarray-2023.1.0-py3-none-any.whl size=973057 sha256=fe63005ad08c093bb458fd559cbb8e83f3e710a8914dfcade8416969e74b4a26 Stored in directory: /builddir/.cache/pip/wheels/f5/76/cd/200bc5fbd725c66d9a664a1beab05a23bb423ce921988615b1 Successfully built xarray + RPM_EC=0 ++ jobs -p + exit 0 Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.k1j2HG + umask 022 + cd /builddir/build/BUILD + '[' /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch '!=' / ']' + rm -rf /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch ++ dirname /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch + mkdir -p /builddir/build/BUILDROOT + mkdir /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer ' + export CFLAGS + CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer ' + export CXXFLAGS + FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -I/usr/lib/gfortran/modules ' + export FFLAGS + FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -I/usr/lib/gfortran/modules ' + export FCFLAGS + VALAFLAGS=-g + export VALAFLAGS + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 ' + export LDFLAGS + LT_SYS_LIBRARY_PATH=/usr/lib: + export LT_SYS_LIBRARY_PATH + CC=gcc + export CC + CXX=g++ + export CXX + cd xarray-2023.1.0 ++ xargs basename --multiple ++ sed -E 's/([^-]+)-([^-]+)-.+\.whl/\1==\2/' ++ ls /builddir/build/BUILD/xarray-2023.1.0/pyproject-wheeldir/xarray-2023.1.0-py3-none-any.whl + specifier=xarray==2023.1.0 + TMPDIR=/builddir/build/BUILD/xarray-2023.1.0/.pyproject-builddir + /usr/bin/python3 -m pip install --root /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch --prefix /usr --no-deps --disable-pip-version-check --progress-bar off --verbose --ignore-installed --no-warn-script-location --no-index --no-cache-dir --find-links /builddir/build/BUILD/xarray-2023.1.0/pyproject-wheeldir xarray==2023.1.0 Using pip 22.3.1 from /usr/lib/python3.11/site-packages/pip (python 3.11) Looking in links: /builddir/build/BUILD/xarray-2023.1.0/pyproject-wheeldir Processing ./pyproject-wheeldir/xarray-2023.1.0-py3-none-any.whl Installing collected packages: xarray Successfully installed xarray-2023.1.0 + '[' -d /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/bin ']' + rm -f /builddir/build/BUILD/python-xarray-2023.1.0-1.fc38.noarch-pyproject-ghost-distinfo + site_dirs=() + '[' -d /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages ']' + site_dirs+=("/usr/lib/python3.11/site-packages") + '[' /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib64/python3.11/site-packages '!=' /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages ']' + '[' -d /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib64/python3.11/site-packages ']' + for site_dir in ${site_dirs[@]} + for distinfo in /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch$site_dir/*.dist-info + echo '%ghost /usr/lib/python3.11/site-packages/xarray-2023.1.0.dist-info' + sed -i s/pip/rpm/ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray-2023.1.0.dist-info/INSTALLER + PYTHONPATH=/usr/lib/rpm/redhat + /usr/bin/python3 -B /usr/lib/rpm/redhat/pyproject_preprocess_record.py --buildroot /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch --record /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray-2023.1.0.dist-info/RECORD --output /builddir/build/BUILD/python-xarray-2023.1.0-1.fc38.noarch-pyproject-record + rm -fv /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray-2023.1.0.dist-info/RECORD removed '/builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray-2023.1.0.dist-info/RECORD' + rm -fv /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray-2023.1.0.dist-info/REQUESTED removed '/builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray-2023.1.0.dist-info/REQUESTED' ++ wc -l /builddir/build/BUILD/python-xarray-2023.1.0-1.fc38.noarch-pyproject-ghost-distinfo ++ cut -f1 '-d ' + lines=1 + '[' 1 -ne 1 ']' + /usr/bin/python3 /usr/lib/rpm/redhat/pyproject_save_files.py --output-files /builddir/build/BUILD/python-xarray-2023.1.0-1.fc38.noarch-pyproject-files --output-modules /builddir/build/BUILD/python-xarray-2023.1.0-1.fc38.noarch-pyproject-modules --buildroot /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch --sitelib /usr/lib/python3.11/site-packages --sitearch /usr/lib64/python3.11/site-packages --python-version 3.11 --pyproject-record /builddir/build/BUILD/python-xarray-2023.1.0-1.fc38.noarch-pyproject-record --prefix /usr xarray + /usr/bin/find-debuginfo -j8 --strict-build-id -m -i --build-id-seed 2023.1.0-1.fc38 --unique-debug-suffix -2023.1.0-1.fc38.noarch --unique-debug-src-base python-xarray-2023.1.0-1.fc38.noarch --run-dwz --dwz-low-mem-die-limit 10000000 --dwz-max-die-limit 50000000 -S debugsourcefiles.list /builddir/build/BUILD/xarray-2023.1.0 find: 'debug': No such file or directory + /usr/lib/rpm/check-buildroot + /usr/lib/rpm/redhat/brp-ldconfig + /usr/lib/rpm/brp-compress + /usr/lib/rpm/redhat/brp-strip-lto /usr/bin/strip + /usr/lib/rpm/brp-strip-static-archive /usr/bin/strip + /usr/lib/rpm/check-rpaths + /usr/lib/rpm/redhat/brp-mangle-shebangs + /usr/lib/rpm/brp-remove-la-files + env /usr/lib/rpm/redhat/brp-python-bytecompile '' 1 0 -j8 Bytecompiling .py files below /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11 using python3.11 + /usr/lib/rpm/redhat/brp-python-hardlink Executing(%check): /bin/sh -e /var/tmp/rpm-tmp.K1YMlG + umask 022 + cd /builddir/build/BUILD + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer ' + export CFLAGS + CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer ' + export CXXFLAGS + FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -I/usr/lib/gfortran/modules ' + export FFLAGS + FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -I/usr/lib/gfortran/modules ' + export FCFLAGS + VALAFLAGS=-g + export VALAFLAGS + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 ' + export LDFLAGS + LT_SYS_LIBRARY_PATH=/usr/lib: + export LT_SYS_LIBRARY_PATH + CC=gcc + export CC + CXX=g++ + export CXX + cd xarray-2023.1.0 + rm -rf xarray + pytest_args=(-n auto -m "not network" -k 'not test_open_nczarr') + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer ' + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 ' + PATH=/builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin + PYTHONPATH=/builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib64/python3.11/site-packages:/builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages + PYTHONDONTWRITEBYTECODE=1 + PYTEST_ADDOPTS=' --ignore=/builddir/build/BUILD/xarray-2023.1.0/.pyproject-builddir' + PYTEST_XDIST_AUTO_NUM_WORKERS=8 + /usr/bin/pytest -ra -n auto -m 'not network' -k 'not test_open_nczarr' --pyargs xarray ============================= test session starts ============================== platform linux -- Python 3.11.4, pytest-7.2.2, pluggy-1.0.0 rootdir: /builddir/build/BUILD/xarray-2023.1.0, configfile: setup.cfg plugins: xdist-3.1.0 gw0 I / gw1 I / gw2 I / gw3 I / gw4 I / gw5 I / gw6 I / gw7 I gw0 [16499] / gw1 [16499] / gw2 [16499] / gw3 [16499] / gw4 [16499] / gw5 [16499] / gw6 [16499] / gw7 [16499] ....s....s.s...s...s.....s.s.ss....s.s...s..s.s...ss...ss...s.s...ss..s. [ 0%] ....s..s.s.s...ss...s....s.s.s.ss....ss....ss..s...sss.s.ss.....s..s..s. [ 0%] ...s...s....s....s..s....s...s...s..s....s....s...s...s....s...s....s...s [ 1%] ...s...s..s...s.s...s....s..s...s...s..s..s...s...s..s....s..s..ss.....s. [ 1%] ..s..s...s....s...s...s...s..s...s..s...s..s...s....s.s..s....s..s...s...s [ 2%] ...s..s..s...s.....s...s.s..s....s..s...s...s.s...s...s....s...s.s...s.. [ 2%] .s...s...s.s...s....s..s...s...s...ss...s......ss....s..s...ss....s...s. [ 3%] ..s..s..s.s...s.s...s..s..s.s..s.s..sx.s..s..s..s..s..s.s..s..s....s.s.. [ 3%] ..s....sss....s..s...s..s...s..s...ss...s...s.s..ss.s.s....ss....sss...s.. [ 3%] .s...ss.s.ss.s..s..ss...s.s.s..s.s..s..ss..s.s.s.s....ss.s...s..ss.s..s. [ 4%] s.s..s................................s................................. [ 4%] ........................................................................ [ 5%] ........................................................................ [ 5%] ........................................................................ [ 6%] ......................................................................... [ 6%] ........................................................................ [ 7%] ...........s.s..ss.s...s.s...s.s...s.s..s.s.s..s.s....ss.s.ss.s..s.sss..s [ 7%] .sss.....s..s.s.s..s.s.s...s.s..s..ss.s..s.s..s.s..s.s..s...s...s...s.s. [ 7%] ...ss..s...s.s.s.s.s.ss.s...s...s.ss...s..s..s.s...s..sss.s...s..sss.s.s [ 8%] s.ssss.s.s.s..ssssss..s.s...ss.s.ss.s.s.ss.s...ssss.sss...sss.ss..s.sss. [ 8%] s.ss....ssss.s....s.s..s..ssss.s..s.ss..sF...s.ss.ss.s..s..sss.s..sss..s [ 9%] ..s..ssss..s.ss.ssss..ss...s.ss.ss.ss.ss..s..s.s.s.ss..s.s.s...s...s...s [ 9%] .s..s.s...ss.ss..s.ss.s.s.s..s.ss..s.sss...s..s..s..s..s.ss..s.s.s..s.s. [ 10%] ..s.s....s..s..s...s.s.sss..s.ss.s.ss.s.s.ss.....sss...ss...sssss......... [ 10%] ......................................................................... [ 10%] ........................................................................ [ 11%] .......................................F.....x.......................... [ 11%] ................X....................................................... [ 12%] ........................................................................ [ 12%] .............................................................X.......... [ 13%] ........................................................................ [ 13%] .x....................................................................... [ 14%] ...........................................x.............................. [ 14%] ....s..................................................s................. [ 14%] ........................................................................ [ 15%] .......................................................................... [ 15%] ........................................................................ [ 16%] ........................................................................ [ 16%] ......................................................................... [ 17%] ...............................................s........................ [ 17%] .......................................................................X [ 17%] ........................................................................ [ 18%] .s........................................................................ [ 18%] ......F.................................................................. [ 19%] ......................................................................... [ 19%] .....................X.................................................. [ 20%] ...............................s......................................... [ 20%] ...........x............................................................. [ 21%] ...............s........................................................ [ 21%] .............................s...ss...s...ss..s...s.s...ss....s..Fs..... [ 21%] s.ss...ss...s...s..s..ss...ss..s....s.s....s.....s..s.s..s.s............ [ 22%] .......................................................................... [ 22%] ........................................................................ [ 23%] ........................................................................ [ 23%] ........................................................................ [ 24%] .......X................................................................ [ 24%] ..............................F......................................... [ 25%] ......................................................................... [ 25%] ...Xx...........................s.ss..s..s...ss..s...............s...... [ 25%] .....s..............sx..s..................s............s....s...s.s.... [ 26%] .............................................................ss......... [ 26%] .....................................................................F.. [ 27%] .........................................s.X............................ [ 27%] .......x.........F......s...........................................X... [ 28%] ...s....................F..........................................x.... [ 28%] ..............s........s..........X...................................... [ 28%] ..sx..............................s..................................... [ 29%] .......s...........x......................s.....................s....... [ 29%] ....s................................................................... [ 30%] ......s..............................................................s.. [ 30%] ................................................s....................... [ 31%] ...........x...................x......................F........X......... [ 31%] ........................................................................ [ 32%] ...............s......................................................... [ 32%] ......................................................X..X.........X.... [ 32%] ........................................................................ [ 33%] ...................x.......x...................X..............s.ssss.sss [ 33%] s.s.s.ss.ss.sssssss.ss.sss.s...sss.ssss.s.s.ssss.sss.ss......s.......... [ 34%] ........................................................................ [ 34%] ............................x........................................... [ 35%] ........................................................................ [ 35%] ........................................................................ [ 35%] .......................................................................x [ 36%] ............................F........................................... [ 36%] .....................................................X.....s............. [ 37%] .............................................................s.sss.ssss. [ 37%] ss.s.ss................................................................. [ 38%] .........................F.............F................................ [ 38%] ..s..s..............................................F................... [ 39%] ........................................................................ [ 39%] ................................F........................................ [ 39%] ........X............................................................... [ 40%] ........................................................................ [ 40%] ...................................................x..................... [ 41%] ........................................................................ [ 41%] ....s................................................................... [ 42%] ........................................................................ [ 42%] ........................................................................ [ 42%] ........................................................................ [ 43%] .........................................x...X.......................... [ 43%] ........................................................................ [ 44%] ......................................................................... [ 44%] ...................................................s.................... [ 45%] .......................................ss............................... [ 45%] ........................................................................ [ 46%] ........................................................................ [ 46%] ...................................................................s...X [ 46%] ........................................................................ [ 47%] ..............................................................s...s..... [ 47%] .................................................................s...s.. [ 48%] .......................................................s.s............s. [ 48%] s.................................................s...s................. [ 49%] ......................................................................... [ 49%] ................s...s.................................................... [ 49%] ......................................ss................................ [ 50%] ...................................s.s.ss..ssss.ssss.sss.sssssss.ssssss. [ 50%] sssssss.sssss..ssss..ssss.ssss.ssss.sssss.ss.sssss.sssssssss.ssss..sssss [ 51%] ss.ss.sssss.ssssssss.ssssss...sssss.ssssssss..s.sss.s.ss...........s.s.. [ 51%] .................................................s.s.................... [ 52%] ...............................ss....................................... [ 52%] ...........................................x................s.....s..... [ 53%] ........................................................................ [ 53%] .........s.s............................................................ [ 53%] ......................s.s.s.s..s...s....s..s........s.s................. [ 54%] ......................................ss................................ [ 54%] ................................s....s.....s.....s.....s....s........... [ 55%] ......................................................................... [ 55%] ......................s.....s.s...ss.....s..s....s...................... [ 56%] ........................................................................ [ 56%] ................................................s.s...s....s...s...s.... [ 56%] s......s....s.....s......s............s..................s..........s... [ 57%] .....s...........s..s.s...s......s..s..s......s..s....s..s......s....... [ 57%] .s.........s.............s..............s....s...s...s....s.....s.s..... [ 58%] s...s....s..s.......s........s.....s........s........s...s..s.....s....s. [ 58%] ..s....s...s....s....s......s............s.........s.s.....s............ [ 59%] .s.............s..............s...s..s...s..s....s.s......s..s..s....s.. [ 59%] ...s......s........s....x.s.......s...s.s....s..s...s...s............s.. [ 60%] ..........s.......s..........s..........s.............s.................. [ 60%] ......s...s...s...s..s......s......s............s..........s......s..... [ 60%] ...s........s....s.........ss.sss..s.ss..sss...s.s.s.ss...s...s....s.... [ 61%] .............s.s..ss...s.sss...s.ss.s.....s............s................ [ 61%] ...s..............s....s...s.s..s...s...s...s.s...s..s.................. [ 62%] ........s.s.s...s.s.s.s..s.s.s........................................... [ 62%] ...s.s..s.s..ss.......x...................ss............................. [ 63%] ...........X....s..s...s................................................. [ 63%] ............................................................x..X........ [ 63%] ........................................................................ [ 64%] ........................................................................ [ 64%] ........................................................................ [ 65%] ........................................................................ [ 65%] ........................................................................ [ 66%] ........................................................................ [ 66%] ........................................................................ [ 67%] ........................................................................ [ 67%] ....................................s................................... [ 67%] ........................................................................ [ 68%] ......................................................................... [ 68%] ........................................................................ [ 69%] ............................................s....ss...s..s....s.s...s..s [ 69%] .s...s.s..s...ss.s...................................................... [ 70%] ........................................................................ [ 70%] ........................................................................ [ 70%] ........................................................................ [ 71%] ................................F...............F.............F......... [ 71%] ...F...........F...........F.........................F............F..... [ 72%] ......F..........F..........F..........F........F.......F........F...... [ 72%] .....F.....F....F.....F.......sssssF....F.....F.......F...F...sssss..... [ 73%] .F...F.............F...F........F.F..sssss.....F......F......F......F.... [ 73%] F......F......F....sssFss....F...F.........F...F.........F.......ssFsss. [ 74%] ......F..........F.......sssss........F.........F.......ss.sFss.........F [ 74%] ........F.......F...s.s.sssF........F........F..............F........... [ 74%] ..sFssss......F........F....F.....F.......F.....F....ss.sss...F......... [ 75%] ................................................ssss.s.................. [ 75%] .................................sssss...X.............X......s.....s... [ 76%] ..s...s......s....X..s.......s.......s.......s..ssXss..........s.s...s.s [ 76%] .............sssss.ssss.ss.sssssss.sss.sssss..............x.......s..... [ 77%] ..........................................................s.......sx.... [ 77%] .s..s.......s..........................ssss.s.......x...s............... [ 77%] ......sssssss.sss...x................x.sss.sssssss......x............x.. [ 78%] .......................s.......x...............x............x........... [ 78%] sssss...........s............................x....................x..x.. [ 79%] ....................x........................xs...........s.s....x...... [ 79%] .....s.s.sss......ss.......s.....................x....x.................. [ 80%] ..x..................................x.....x...............x.ss.ss.....s [ 80%] s........s.....ss.sssx.ssss.s.sssss.......................sssss......... [ 81%] ss.sss..................x...................x........ss.ssxs.............. [ 81%] ...x..................................x........x...........s........sss.s. [ 81%] s.s......s........s.....ssssss...s.s.....x..s.s......s.s....X.xsX..ssssX [ 82%] ssss.sssssssss.ssss.....s.xx.s....s.ssssssx..sX.XX.sX.x...s...s.x.xX.... [ 82%] ................sss.ss.x.......ss.sssssss.xssssss...............x........ [ 83%] ..xx.......x........x........x.....sssssx........x.......x.....x....x... [ 83%] .........x.x....x...x.....x.x.......sssss...sssssxssx..sxsx.s.ssssss.sss [ 84%] sssss.ssss.sss.sss..s..s.....xx..ss.....x..s......x......s...x.x....s.s. [ 84%] .s....s...s.....s..sssssssss.sss.ssssssxsss.ssssssssss.ssss.sssss.ssss.s [ 84%] ssss.xsssss.ssssssssss.sssssssssssss.s....s.....xs....ssss.ss......s.... [ 85%] ...s...ss..s.......ssx....s....x...s.x...........x.....xs..X..x......... [ 85%] ..........x...........xs...........x.................................... [ 86%] .......x.........s.............s......x.........s................s...... [ 86%] ........................xs....X..............x..........x...xs.......... [ 87%] ...x.x...s......x.....x......s........s.....x..s.............s.........s [ 87%] s.sss...sss...sx..sssssssssssss.ss.........s..s.s.sssssssssss.ssssssssss [ 88%] ssss.ssss.sssx....s..s.ss......x.........sssss.ss.s....x.........x...sss [ 88%] ss...................x..s.............s.s..ss.s.ss.s.ss.s.ss..s.s....... [ 88%] ......s.s.sss.............s.............s.s.s.ss.................ss..sss [ 89%] s.ssssssssss.ssss.sss.ss.ss..ss.s.ssss...ss..ss.ssss..ssss.s.ssss.ss..s.s [ 89%] s.ssssss.sssssss..ss.sssssssss.ssss.ssss..sss.s.ss...................... [ 90%] s.sss.sssssssssss.sssssss.sss.ssssss...........s..ssss....ssssss......... [ 90%] .x..........................xs.........sss.ss..ssxsssssss.sssssx........ [ 91%] ...............s.x......ssss.ssx............s.....Xx.......ssss..ss...... [ 91%] .........................x......x..................x...............s.ss. [ 91%] .s................X...X......X...................X..X....X.X..xX....X... [ 92%] .............X.X.....Xx.............X.X...ss..sss.s.sXss.s.sssss..sssss.. [ 92%] .....s...x.....................x.........s.ss.ss.s...................... [ 93%] ........X......X....ss.ss.s............................................. [ 93%] .............x.......x....x........s..x.......X...........s............. [ 94%] ...x...........................................s...................s.sss [ 94%] sss..s.s.s.ss.sssss.s.s.sssss.ss.s.sss.ssss.ss.s.ssss.ss.s.sss.ss.sssss. [ 95%] .s..X.sx...............s...........................................x.... [ 95%] .X........X....s.....x..x....ssss.s.....x...X.....X..x...x.............x [ 95%] ......x.............x...x......X........................sssssssss..sssss [ 96%] s.s.s.sss.s.ssssss.s.s.sssssssssss.ss.sss.s.ssssssss.ssss.sss.sssssss.s. [ 96%] s.ss.................................................................... [ 97%] ..............x..............x.......................................... [ 97%] ........................................................................ [ 98%] ........................................................................ [ 98%] ........................................................................ [ 98%] ..................XX............sss..................................... [ 99%] ...........................ssss......................................... [ 99%] ............................ [100%] =================================== FAILURES =================================== ______________ TestNetCDF4Data.test_roundtrip_numpy_datetime_data ______________ [gw1] linux -- Python 3.11.4 /usr/bin/python3 num_dates = array([ 0., nan]), units = 'days since 2000-01-01 00:00:00' calendar = 'proleptic_gregorian', use_cftime = None def decode_cf_datetime( num_dates, units: str, calendar: str | None = None, use_cftime: bool | None = None ) -> np.ndarray: """Given an array of numeric dates in netCDF format, convert it into a numpy array of date time objects. For standard (Gregorian) calendars, this function uses vectorized operations, which makes it much faster than cftime.num2date. In such a case, the returned array will be of type np.datetime64. Note that time unit in `units` must not be smaller than microseconds and not larger than days. See Also -------- cftime.num2date """ num_dates = np.asarray(num_dates) flat_num_dates = num_dates.ravel() if calendar is None: calendar = "standard" if use_cftime is None: try: > dates = _decode_datetime_with_pandas(flat_num_dates, units, calendar) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:285: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ flat_num_dates = array([ 0., nan]), units = 'days since 2000-01-01 00:00:00' calendar = 'proleptic_gregorian' def _decode_datetime_with_pandas( flat_num_dates: np.ndarray, units: str, calendar: str ) -> np.ndarray: if not _is_standard_calendar(calendar): raise OutOfBoundsDatetime( "Cannot decode times from a non-standard calendar, {!r}, using " "pandas.".format(calendar) ) delta, ref_date = _unpack_netcdf_time_units(units) delta = _netcdf_to_numpy_timeunit(delta) try: ref_date = pd.Timestamp(ref_date) except ValueError: # ValueError is raised by pd.Timestamp for non-ISO timestamp # strings, in which case we fall back to using cftime raise OutOfBoundsDatetime with warnings.catch_warnings(): warnings.filterwarnings("ignore", "invalid value encountered", RuntimeWarning) if flat_num_dates.size > 0: # avoid size 0 datetimes GH1329 pd.to_timedelta(flat_num_dates.min(), delta) + ref_date pd.to_timedelta(flat_num_dates.max(), delta) + ref_date # To avoid integer overflow when converting to nanosecond units for integer # dtypes smaller than np.int64 cast all integer and unsigned integer dtype # arrays to np.int64 (GH 2002, GH 6589). Note this is safe even in the case # of np.uint64 values, because any np.uint64 value that would lead to # overflow when converting to np.int64 would not be representable with a # timedelta64 value, and therefore would raise an error in the lines above. if flat_num_dates.dtype.kind in "iu": flat_num_dates = flat_num_dates.astype(np.int64) # Cast input ordinals to integers of nanoseconds because pd.to_timedelta # works much faster when dealing with integers (GH 1399). flat_num_dates_ns_int = (flat_num_dates * _NS_PER_TIME_DELTA[delta]).astype( np.int64 ) # Use pd.to_timedelta to safely cast integer values to timedeltas, # and add those to a Timestamp to safely produce a DatetimeIndex. This # ensures that we do not encounter integer overflow at any point in the # process without raising OutOfBoundsDatetime. > return (pd.to_timedelta(flat_num_dates_ns_int, "ns") + ref_date).values /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:258: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['0 days 00:00:00', '106751 days 23:47:16.854775807'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00') @wraps(method) def new_method(self, other): if is_cmp and isinstance(self, ABCIndex) and isinstance(other, ABCSeries): # For comparison ops, Index does *not* defer to Series pass else: for cls in [ABCDataFrame, ABCSeries, ABCIndex]: if isinstance(self, cls): break if isinstance(other, cls): return NotImplemented other = item_from_zerodim(other) > return method(self, other) /usr/lib64/python3.11/site-packages/pandas/core/ops/common.py:72: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['0 days 00:00:00', '106751 days 23:47:16.854775807'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00') @unpack_zerodim_and_defer("__add__") def __add__(self, other): > return self._arith_method(other, operator.add) /usr/lib64/python3.11/site-packages/pandas/core/arraylike.py:102: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['0 days 00:00:00', '106751 days 23:47:16.854775807'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00'), op = def _arith_method(self, other, op): if ( isinstance(other, Index) and is_object_dtype(other.dtype) and type(other) is not Index ): # We return NotImplemented for object-dtype index *subclasses* so they have # a chance to implement ops before we unwrap them. # See https://github.com/pandas-dev/pandas/issues/31109 return NotImplemented > return super()._arith_method(other, op) /usr/lib64/python3.11/site-packages/pandas/core/indexes/base.py:7007: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['0 days 00:00:00', '106751 days 23:47:16.854775807'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00'), op = def _arith_method(self, other, op): res_name = ops.get_op_result_name(self, other) lvalues = self._values rvalues = extract_array(other, extract_numpy=True, extract_range=True) rvalues = ops.maybe_prepare_scalar_for_op(rvalues, lvalues.shape) rvalues = ensure_wrapped_if_datetimelike(rvalues) with np.errstate(all="ignore"): > result = ops.arithmetic_op(lvalues, rvalues, op) /usr/lib64/python3.11/site-packages/pandas/core/base.py:1325: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ left = ['0 days 00:00:00', '106751 days 23:47:16.854775807'] Length: 2, dtype: timedelta64[ns] right = Timestamp('2000-01-01 00:00:00'), op = def arithmetic_op(left: ArrayLike, right: Any, op): """ Evaluate an arithmetic operation `+`, `-`, `*`, `/`, `//`, `%`, `**`, ... Note: the caller is responsible for ensuring that numpy warnings are suppressed (with np.errstate(all="ignore")) if needed. Parameters ---------- left : np.ndarray or ExtensionArray right : object Cannot be a DataFrame or Index. Series is *not* excluded. op : {operator.add, operator.sub, ...} Or one of the reversed variants from roperator. Returns ------- ndarray or ExtensionArray Or a 2-tuple of these in the case of divmod or rdivmod. """ # NB: We assume that extract_array and ensure_wrapped_if_datetimelike # have already been called on `left` and `right`, # and `maybe_prepare_scalar_for_op` has already been called on `right` # We need to special-case datetime64/timedelta64 dtypes (e.g. because numpy # casts integer dtypes to timedelta64 when operating with timedelta64 - GH#22390) if ( should_extension_dispatch(left, right) or isinstance(right, (Timedelta, BaseOffset, Timestamp)) or right is NaT ): # Timedelta/Timestamp and other custom scalars are included in the check # because numexpr will fail on it, see GH#31457 > res_values = op(left, right) /usr/lib64/python3.11/site-packages/pandas/core/ops/array_ops.py:218: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = ['0 days 00:00:00', '106751 days 23:47:16.854775807'] Length: 2, dtype: timedelta64[ns] other = Timestamp('2000-01-01 00:00:00') @wraps(method) def new_method(self, other): if is_cmp and isinstance(self, ABCIndex) and isinstance(other, ABCSeries): # For comparison ops, Index does *not* defer to Series pass else: for cls in [ABCDataFrame, ABCSeries, ABCIndex]: if isinstance(self, cls): break if isinstance(other, cls): return NotImplemented other = item_from_zerodim(other) > return method(self, other) /usr/lib64/python3.11/site-packages/pandas/core/ops/common.py:72: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = ['0 days 00:00:00', '106751 days 23:47:16.854775807'] Length: 2, dtype: timedelta64[ns] other = Timestamp('2000-01-01 00:00:00') @unpack_zerodim_and_defer("__add__") def __add__(self, other): other_dtype = getattr(other, "dtype", None) # scalar others if other is NaT: result = self._add_nat() elif isinstance(other, (Tick, timedelta, np.timedelta64)): result = self._add_timedeltalike_scalar(other) elif isinstance(other, BaseOffset): # specifically _not_ a Tick result = self._add_offset(other) elif isinstance(other, (datetime, np.datetime64)): > result = self._add_datetimelike_scalar(other) /usr/lib64/python3.11/site-packages/pandas/core/arrays/datetimelike.py:1441: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = ['0 days 00:00:00', '106751 days 23:47:16.854775807'] Length: 2, dtype: timedelta64[ns] other = Timestamp('2000-01-01 00:00:00') @final def _add_datetimelike_scalar(self, other) -> DatetimeArray: if not is_timedelta64_dtype(self.dtype): raise TypeError( f"cannot add {type(self).__name__} and {type(other).__name__}" ) self = cast("TimedeltaArray", self) from pandas.core.arrays import DatetimeArray from pandas.core.arrays.datetimes import tz_to_dtype assert other is not NaT other = Timestamp(other) if other is NaT: # In this case we specifically interpret NaT as a datetime, not # the timedelta interpretation we would get by returning self + NaT result = self._ndarray + NaT.to_datetime64().astype(f"M8[{self._unit}]") # Preserve our resolution return DatetimeArray._simple_new(result, dtype=result.dtype) if self._reso != other._reso: raise NotImplementedError( "Addition between TimedeltaArray and Timestamp with mis-matched " "resolutions is not yet supported." ) i8 = self.asi8 > result = checked_add_with_arr(i8, other.value, arr_mask=self._isnan) /usr/lib64/python3.11/site-packages/pandas/core/arrays/datetimelike.py:1142: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ arr = array([ 0, 9223372036854775807]), b = 946684800000000000 arr_mask = array([False, False]), b_mask = None def checked_add_with_arr( arr: npt.NDArray[np.int64], b: int | npt.NDArray[np.int64], arr_mask: npt.NDArray[np.bool_] | None = None, b_mask: npt.NDArray[np.bool_] | None = None, ) -> npt.NDArray[np.int64]: """ Perform array addition that checks for underflow and overflow. Performs the addition of an int64 array and an int64 integer (or array) but checks that they do not result in overflow first. For elements that are indicated to be NaN, whether or not there is overflow for that element is automatically ignored. Parameters ---------- arr : np.ndarray[int64] addend. b : array or scalar addend. arr_mask : np.ndarray[bool] or None, default None array indicating which elements to exclude from checking b_mask : np.ndarray[bool] or None, default None array or scalar indicating which element(s) to exclude from checking Returns ------- sum : An array for elements x + b for each element x in arr if b is a scalar or an array for elements x + y for each element pair (x, y) in (arr, b). Raises ------ OverflowError if any x + y exceeds the maximum or minimum int64 value. """ # For performance reasons, we broadcast 'b' to the new array 'b2' # so that it has the same size as 'arr'. b2 = np.broadcast_to(b, arr.shape) if b_mask is not None: # We do the same broadcasting for b_mask as well. b2_mask = np.broadcast_to(b_mask, arr.shape) else: b2_mask = None # For elements that are NaN, regardless of their value, we should # ignore whether they overflow or not when doing the checked add. if arr_mask is not None and b2_mask is not None: not_nan = np.logical_not(arr_mask | b2_mask) elif arr_mask is not None: not_nan = np.logical_not(arr_mask) elif b_mask is not None: # error: Argument 1 to "__call__" of "_UFunc_Nin1_Nout1" has # incompatible type "Optional[ndarray[Any, dtype[bool_]]]"; # expected "Union[_SupportsArray[dtype[Any]], _NestedSequence # [_SupportsArray[dtype[Any]]], bool, int, float, complex, str # , bytes, _NestedSequence[Union[bool, int, float, complex, str # , bytes]]]" not_nan = np.logical_not(b2_mask) # type: ignore[arg-type] else: not_nan = np.empty(arr.shape, dtype=bool) not_nan.fill(True) # gh-14324: For each element in 'arr' and its corresponding element # in 'b2', we check the sign of the element in 'b2'. If it is positive, # we then check whether its sum with the element in 'arr' exceeds # np.iinfo(np.int64).max. If so, we have an overflow error. If it # it is negative, we then check whether its sum with the element in # 'arr' exceeds np.iinfo(np.int64).min. If so, we have an overflow # error as well. i8max = lib.i8max i8min = iNaT mask1 = b2 > 0 mask2 = b2 < 0 if not mask1.any(): to_raise = ((i8min - b2 > arr) & not_nan).any() elif not mask2.any(): to_raise = ((i8max - b2 < arr) & not_nan).any() else: to_raise = ((i8max - b2[mask1] < arr[mask1]) & not_nan[mask1]).any() or ( (i8min - b2[mask2] > arr[mask2]) & not_nan[mask2] ).any() if to_raise: > raise OverflowError("Overflow in int64 addition") E OverflowError: Overflow in int64 addition /usr/lib64/python3.11/site-packages/pandas/core/algorithms.py:1249: OverflowError During handling of the above exception, another exception occurred: times = array([cftime.DatetimeProlepticGregorian(2000, 1, 1, 0, 0, 0, 0, has_year_zero=True), cftime.DatetimeProlepticGregorian(294277, 1, 9, 4, 0, 54, 775807, has_year_zero=True)], dtype=object) raise_on_invalid = True def cftime_to_nptime(times, raise_on_invalid: bool = True) -> np.ndarray: """Given an array of cftime.datetime objects, return an array of numpy.datetime64 objects of the same size If raise_on_invalid is True (default), invalid dates trigger a ValueError. Otherwise, the invalid element is replaced by np.NaT.""" times = np.asarray(times) new = np.empty(times.shape, dtype="M8[ns]") for i, t in np.ndenumerate(times): try: # Use pandas.Timestamp in place of datetime.datetime, because # NumPy casts it safely it np.datetime64[ns] for dates outside # 1678 to 2262 (this is not currently the case for # datetime.datetime). > dt = pd.Timestamp( t.year, t.month, t.day, t.hour, t.minute, t.second, t.microsecond ) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:448: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > ??? E ValueError: year 294277 is out of range pandas/_libs/tslibs/timestamps.pyx:1673: ValueError During handling of the above exception, another exception occurred: data = LazilyIndexedArray(array=, key=BasicIndexer((slice(None, None, None),))) units = 'days since 2000-01-01 00:00:00', calendar = 'proleptic_gregorian' use_cftime = None def _decode_cf_datetime_dtype( data, units: str, calendar: str, use_cftime: bool | None ) -> np.dtype: # Verify that at least the first and last date can be decoded # successfully. Otherwise, tracebacks end up swallowed by # Dataset.__repr__ when users try to view their lazily decoded array. values = indexing.ImplicitToExplicitIndexingAdapter(indexing.as_indexable(data)) example_value = np.concatenate( [first_n_items(values, 1) or [0], last_item(values) or [0]] ) try: > result = decode_cf_datetime(example_value, units, calendar, use_cftime) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:184: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ num_dates = array([ 0., nan]), units = 'days since 2000-01-01 00:00:00' calendar = 'proleptic_gregorian', use_cftime = None def decode_cf_datetime( num_dates, units: str, calendar: str | None = None, use_cftime: bool | None = None ) -> np.ndarray: """Given an array of numeric dates in netCDF format, convert it into a numpy array of date time objects. For standard (Gregorian) calendars, this function uses vectorized operations, which makes it much faster than cftime.num2date. In such a case, the returned array will be of type np.datetime64. Note that time unit in `units` must not be smaller than microseconds and not larger than days. See Also -------- cftime.num2date """ num_dates = np.asarray(num_dates) flat_num_dates = num_dates.ravel() if calendar is None: calendar = "standard" if use_cftime is None: try: dates = _decode_datetime_with_pandas(flat_num_dates, units, calendar) except (KeyError, OutOfBoundsDatetime, OutOfBoundsTimedelta, OverflowError): dates = _decode_datetime_with_cftime( flat_num_dates.astype(float), units, calendar ) if ( dates[np.nanargmin(num_dates)].year < 1678 or dates[np.nanargmax(num_dates)].year >= 2262 ): if _is_standard_calendar(calendar): warnings.warn( "Unable to decode time axis into full " "numpy.datetime64 objects, continuing using " "cftime.datetime objects instead, reason: dates out " "of range", SerializationWarning, stacklevel=3, ) else: if _is_standard_calendar(calendar): > dates = cftime_to_nptime(dates) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:306: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ times = array([cftime.DatetimeProlepticGregorian(2000, 1, 1, 0, 0, 0, 0, has_year_zero=True), cftime.DatetimeProlepticGregorian(294277, 1, 9, 4, 0, 54, 775807, has_year_zero=True)], dtype=object) raise_on_invalid = True def cftime_to_nptime(times, raise_on_invalid: bool = True) -> np.ndarray: """Given an array of cftime.datetime objects, return an array of numpy.datetime64 objects of the same size If raise_on_invalid is True (default), invalid dates trigger a ValueError. Otherwise, the invalid element is replaced by np.NaT.""" times = np.asarray(times) new = np.empty(times.shape, dtype="M8[ns]") for i, t in np.ndenumerate(times): try: # Use pandas.Timestamp in place of datetime.datetime, because # NumPy casts it safely it np.datetime64[ns] for dates outside # 1678 to 2262 (this is not currently the case for # datetime.datetime). dt = pd.Timestamp( t.year, t.month, t.day, t.hour, t.minute, t.second, t.microsecond ) except ValueError as e: if raise_on_invalid: > raise ValueError( "Cannot convert date {} to a date in the " "standard calendar. Reason: {}.".format(t, e) ) E ValueError: Cannot convert date 294277-01-09 04:00:54 to a date in the standard calendar. Reason: year 294277 is out of range. /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:453: ValueError During handling of the above exception, another exception occurred: variables = Frozen({'t': [3 values with dtype=float64] Attributes: _FillValue: nan units: ...e ()> [1 values with dtype=int64] Attributes: units: days since 1950-01-01 calendar: proleptic_gregorian}) attributes = Frozen({}), concat_characters = True, mask_and_scale = True decode_times = True, decode_coords = True, drop_variables = set() use_cftime = None, decode_timedelta = None def decode_cf_variables( variables: T_Variables, attributes: T_Attrs, concat_characters: bool = True, mask_and_scale: bool = True, decode_times: bool = True, decode_coords: bool = True, drop_variables: T_DropVariables = None, use_cftime: bool | None = None, decode_timedelta: bool | None = None, ) -> tuple[T_Variables, T_Attrs, set[Hashable]]: """ Decode several CF encoded variables. See: decode_cf_variable """ dimensions_used_by = defaultdict(list) for v in variables.values(): for d in v.dims: dimensions_used_by[d].append(v) def stackable(dim: Hashable) -> bool: # figure out if a dimension can be concatenated over if dim in variables: return False for v in dimensions_used_by[dim]: if v.dtype.kind != "S" or dim != v.dims[-1]: return False return True coord_names = set() if isinstance(drop_variables, str): drop_variables = [drop_variables] elif drop_variables is None: drop_variables = [] drop_variables = set(drop_variables) # Time bounds coordinates might miss the decoding attributes if decode_times: _update_bounds_attributes(variables) new_vars = {} for k, v in variables.items(): if k in drop_variables: continue stack_char_dim = ( concat_characters and v.dtype == "S1" and v.ndim > 0 and stackable(v.dims[-1]) ) try: > new_vars[k] = decode_cf_variable( k, v, concat_characters=concat_characters, mask_and_scale=mask_and_scale, decode_times=decode_times, stack_char_dim=stack_char_dim, use_cftime=use_cftime, decode_timedelta=decode_timedelta, ) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/conventions.py:551: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ name = 't' var = [3 values with dtype=float64] Attributes: units: days since 2000-01-01 00:00:00 calendar: proleptic_gregorian concat_characters = True, mask_and_scale = True, decode_times = True decode_endianness = True, stack_char_dim = False, use_cftime = None decode_timedelta = True def decode_cf_variable( name: Hashable, var: Variable, concat_characters: bool = True, mask_and_scale: bool = True, decode_times: bool = True, decode_endianness: bool = True, stack_char_dim: bool = True, use_cftime: bool | None = None, decode_timedelta: bool | None = None, ) -> Variable: """ Decodes a variable which may hold CF encoded information. This includes variables that have been masked and scaled, which hold CF style time variables (this is almost always the case if the dataset has been serialized) and which have strings encoded as character arrays. Parameters ---------- name : str Name of the variable. Used for better error messages. var : Variable A variable holding potentially CF encoded information. concat_characters : bool Should character arrays be concatenated to strings, for example: ["h", "e", "l", "l", "o"] -> "hello" mask_and_scale : bool Lazily scale (using scale_factor and add_offset) and mask (using _FillValue). If the _Unsigned attribute is present treat integer arrays as unsigned. decode_times : bool Decode cf times ("hours since 2000-01-01") to np.datetime64. decode_endianness : bool Decode arrays from non-native to native endianness. stack_char_dim : bool Whether to stack characters into bytes along the last dimension of this array. Passed as an argument because we need to look at the full dataset to figure out if this is appropriate. use_cftime : bool, optional Only relevant if encoded dates come from a standard calendar (e.g. "gregorian", "proleptic_gregorian", "standard", or not specified). If None (default), attempt to decode times to ``np.datetime64[ns]`` objects; if this is not possible, decode times to ``cftime.datetime`` objects. If True, always decode times to ``cftime.datetime`` objects, regardless of whether or not they can be represented using ``np.datetime64[ns]`` objects. If False, always decode times to ``np.datetime64[ns]`` objects; if this is not possible raise an error. Returns ------- out : Variable A variable holding the decoded equivalent of var. """ # Ensure datetime-like Variables are passed through unmodified (GH 6453) if _contains_datetime_like_objects(var): return var original_dtype = var.dtype if decode_timedelta is None: decode_timedelta = decode_times if concat_characters: if stack_char_dim: var = strings.CharacterArrayCoder().decode(var, name=name) var = strings.EncodedStringCoder().decode(var) if mask_and_scale: for coder in [ variables.UnsignedIntegerCoder(), variables.CFMaskCoder(), variables.CFScaleOffsetCoder(), ]: var = coder.decode(var, name=name) if decode_timedelta: var = times.CFTimedeltaCoder().decode(var, name=name) if decode_times: > var = times.CFDatetimeCoder(use_cftime=use_cftime).decode(var, name=name) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/conventions.py:397: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = variable = [3 values with dtype=float64] Attributes: units: days since 2000-01-01 00:00:00 calendar: proleptic_gregorian name = 't' def decode(self, variable: Variable, name: T_Name = None) -> Variable: units = variable.attrs.get("units", None) if isinstance(units, str) and "since" in units: dims, data, attrs, encoding = unpack_for_decoding(variable) units = pop_to(attrs, encoding, "units") calendar = pop_to(attrs, encoding, "calendar") > dtype = _decode_cf_datetime_dtype(data, units, calendar, self.use_cftime) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:716: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ data = LazilyIndexedArray(array=, key=BasicIndexer((slice(None, None, None),))) units = 'days since 2000-01-01 00:00:00', calendar = 'proleptic_gregorian' use_cftime = None def _decode_cf_datetime_dtype( data, units: str, calendar: str, use_cftime: bool | None ) -> np.dtype: # Verify that at least the first and last date can be decoded # successfully. Otherwise, tracebacks end up swallowed by # Dataset.__repr__ when users try to view their lazily decoded array. values = indexing.ImplicitToExplicitIndexingAdapter(indexing.as_indexable(data)) example_value = np.concatenate( [first_n_items(values, 1) or [0], last_item(values) or [0]] ) try: result = decode_cf_datetime(example_value, units, calendar, use_cftime) except Exception: calendar_msg = ( "the default calendar" if calendar is None else f"calendar {calendar!r}" ) msg = ( f"unable to decode time units {units!r} with {calendar_msg!r}. Try " "opening your dataset with decode_times=False or installing cftime " "if it is not installed." ) > raise ValueError(msg) E ValueError: unable to decode time units 'days since 2000-01-01 00:00:00' with "calendar 'proleptic_gregorian'". Try opening your dataset with decode_times=False or installing cftime if it is not installed. /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:194: ValueError During handling of the above exception, another exception occurred: self = @arm_xfail def test_roundtrip_numpy_datetime_data(self) -> None: times = pd.to_datetime(["2000-01-01", "2000-01-02", "NaT"]) expected = Dataset({"t": ("t", times), "t0": times[0]}) kwargs = {"encoding": {"t0": {"units": "days since 1950-01-01"}}} > with self.roundtrip(expected, save_kwargs=kwargs) as actual: /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:535: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.11/contextlib.py:137: in __enter__ return next(self.gen) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:311: in roundtrip with self.open(path, **open_kwargs) as ds: /usr/lib64/python3.11/contextlib.py:137: in __enter__ return next(self.gen) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:337: in open with open_dataset(path, engine=self.engine, **kwargs) as ds: /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/backends/api.py:541: in open_dataset backend_ds = backend.open_dataset( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/backends/netCDF4_.py:592: in open_dataset ds = store_entrypoint.open_dataset( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/backends/store.py:35: in open_dataset vars, attrs, coord_names = conventions.decode_cf_variables( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ variables = Frozen({'t': [3 values with dtype=float64] Attributes: _FillValue: nan units: ...e ()> [1 values with dtype=int64] Attributes: units: days since 1950-01-01 calendar: proleptic_gregorian}) attributes = Frozen({}), concat_characters = True, mask_and_scale = True decode_times = True, decode_coords = True, drop_variables = set() use_cftime = None, decode_timedelta = None def decode_cf_variables( variables: T_Variables, attributes: T_Attrs, concat_characters: bool = True, mask_and_scale: bool = True, decode_times: bool = True, decode_coords: bool = True, drop_variables: T_DropVariables = None, use_cftime: bool | None = None, decode_timedelta: bool | None = None, ) -> tuple[T_Variables, T_Attrs, set[Hashable]]: """ Decode several CF encoded variables. See: decode_cf_variable """ dimensions_used_by = defaultdict(list) for v in variables.values(): for d in v.dims: dimensions_used_by[d].append(v) def stackable(dim: Hashable) -> bool: # figure out if a dimension can be concatenated over if dim in variables: return False for v in dimensions_used_by[dim]: if v.dtype.kind != "S" or dim != v.dims[-1]: return False return True coord_names = set() if isinstance(drop_variables, str): drop_variables = [drop_variables] elif drop_variables is None: drop_variables = [] drop_variables = set(drop_variables) # Time bounds coordinates might miss the decoding attributes if decode_times: _update_bounds_attributes(variables) new_vars = {} for k, v in variables.items(): if k in drop_variables: continue stack_char_dim = ( concat_characters and v.dtype == "S1" and v.ndim > 0 and stackable(v.dims[-1]) ) try: new_vars[k] = decode_cf_variable( k, v, concat_characters=concat_characters, mask_and_scale=mask_and_scale, decode_times=decode_times, stack_char_dim=stack_char_dim, use_cftime=use_cftime, decode_timedelta=decode_timedelta, ) except Exception as e: > raise type(e)(f"Failed to decode variable {k!r}: {e}") E ValueError: Failed to decode variable 't': unable to decode time units 'days since 2000-01-01 00:00:00' with "calendar 'proleptic_gregorian'". Try opening your dataset with decode_times=False or installing cftime if it is not installed. /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/conventions.py:562: ValueError ___________ TestScipyInMemoryData.test_roundtrip_numpy_datetime_data ___________ [gw2] linux -- Python 3.11.4 /usr/bin/python3 num_dates = array([ 0., nan]), units = 'days since 2000-01-01 00:00:00' calendar = 'proleptic_gregorian', use_cftime = None def decode_cf_datetime( num_dates, units: str, calendar: str | None = None, use_cftime: bool | None = None ) -> np.ndarray: """Given an array of numeric dates in netCDF format, convert it into a numpy array of date time objects. For standard (Gregorian) calendars, this function uses vectorized operations, which makes it much faster than cftime.num2date. In such a case, the returned array will be of type np.datetime64. Note that time unit in `units` must not be smaller than microseconds and not larger than days. See Also -------- cftime.num2date """ num_dates = np.asarray(num_dates) flat_num_dates = num_dates.ravel() if calendar is None: calendar = "standard" if use_cftime is None: try: > dates = _decode_datetime_with_pandas(flat_num_dates, units, calendar) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:285: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ flat_num_dates = array([ 0., nan]), units = 'days since 2000-01-01 00:00:00' calendar = 'proleptic_gregorian' def _decode_datetime_with_pandas( flat_num_dates: np.ndarray, units: str, calendar: str ) -> np.ndarray: if not _is_standard_calendar(calendar): raise OutOfBoundsDatetime( "Cannot decode times from a non-standard calendar, {!r}, using " "pandas.".format(calendar) ) delta, ref_date = _unpack_netcdf_time_units(units) delta = _netcdf_to_numpy_timeunit(delta) try: ref_date = pd.Timestamp(ref_date) except ValueError: # ValueError is raised by pd.Timestamp for non-ISO timestamp # strings, in which case we fall back to using cftime raise OutOfBoundsDatetime with warnings.catch_warnings(): warnings.filterwarnings("ignore", "invalid value encountered", RuntimeWarning) if flat_num_dates.size > 0: # avoid size 0 datetimes GH1329 pd.to_timedelta(flat_num_dates.min(), delta) + ref_date pd.to_timedelta(flat_num_dates.max(), delta) + ref_date # To avoid integer overflow when converting to nanosecond units for integer # dtypes smaller than np.int64 cast all integer and unsigned integer dtype # arrays to np.int64 (GH 2002, GH 6589). Note this is safe even in the case # of np.uint64 values, because any np.uint64 value that would lead to # overflow when converting to np.int64 would not be representable with a # timedelta64 value, and therefore would raise an error in the lines above. if flat_num_dates.dtype.kind in "iu": flat_num_dates = flat_num_dates.astype(np.int64) # Cast input ordinals to integers of nanoseconds because pd.to_timedelta # works much faster when dealing with integers (GH 1399). flat_num_dates_ns_int = (flat_num_dates * _NS_PER_TIME_DELTA[delta]).astype( np.int64 ) # Use pd.to_timedelta to safely cast integer values to timedeltas, # and add those to a Timestamp to safely produce a DatetimeIndex. This # ensures that we do not encounter integer overflow at any point in the # process without raising OutOfBoundsDatetime. > return (pd.to_timedelta(flat_num_dates_ns_int, "ns") + ref_date).values /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:258: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['0 days 00:00:00', '106751 days 23:47:16.854775807'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00') @wraps(method) def new_method(self, other): if is_cmp and isinstance(self, ABCIndex) and isinstance(other, ABCSeries): # For comparison ops, Index does *not* defer to Series pass else: for cls in [ABCDataFrame, ABCSeries, ABCIndex]: if isinstance(self, cls): break if isinstance(other, cls): return NotImplemented other = item_from_zerodim(other) > return method(self, other) /usr/lib64/python3.11/site-packages/pandas/core/ops/common.py:72: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['0 days 00:00:00', '106751 days 23:47:16.854775807'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00') @unpack_zerodim_and_defer("__add__") def __add__(self, other): > return self._arith_method(other, operator.add) /usr/lib64/python3.11/site-packages/pandas/core/arraylike.py:102: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['0 days 00:00:00', '106751 days 23:47:16.854775807'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00'), op = def _arith_method(self, other, op): if ( isinstance(other, Index) and is_object_dtype(other.dtype) and type(other) is not Index ): # We return NotImplemented for object-dtype index *subclasses* so they have # a chance to implement ops before we unwrap them. # See https://github.com/pandas-dev/pandas/issues/31109 return NotImplemented > return super()._arith_method(other, op) /usr/lib64/python3.11/site-packages/pandas/core/indexes/base.py:7007: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['0 days 00:00:00', '106751 days 23:47:16.854775807'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00'), op = def _arith_method(self, other, op): res_name = ops.get_op_result_name(self, other) lvalues = self._values rvalues = extract_array(other, extract_numpy=True, extract_range=True) rvalues = ops.maybe_prepare_scalar_for_op(rvalues, lvalues.shape) rvalues = ensure_wrapped_if_datetimelike(rvalues) with np.errstate(all="ignore"): > result = ops.arithmetic_op(lvalues, rvalues, op) /usr/lib64/python3.11/site-packages/pandas/core/base.py:1325: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ left = ['0 days 00:00:00', '106751 days 23:47:16.854775807'] Length: 2, dtype: timedelta64[ns] right = Timestamp('2000-01-01 00:00:00'), op = def arithmetic_op(left: ArrayLike, right: Any, op): """ Evaluate an arithmetic operation `+`, `-`, `*`, `/`, `//`, `%`, `**`, ... Note: the caller is responsible for ensuring that numpy warnings are suppressed (with np.errstate(all="ignore")) if needed. Parameters ---------- left : np.ndarray or ExtensionArray right : object Cannot be a DataFrame or Index. Series is *not* excluded. op : {operator.add, operator.sub, ...} Or one of the reversed variants from roperator. Returns ------- ndarray or ExtensionArray Or a 2-tuple of these in the case of divmod or rdivmod. """ # NB: We assume that extract_array and ensure_wrapped_if_datetimelike # have already been called on `left` and `right`, # and `maybe_prepare_scalar_for_op` has already been called on `right` # We need to special-case datetime64/timedelta64 dtypes (e.g. because numpy # casts integer dtypes to timedelta64 when operating with timedelta64 - GH#22390) if ( should_extension_dispatch(left, right) or isinstance(right, (Timedelta, BaseOffset, Timestamp)) or right is NaT ): # Timedelta/Timestamp and other custom scalars are included in the check # because numexpr will fail on it, see GH#31457 > res_values = op(left, right) /usr/lib64/python3.11/site-packages/pandas/core/ops/array_ops.py:218: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = ['0 days 00:00:00', '106751 days 23:47:16.854775807'] Length: 2, dtype: timedelta64[ns] other = Timestamp('2000-01-01 00:00:00') @wraps(method) def new_method(self, other): if is_cmp and isinstance(self, ABCIndex) and isinstance(other, ABCSeries): # For comparison ops, Index does *not* defer to Series pass else: for cls in [ABCDataFrame, ABCSeries, ABCIndex]: if isinstance(self, cls): break if isinstance(other, cls): return NotImplemented other = item_from_zerodim(other) > return method(self, other) /usr/lib64/python3.11/site-packages/pandas/core/ops/common.py:72: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = ['0 days 00:00:00', '106751 days 23:47:16.854775807'] Length: 2, dtype: timedelta64[ns] other = Timestamp('2000-01-01 00:00:00') @unpack_zerodim_and_defer("__add__") def __add__(self, other): other_dtype = getattr(other, "dtype", None) # scalar others if other is NaT: result = self._add_nat() elif isinstance(other, (Tick, timedelta, np.timedelta64)): result = self._add_timedeltalike_scalar(other) elif isinstance(other, BaseOffset): # specifically _not_ a Tick result = self._add_offset(other) elif isinstance(other, (datetime, np.datetime64)): > result = self._add_datetimelike_scalar(other) /usr/lib64/python3.11/site-packages/pandas/core/arrays/datetimelike.py:1441: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = ['0 days 00:00:00', '106751 days 23:47:16.854775807'] Length: 2, dtype: timedelta64[ns] other = Timestamp('2000-01-01 00:00:00') @final def _add_datetimelike_scalar(self, other) -> DatetimeArray: if not is_timedelta64_dtype(self.dtype): raise TypeError( f"cannot add {type(self).__name__} and {type(other).__name__}" ) self = cast("TimedeltaArray", self) from pandas.core.arrays import DatetimeArray from pandas.core.arrays.datetimes import tz_to_dtype assert other is not NaT other = Timestamp(other) if other is NaT: # In this case we specifically interpret NaT as a datetime, not # the timedelta interpretation we would get by returning self + NaT result = self._ndarray + NaT.to_datetime64().astype(f"M8[{self._unit}]") # Preserve our resolution return DatetimeArray._simple_new(result, dtype=result.dtype) if self._reso != other._reso: raise NotImplementedError( "Addition between TimedeltaArray and Timestamp with mis-matched " "resolutions is not yet supported." ) i8 = self.asi8 > result = checked_add_with_arr(i8, other.value, arr_mask=self._isnan) /usr/lib64/python3.11/site-packages/pandas/core/arrays/datetimelike.py:1142: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ arr = array([ 0, 9223372036854775807]), b = 946684800000000000 arr_mask = array([False, False]), b_mask = None def checked_add_with_arr( arr: npt.NDArray[np.int64], b: int | npt.NDArray[np.int64], arr_mask: npt.NDArray[np.bool_] | None = None, b_mask: npt.NDArray[np.bool_] | None = None, ) -> npt.NDArray[np.int64]: """ Perform array addition that checks for underflow and overflow. Performs the addition of an int64 array and an int64 integer (or array) but checks that they do not result in overflow first. For elements that are indicated to be NaN, whether or not there is overflow for that element is automatically ignored. Parameters ---------- arr : np.ndarray[int64] addend. b : array or scalar addend. arr_mask : np.ndarray[bool] or None, default None array indicating which elements to exclude from checking b_mask : np.ndarray[bool] or None, default None array or scalar indicating which element(s) to exclude from checking Returns ------- sum : An array for elements x + b for each element x in arr if b is a scalar or an array for elements x + y for each element pair (x, y) in (arr, b). Raises ------ OverflowError if any x + y exceeds the maximum or minimum int64 value. """ # For performance reasons, we broadcast 'b' to the new array 'b2' # so that it has the same size as 'arr'. b2 = np.broadcast_to(b, arr.shape) if b_mask is not None: # We do the same broadcasting for b_mask as well. b2_mask = np.broadcast_to(b_mask, arr.shape) else: b2_mask = None # For elements that are NaN, regardless of their value, we should # ignore whether they overflow or not when doing the checked add. if arr_mask is not None and b2_mask is not None: not_nan = np.logical_not(arr_mask | b2_mask) elif arr_mask is not None: not_nan = np.logical_not(arr_mask) elif b_mask is not None: # error: Argument 1 to "__call__" of "_UFunc_Nin1_Nout1" has # incompatible type "Optional[ndarray[Any, dtype[bool_]]]"; # expected "Union[_SupportsArray[dtype[Any]], _NestedSequence # [_SupportsArray[dtype[Any]]], bool, int, float, complex, str # , bytes, _NestedSequence[Union[bool, int, float, complex, str # , bytes]]]" not_nan = np.logical_not(b2_mask) # type: ignore[arg-type] else: not_nan = np.empty(arr.shape, dtype=bool) not_nan.fill(True) # gh-14324: For each element in 'arr' and its corresponding element # in 'b2', we check the sign of the element in 'b2'. If it is positive, # we then check whether its sum with the element in 'arr' exceeds # np.iinfo(np.int64).max. If so, we have an overflow error. If it # it is negative, we then check whether its sum with the element in # 'arr' exceeds np.iinfo(np.int64).min. If so, we have an overflow # error as well. i8max = lib.i8max i8min = iNaT mask1 = b2 > 0 mask2 = b2 < 0 if not mask1.any(): to_raise = ((i8min - b2 > arr) & not_nan).any() elif not mask2.any(): to_raise = ((i8max - b2 < arr) & not_nan).any() else: to_raise = ((i8max - b2[mask1] < arr[mask1]) & not_nan[mask1]).any() or ( (i8min - b2[mask2] > arr[mask2]) & not_nan[mask2] ).any() if to_raise: > raise OverflowError("Overflow in int64 addition") E OverflowError: Overflow in int64 addition /usr/lib64/python3.11/site-packages/pandas/core/algorithms.py:1249: OverflowError During handling of the above exception, another exception occurred: times = array([cftime.DatetimeProlepticGregorian(2000, 1, 1, 0, 0, 0, 0, has_year_zero=True), cftime.DatetimeProlepticGregorian(294277, 1, 9, 4, 0, 54, 775807, has_year_zero=True)], dtype=object) raise_on_invalid = True def cftime_to_nptime(times, raise_on_invalid: bool = True) -> np.ndarray: """Given an array of cftime.datetime objects, return an array of numpy.datetime64 objects of the same size If raise_on_invalid is True (default), invalid dates trigger a ValueError. Otherwise, the invalid element is replaced by np.NaT.""" times = np.asarray(times) new = np.empty(times.shape, dtype="M8[ns]") for i, t in np.ndenumerate(times): try: # Use pandas.Timestamp in place of datetime.datetime, because # NumPy casts it safely it np.datetime64[ns] for dates outside # 1678 to 2262 (this is not currently the case for # datetime.datetime). > dt = pd.Timestamp( t.year, t.month, t.day, t.hour, t.minute, t.second, t.microsecond ) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:448: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > ??? E ValueError: year 294277 is out of range pandas/_libs/tslibs/timestamps.pyx:1673: ValueError During handling of the above exception, another exception occurred: data = units = 'days since 2000-01-01 00:00:00', calendar = 'proleptic_gregorian' use_cftime = None def _decode_cf_datetime_dtype( data, units: str, calendar: str, use_cftime: bool | None ) -> np.dtype: # Verify that at least the first and last date can be decoded # successfully. Otherwise, tracebacks end up swallowed by # Dataset.__repr__ when users try to view their lazily decoded array. values = indexing.ImplicitToExplicitIndexingAdapter(indexing.as_indexable(data)) example_value = np.concatenate( [first_n_items(values, 1) or [0], last_item(values) or [0]] ) try: > result = decode_cf_datetime(example_value, units, calendar, use_cftime) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:184: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ num_dates = array([ 0., nan]), units = 'days since 2000-01-01 00:00:00' calendar = 'proleptic_gregorian', use_cftime = None def decode_cf_datetime( num_dates, units: str, calendar: str | None = None, use_cftime: bool | None = None ) -> np.ndarray: """Given an array of numeric dates in netCDF format, convert it into a numpy array of date time objects. For standard (Gregorian) calendars, this function uses vectorized operations, which makes it much faster than cftime.num2date. In such a case, the returned array will be of type np.datetime64. Note that time unit in `units` must not be smaller than microseconds and not larger than days. See Also -------- cftime.num2date """ num_dates = np.asarray(num_dates) flat_num_dates = num_dates.ravel() if calendar is None: calendar = "standard" if use_cftime is None: try: dates = _decode_datetime_with_pandas(flat_num_dates, units, calendar) except (KeyError, OutOfBoundsDatetime, OutOfBoundsTimedelta, OverflowError): dates = _decode_datetime_with_cftime( flat_num_dates.astype(float), units, calendar ) if ( dates[np.nanargmin(num_dates)].year < 1678 or dates[np.nanargmax(num_dates)].year >= 2262 ): if _is_standard_calendar(calendar): warnings.warn( "Unable to decode time axis into full " "numpy.datetime64 objects, continuing using " "cftime.datetime objects instead, reason: dates out " "of range", SerializationWarning, stacklevel=3, ) else: if _is_standard_calendar(calendar): > dates = cftime_to_nptime(dates) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:306: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ times = array([cftime.DatetimeProlepticGregorian(2000, 1, 1, 0, 0, 0, 0, has_year_zero=True), cftime.DatetimeProlepticGregorian(294277, 1, 9, 4, 0, 54, 775807, has_year_zero=True)], dtype=object) raise_on_invalid = True def cftime_to_nptime(times, raise_on_invalid: bool = True) -> np.ndarray: """Given an array of cftime.datetime objects, return an array of numpy.datetime64 objects of the same size If raise_on_invalid is True (default), invalid dates trigger a ValueError. Otherwise, the invalid element is replaced by np.NaT.""" times = np.asarray(times) new = np.empty(times.shape, dtype="M8[ns]") for i, t in np.ndenumerate(times): try: # Use pandas.Timestamp in place of datetime.datetime, because # NumPy casts it safely it np.datetime64[ns] for dates outside # 1678 to 2262 (this is not currently the case for # datetime.datetime). dt = pd.Timestamp( t.year, t.month, t.day, t.hour, t.minute, t.second, t.microsecond ) except ValueError as e: if raise_on_invalid: > raise ValueError( "Cannot convert date {} to a date in the " "standard calendar. Reason: {}.".format(t, e) ) E ValueError: Cannot convert date 294277-01-09 04:00:54 to a date in the standard calendar. Reason: year 294277 is out of range. /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:453: ValueError During handling of the above exception, another exception occurred: variables = Frozen({'t': [3 values with dtype=float64] Attributes: units: days since 2000-01-01...e ()> [1 values with dtype=int32] Attributes: units: days since 1950-01-01 calendar: proleptic_gregorian}) attributes = Frozen({}), concat_characters = True, mask_and_scale = True decode_times = True, decode_coords = True, drop_variables = set() use_cftime = None, decode_timedelta = None def decode_cf_variables( variables: T_Variables, attributes: T_Attrs, concat_characters: bool = True, mask_and_scale: bool = True, decode_times: bool = True, decode_coords: bool = True, drop_variables: T_DropVariables = None, use_cftime: bool | None = None, decode_timedelta: bool | None = None, ) -> tuple[T_Variables, T_Attrs, set[Hashable]]: """ Decode several CF encoded variables. See: decode_cf_variable """ dimensions_used_by = defaultdict(list) for v in variables.values(): for d in v.dims: dimensions_used_by[d].append(v) def stackable(dim: Hashable) -> bool: # figure out if a dimension can be concatenated over if dim in variables: return False for v in dimensions_used_by[dim]: if v.dtype.kind != "S" or dim != v.dims[-1]: return False return True coord_names = set() if isinstance(drop_variables, str): drop_variables = [drop_variables] elif drop_variables is None: drop_variables = [] drop_variables = set(drop_variables) # Time bounds coordinates might miss the decoding attributes if decode_times: _update_bounds_attributes(variables) new_vars = {} for k, v in variables.items(): if k in drop_variables: continue stack_char_dim = ( concat_characters and v.dtype == "S1" and v.ndim > 0 and stackable(v.dims[-1]) ) try: > new_vars[k] = decode_cf_variable( k, v, concat_characters=concat_characters, mask_and_scale=mask_and_scale, decode_times=decode_times, stack_char_dim=stack_char_dim, use_cftime=use_cftime, decode_timedelta=decode_timedelta, ) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/conventions.py:551: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ name = 't' var = [3 values with dtype=float64] Attributes: units: days since 2000-01-01 00:00:00 calendar: proleptic_gregorian concat_characters = True, mask_and_scale = True, decode_times = True decode_endianness = True, stack_char_dim = False, use_cftime = None decode_timedelta = True def decode_cf_variable( name: Hashable, var: Variable, concat_characters: bool = True, mask_and_scale: bool = True, decode_times: bool = True, decode_endianness: bool = True, stack_char_dim: bool = True, use_cftime: bool | None = None, decode_timedelta: bool | None = None, ) -> Variable: """ Decodes a variable which may hold CF encoded information. This includes variables that have been masked and scaled, which hold CF style time variables (this is almost always the case if the dataset has been serialized) and which have strings encoded as character arrays. Parameters ---------- name : str Name of the variable. Used for better error messages. var : Variable A variable holding potentially CF encoded information. concat_characters : bool Should character arrays be concatenated to strings, for example: ["h", "e", "l", "l", "o"] -> "hello" mask_and_scale : bool Lazily scale (using scale_factor and add_offset) and mask (using _FillValue). If the _Unsigned attribute is present treat integer arrays as unsigned. decode_times : bool Decode cf times ("hours since 2000-01-01") to np.datetime64. decode_endianness : bool Decode arrays from non-native to native endianness. stack_char_dim : bool Whether to stack characters into bytes along the last dimension of this array. Passed as an argument because we need to look at the full dataset to figure out if this is appropriate. use_cftime : bool, optional Only relevant if encoded dates come from a standard calendar (e.g. "gregorian", "proleptic_gregorian", "standard", or not specified). If None (default), attempt to decode times to ``np.datetime64[ns]`` objects; if this is not possible, decode times to ``cftime.datetime`` objects. If True, always decode times to ``cftime.datetime`` objects, regardless of whether or not they can be represented using ``np.datetime64[ns]`` objects. If False, always decode times to ``np.datetime64[ns]`` objects; if this is not possible raise an error. Returns ------- out : Variable A variable holding the decoded equivalent of var. """ # Ensure datetime-like Variables are passed through unmodified (GH 6453) if _contains_datetime_like_objects(var): return var original_dtype = var.dtype if decode_timedelta is None: decode_timedelta = decode_times if concat_characters: if stack_char_dim: var = strings.CharacterArrayCoder().decode(var, name=name) var = strings.EncodedStringCoder().decode(var) if mask_and_scale: for coder in [ variables.UnsignedIntegerCoder(), variables.CFMaskCoder(), variables.CFScaleOffsetCoder(), ]: var = coder.decode(var, name=name) if decode_timedelta: var = times.CFTimedeltaCoder().decode(var, name=name) if decode_times: > var = times.CFDatetimeCoder(use_cftime=use_cftime).decode(var, name=name) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/conventions.py:397: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = variable = [3 values with dtype=float64] Attributes: units: days since 2000-01-01 00:00:00 calendar: proleptic_gregorian name = 't' def decode(self, variable: Variable, name: T_Name = None) -> Variable: units = variable.attrs.get("units", None) if isinstance(units, str) and "since" in units: dims, data, attrs, encoding = unpack_for_decoding(variable) units = pop_to(attrs, encoding, "units") calendar = pop_to(attrs, encoding, "calendar") > dtype = _decode_cf_datetime_dtype(data, units, calendar, self.use_cftime) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:716: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ data = units = 'days since 2000-01-01 00:00:00', calendar = 'proleptic_gregorian' use_cftime = None def _decode_cf_datetime_dtype( data, units: str, calendar: str, use_cftime: bool | None ) -> np.dtype: # Verify that at least the first and last date can be decoded # successfully. Otherwise, tracebacks end up swallowed by # Dataset.__repr__ when users try to view their lazily decoded array. values = indexing.ImplicitToExplicitIndexingAdapter(indexing.as_indexable(data)) example_value = np.concatenate( [first_n_items(values, 1) or [0], last_item(values) or [0]] ) try: result = decode_cf_datetime(example_value, units, calendar, use_cftime) except Exception: calendar_msg = ( "the default calendar" if calendar is None else f"calendar {calendar!r}" ) msg = ( f"unable to decode time units {units!r} with {calendar_msg!r}. Try " "opening your dataset with decode_times=False or installing cftime " "if it is not installed." ) > raise ValueError(msg) E ValueError: unable to decode time units 'days since 2000-01-01 00:00:00' with "calendar 'proleptic_gregorian'". Try opening your dataset with decode_times=False or installing cftime if it is not installed. /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:194: ValueError During handling of the above exception, another exception occurred: self = @arm_xfail def test_roundtrip_numpy_datetime_data(self) -> None: times = pd.to_datetime(["2000-01-01", "2000-01-02", "NaT"]) expected = Dataset({"t": ("t", times), "t0": times[0]}) kwargs = {"encoding": {"t0": {"units": "days since 1950-01-01"}}} > with self.roundtrip(expected, save_kwargs=kwargs) as actual: /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:535: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.11/contextlib.py:137: in __enter__ return next(self.gen) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:311: in roundtrip with self.open(path, **open_kwargs) as ds: /usr/lib64/python3.11/contextlib.py:137: in __enter__ return next(self.gen) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:337: in open with open_dataset(path, engine=self.engine, **kwargs) as ds: /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/backends/api.py:541: in open_dataset backend_ds = backend.open_dataset( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/backends/scipy_.py:307: in open_dataset ds = store_entrypoint.open_dataset( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/backends/store.py:35: in open_dataset vars, attrs, coord_names = conventions.decode_cf_variables( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ variables = Frozen({'t': [3 values with dtype=float64] Attributes: units: days since 2000-01-01...e ()> [1 values with dtype=int32] Attributes: units: days since 1950-01-01 calendar: proleptic_gregorian}) attributes = Frozen({}), concat_characters = True, mask_and_scale = True decode_times = True, decode_coords = True, drop_variables = set() use_cftime = None, decode_timedelta = None def decode_cf_variables( variables: T_Variables, attributes: T_Attrs, concat_characters: bool = True, mask_and_scale: bool = True, decode_times: bool = True, decode_coords: bool = True, drop_variables: T_DropVariables = None, use_cftime: bool | None = None, decode_timedelta: bool | None = None, ) -> tuple[T_Variables, T_Attrs, set[Hashable]]: """ Decode several CF encoded variables. See: decode_cf_variable """ dimensions_used_by = defaultdict(list) for v in variables.values(): for d in v.dims: dimensions_used_by[d].append(v) def stackable(dim: Hashable) -> bool: # figure out if a dimension can be concatenated over if dim in variables: return False for v in dimensions_used_by[dim]: if v.dtype.kind != "S" or dim != v.dims[-1]: return False return True coord_names = set() if isinstance(drop_variables, str): drop_variables = [drop_variables] elif drop_variables is None: drop_variables = [] drop_variables = set(drop_variables) # Time bounds coordinates might miss the decoding attributes if decode_times: _update_bounds_attributes(variables) new_vars = {} for k, v in variables.items(): if k in drop_variables: continue stack_char_dim = ( concat_characters and v.dtype == "S1" and v.ndim > 0 and stackable(v.dims[-1]) ) try: new_vars[k] = decode_cf_variable( k, v, concat_characters=concat_characters, mask_and_scale=mask_and_scale, decode_times=decode_times, stack_char_dim=stack_char_dim, use_cftime=use_cftime, decode_timedelta=decode_timedelta, ) except Exception as e: > raise type(e)(f"Failed to decode variable {k!r}: {e}") E ValueError: Failed to decode variable 't': unable to decode time units 'days since 2000-01-01 00:00:00' with "calendar 'proleptic_gregorian'". Try opening your dataset with decode_times=False or installing cftime if it is not installed. /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/conventions.py:562: ValueError ____________ TestScipyFileObject.test_roundtrip_numpy_datetime_data ____________ [gw2] linux -- Python 3.11.4 /usr/bin/python3 num_dates = array([ 0., nan]), units = 'days since 2000-01-01 00:00:00' calendar = 'proleptic_gregorian', use_cftime = None def decode_cf_datetime( num_dates, units: str, calendar: str | None = None, use_cftime: bool | None = None ) -> np.ndarray: """Given an array of numeric dates in netCDF format, convert it into a numpy array of date time objects. For standard (Gregorian) calendars, this function uses vectorized operations, which makes it much faster than cftime.num2date. In such a case, the returned array will be of type np.datetime64. Note that time unit in `units` must not be smaller than microseconds and not larger than days. See Also -------- cftime.num2date """ num_dates = np.asarray(num_dates) flat_num_dates = num_dates.ravel() if calendar is None: calendar = "standard" if use_cftime is None: try: > dates = _decode_datetime_with_pandas(flat_num_dates, units, calendar) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:285: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ flat_num_dates = array([ 0., nan]), units = 'days since 2000-01-01 00:00:00' calendar = 'proleptic_gregorian' def _decode_datetime_with_pandas( flat_num_dates: np.ndarray, units: str, calendar: str ) -> np.ndarray: if not _is_standard_calendar(calendar): raise OutOfBoundsDatetime( "Cannot decode times from a non-standard calendar, {!r}, using " "pandas.".format(calendar) ) delta, ref_date = _unpack_netcdf_time_units(units) delta = _netcdf_to_numpy_timeunit(delta) try: ref_date = pd.Timestamp(ref_date) except ValueError: # ValueError is raised by pd.Timestamp for non-ISO timestamp # strings, in which case we fall back to using cftime raise OutOfBoundsDatetime with warnings.catch_warnings(): warnings.filterwarnings("ignore", "invalid value encountered", RuntimeWarning) if flat_num_dates.size > 0: # avoid size 0 datetimes GH1329 pd.to_timedelta(flat_num_dates.min(), delta) + ref_date pd.to_timedelta(flat_num_dates.max(), delta) + ref_date # To avoid integer overflow when converting to nanosecond units for integer # dtypes smaller than np.int64 cast all integer and unsigned integer dtype # arrays to np.int64 (GH 2002, GH 6589). Note this is safe even in the case # of np.uint64 values, because any np.uint64 value that would lead to # overflow when converting to np.int64 would not be representable with a # timedelta64 value, and therefore would raise an error in the lines above. if flat_num_dates.dtype.kind in "iu": flat_num_dates = flat_num_dates.astype(np.int64) # Cast input ordinals to integers of nanoseconds because pd.to_timedelta # works much faster when dealing with integers (GH 1399). flat_num_dates_ns_int = (flat_num_dates * _NS_PER_TIME_DELTA[delta]).astype( np.int64 ) # Use pd.to_timedelta to safely cast integer values to timedeltas, # and add those to a Timestamp to safely produce a DatetimeIndex. This # ensures that we do not encounter integer overflow at any point in the # process without raising OutOfBoundsDatetime. > return (pd.to_timedelta(flat_num_dates_ns_int, "ns") + ref_date).values /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:258: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['0 days 00:00:00', '106751 days 23:47:16.854775807'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00') @wraps(method) def new_method(self, other): if is_cmp and isinstance(self, ABCIndex) and isinstance(other, ABCSeries): # For comparison ops, Index does *not* defer to Series pass else: for cls in [ABCDataFrame, ABCSeries, ABCIndex]: if isinstance(self, cls): break if isinstance(other, cls): return NotImplemented other = item_from_zerodim(other) > return method(self, other) /usr/lib64/python3.11/site-packages/pandas/core/ops/common.py:72: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['0 days 00:00:00', '106751 days 23:47:16.854775807'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00') @unpack_zerodim_and_defer("__add__") def __add__(self, other): > return self._arith_method(other, operator.add) /usr/lib64/python3.11/site-packages/pandas/core/arraylike.py:102: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['0 days 00:00:00', '106751 days 23:47:16.854775807'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00'), op = def _arith_method(self, other, op): if ( isinstance(other, Index) and is_object_dtype(other.dtype) and type(other) is not Index ): # We return NotImplemented for object-dtype index *subclasses* so they have # a chance to implement ops before we unwrap them. # See https://github.com/pandas-dev/pandas/issues/31109 return NotImplemented > return super()._arith_method(other, op) /usr/lib64/python3.11/site-packages/pandas/core/indexes/base.py:7007: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['0 days 00:00:00', '106751 days 23:47:16.854775807'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00'), op = def _arith_method(self, other, op): res_name = ops.get_op_result_name(self, other) lvalues = self._values rvalues = extract_array(other, extract_numpy=True, extract_range=True) rvalues = ops.maybe_prepare_scalar_for_op(rvalues, lvalues.shape) rvalues = ensure_wrapped_if_datetimelike(rvalues) with np.errstate(all="ignore"): > result = ops.arithmetic_op(lvalues, rvalues, op) /usr/lib64/python3.11/site-packages/pandas/core/base.py:1325: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ left = ['0 days 00:00:00', '106751 days 23:47:16.854775807'] Length: 2, dtype: timedelta64[ns] right = Timestamp('2000-01-01 00:00:00'), op = def arithmetic_op(left: ArrayLike, right: Any, op): """ Evaluate an arithmetic operation `+`, `-`, `*`, `/`, `//`, `%`, `**`, ... Note: the caller is responsible for ensuring that numpy warnings are suppressed (with np.errstate(all="ignore")) if needed. Parameters ---------- left : np.ndarray or ExtensionArray right : object Cannot be a DataFrame or Index. Series is *not* excluded. op : {operator.add, operator.sub, ...} Or one of the reversed variants from roperator. Returns ------- ndarray or ExtensionArray Or a 2-tuple of these in the case of divmod or rdivmod. """ # NB: We assume that extract_array and ensure_wrapped_if_datetimelike # have already been called on `left` and `right`, # and `maybe_prepare_scalar_for_op` has already been called on `right` # We need to special-case datetime64/timedelta64 dtypes (e.g. because numpy # casts integer dtypes to timedelta64 when operating with timedelta64 - GH#22390) if ( should_extension_dispatch(left, right) or isinstance(right, (Timedelta, BaseOffset, Timestamp)) or right is NaT ): # Timedelta/Timestamp and other custom scalars are included in the check # because numexpr will fail on it, see GH#31457 > res_values = op(left, right) /usr/lib64/python3.11/site-packages/pandas/core/ops/array_ops.py:218: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = ['0 days 00:00:00', '106751 days 23:47:16.854775807'] Length: 2, dtype: timedelta64[ns] other = Timestamp('2000-01-01 00:00:00') @wraps(method) def new_method(self, other): if is_cmp and isinstance(self, ABCIndex) and isinstance(other, ABCSeries): # For comparison ops, Index does *not* defer to Series pass else: for cls in [ABCDataFrame, ABCSeries, ABCIndex]: if isinstance(self, cls): break if isinstance(other, cls): return NotImplemented other = item_from_zerodim(other) > return method(self, other) /usr/lib64/python3.11/site-packages/pandas/core/ops/common.py:72: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = ['0 days 00:00:00', '106751 days 23:47:16.854775807'] Length: 2, dtype: timedelta64[ns] other = Timestamp('2000-01-01 00:00:00') @unpack_zerodim_and_defer("__add__") def __add__(self, other): other_dtype = getattr(other, "dtype", None) # scalar others if other is NaT: result = self._add_nat() elif isinstance(other, (Tick, timedelta, np.timedelta64)): result = self._add_timedeltalike_scalar(other) elif isinstance(other, BaseOffset): # specifically _not_ a Tick result = self._add_offset(other) elif isinstance(other, (datetime, np.datetime64)): > result = self._add_datetimelike_scalar(other) /usr/lib64/python3.11/site-packages/pandas/core/arrays/datetimelike.py:1441: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = ['0 days 00:00:00', '106751 days 23:47:16.854775807'] Length: 2, dtype: timedelta64[ns] other = Timestamp('2000-01-01 00:00:00') @final def _add_datetimelike_scalar(self, other) -> DatetimeArray: if not is_timedelta64_dtype(self.dtype): raise TypeError( f"cannot add {type(self).__name__} and {type(other).__name__}" ) self = cast("TimedeltaArray", self) from pandas.core.arrays import DatetimeArray from pandas.core.arrays.datetimes import tz_to_dtype assert other is not NaT other = Timestamp(other) if other is NaT: # In this case we specifically interpret NaT as a datetime, not # the timedelta interpretation we would get by returning self + NaT result = self._ndarray + NaT.to_datetime64().astype(f"M8[{self._unit}]") # Preserve our resolution return DatetimeArray._simple_new(result, dtype=result.dtype) if self._reso != other._reso: raise NotImplementedError( "Addition between TimedeltaArray and Timestamp with mis-matched " "resolutions is not yet supported." ) i8 = self.asi8 > result = checked_add_with_arr(i8, other.value, arr_mask=self._isnan) /usr/lib64/python3.11/site-packages/pandas/core/arrays/datetimelike.py:1142: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ arr = array([ 0, 9223372036854775807]), b = 946684800000000000 arr_mask = array([False, False]), b_mask = None def checked_add_with_arr( arr: npt.NDArray[np.int64], b: int | npt.NDArray[np.int64], arr_mask: npt.NDArray[np.bool_] | None = None, b_mask: npt.NDArray[np.bool_] | None = None, ) -> npt.NDArray[np.int64]: """ Perform array addition that checks for underflow and overflow. Performs the addition of an int64 array and an int64 integer (or array) but checks that they do not result in overflow first. For elements that are indicated to be NaN, whether or not there is overflow for that element is automatically ignored. Parameters ---------- arr : np.ndarray[int64] addend. b : array or scalar addend. arr_mask : np.ndarray[bool] or None, default None array indicating which elements to exclude from checking b_mask : np.ndarray[bool] or None, default None array or scalar indicating which element(s) to exclude from checking Returns ------- sum : An array for elements x + b for each element x in arr if b is a scalar or an array for elements x + y for each element pair (x, y) in (arr, b). Raises ------ OverflowError if any x + y exceeds the maximum or minimum int64 value. """ # For performance reasons, we broadcast 'b' to the new array 'b2' # so that it has the same size as 'arr'. b2 = np.broadcast_to(b, arr.shape) if b_mask is not None: # We do the same broadcasting for b_mask as well. b2_mask = np.broadcast_to(b_mask, arr.shape) else: b2_mask = None # For elements that are NaN, regardless of their value, we should # ignore whether they overflow or not when doing the checked add. if arr_mask is not None and b2_mask is not None: not_nan = np.logical_not(arr_mask | b2_mask) elif arr_mask is not None: not_nan = np.logical_not(arr_mask) elif b_mask is not None: # error: Argument 1 to "__call__" of "_UFunc_Nin1_Nout1" has # incompatible type "Optional[ndarray[Any, dtype[bool_]]]"; # expected "Union[_SupportsArray[dtype[Any]], _NestedSequence # [_SupportsArray[dtype[Any]]], bool, int, float, complex, str # , bytes, _NestedSequence[Union[bool, int, float, complex, str # , bytes]]]" not_nan = np.logical_not(b2_mask) # type: ignore[arg-type] else: not_nan = np.empty(arr.shape, dtype=bool) not_nan.fill(True) # gh-14324: For each element in 'arr' and its corresponding element # in 'b2', we check the sign of the element in 'b2'. If it is positive, # we then check whether its sum with the element in 'arr' exceeds # np.iinfo(np.int64).max. If so, we have an overflow error. If it # it is negative, we then check whether its sum with the element in # 'arr' exceeds np.iinfo(np.int64).min. If so, we have an overflow # error as well. i8max = lib.i8max i8min = iNaT mask1 = b2 > 0 mask2 = b2 < 0 if not mask1.any(): to_raise = ((i8min - b2 > arr) & not_nan).any() elif not mask2.any(): to_raise = ((i8max - b2 < arr) & not_nan).any() else: to_raise = ((i8max - b2[mask1] < arr[mask1]) & not_nan[mask1]).any() or ( (i8min - b2[mask2] > arr[mask2]) & not_nan[mask2] ).any() if to_raise: > raise OverflowError("Overflow in int64 addition") E OverflowError: Overflow in int64 addition /usr/lib64/python3.11/site-packages/pandas/core/algorithms.py:1249: OverflowError During handling of the above exception, another exception occurred: times = array([cftime.DatetimeProlepticGregorian(2000, 1, 1, 0, 0, 0, 0, has_year_zero=True), cftime.DatetimeProlepticGregorian(294277, 1, 9, 4, 0, 54, 775807, has_year_zero=True)], dtype=object) raise_on_invalid = True def cftime_to_nptime(times, raise_on_invalid: bool = True) -> np.ndarray: """Given an array of cftime.datetime objects, return an array of numpy.datetime64 objects of the same size If raise_on_invalid is True (default), invalid dates trigger a ValueError. Otherwise, the invalid element is replaced by np.NaT.""" times = np.asarray(times) new = np.empty(times.shape, dtype="M8[ns]") for i, t in np.ndenumerate(times): try: # Use pandas.Timestamp in place of datetime.datetime, because # NumPy casts it safely it np.datetime64[ns] for dates outside # 1678 to 2262 (this is not currently the case for # datetime.datetime). > dt = pd.Timestamp( t.year, t.month, t.day, t.hour, t.minute, t.second, t.microsecond ) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:448: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > ??? E ValueError: year 294277 is out of range pandas/_libs/tslibs/timestamps.pyx:1673: ValueError During handling of the above exception, another exception occurred: data = units = 'days since 2000-01-01 00:00:00', calendar = 'proleptic_gregorian' use_cftime = None def _decode_cf_datetime_dtype( data, units: str, calendar: str, use_cftime: bool | None ) -> np.dtype: # Verify that at least the first and last date can be decoded # successfully. Otherwise, tracebacks end up swallowed by # Dataset.__repr__ when users try to view their lazily decoded array. values = indexing.ImplicitToExplicitIndexingAdapter(indexing.as_indexable(data)) example_value = np.concatenate( [first_n_items(values, 1) or [0], last_item(values) or [0]] ) try: > result = decode_cf_datetime(example_value, units, calendar, use_cftime) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:184: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ num_dates = array([ 0., nan]), units = 'days since 2000-01-01 00:00:00' calendar = 'proleptic_gregorian', use_cftime = None def decode_cf_datetime( num_dates, units: str, calendar: str | None = None, use_cftime: bool | None = None ) -> np.ndarray: """Given an array of numeric dates in netCDF format, convert it into a numpy array of date time objects. For standard (Gregorian) calendars, this function uses vectorized operations, which makes it much faster than cftime.num2date. In such a case, the returned array will be of type np.datetime64. Note that time unit in `units` must not be smaller than microseconds and not larger than days. See Also -------- cftime.num2date """ num_dates = np.asarray(num_dates) flat_num_dates = num_dates.ravel() if calendar is None: calendar = "standard" if use_cftime is None: try: dates = _decode_datetime_with_pandas(flat_num_dates, units, calendar) except (KeyError, OutOfBoundsDatetime, OutOfBoundsTimedelta, OverflowError): dates = _decode_datetime_with_cftime( flat_num_dates.astype(float), units, calendar ) if ( dates[np.nanargmin(num_dates)].year < 1678 or dates[np.nanargmax(num_dates)].year >= 2262 ): if _is_standard_calendar(calendar): warnings.warn( "Unable to decode time axis into full " "numpy.datetime64 objects, continuing using " "cftime.datetime objects instead, reason: dates out " "of range", SerializationWarning, stacklevel=3, ) else: if _is_standard_calendar(calendar): > dates = cftime_to_nptime(dates) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:306: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ times = array([cftime.DatetimeProlepticGregorian(2000, 1, 1, 0, 0, 0, 0, has_year_zero=True), cftime.DatetimeProlepticGregorian(294277, 1, 9, 4, 0, 54, 775807, has_year_zero=True)], dtype=object) raise_on_invalid = True def cftime_to_nptime(times, raise_on_invalid: bool = True) -> np.ndarray: """Given an array of cftime.datetime objects, return an array of numpy.datetime64 objects of the same size If raise_on_invalid is True (default), invalid dates trigger a ValueError. Otherwise, the invalid element is replaced by np.NaT.""" times = np.asarray(times) new = np.empty(times.shape, dtype="M8[ns]") for i, t in np.ndenumerate(times): try: # Use pandas.Timestamp in place of datetime.datetime, because # NumPy casts it safely it np.datetime64[ns] for dates outside # 1678 to 2262 (this is not currently the case for # datetime.datetime). dt = pd.Timestamp( t.year, t.month, t.day, t.hour, t.minute, t.second, t.microsecond ) except ValueError as e: if raise_on_invalid: > raise ValueError( "Cannot convert date {} to a date in the " "standard calendar. Reason: {}.".format(t, e) ) E ValueError: Cannot convert date 294277-01-09 04:00:54 to a date in the standard calendar. Reason: year 294277 is out of range. /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:453: ValueError During handling of the above exception, another exception occurred: variables = Frozen({'t': [3 values with dtype=float64] Attributes: units: days since 2000-01-01...e ()> [1 values with dtype=int32] Attributes: units: days since 1950-01-01 calendar: proleptic_gregorian}) attributes = Frozen({}), concat_characters = True, mask_and_scale = True decode_times = True, decode_coords = True, drop_variables = set() use_cftime = None, decode_timedelta = None def decode_cf_variables( variables: T_Variables, attributes: T_Attrs, concat_characters: bool = True, mask_and_scale: bool = True, decode_times: bool = True, decode_coords: bool = True, drop_variables: T_DropVariables = None, use_cftime: bool | None = None, decode_timedelta: bool | None = None, ) -> tuple[T_Variables, T_Attrs, set[Hashable]]: """ Decode several CF encoded variables. See: decode_cf_variable """ dimensions_used_by = defaultdict(list) for v in variables.values(): for d in v.dims: dimensions_used_by[d].append(v) def stackable(dim: Hashable) -> bool: # figure out if a dimension can be concatenated over if dim in variables: return False for v in dimensions_used_by[dim]: if v.dtype.kind != "S" or dim != v.dims[-1]: return False return True coord_names = set() if isinstance(drop_variables, str): drop_variables = [drop_variables] elif drop_variables is None: drop_variables = [] drop_variables = set(drop_variables) # Time bounds coordinates might miss the decoding attributes if decode_times: _update_bounds_attributes(variables) new_vars = {} for k, v in variables.items(): if k in drop_variables: continue stack_char_dim = ( concat_characters and v.dtype == "S1" and v.ndim > 0 and stackable(v.dims[-1]) ) try: > new_vars[k] = decode_cf_variable( k, v, concat_characters=concat_characters, mask_and_scale=mask_and_scale, decode_times=decode_times, stack_char_dim=stack_char_dim, use_cftime=use_cftime, decode_timedelta=decode_timedelta, ) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/conventions.py:551: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ name = 't' var = [3 values with dtype=float64] Attributes: units: days since 2000-01-01 00:00:00 calendar: proleptic_gregorian concat_characters = True, mask_and_scale = True, decode_times = True decode_endianness = True, stack_char_dim = False, use_cftime = None decode_timedelta = True def decode_cf_variable( name: Hashable, var: Variable, concat_characters: bool = True, mask_and_scale: bool = True, decode_times: bool = True, decode_endianness: bool = True, stack_char_dim: bool = True, use_cftime: bool | None = None, decode_timedelta: bool | None = None, ) -> Variable: """ Decodes a variable which may hold CF encoded information. This includes variables that have been masked and scaled, which hold CF style time variables (this is almost always the case if the dataset has been serialized) and which have strings encoded as character arrays. Parameters ---------- name : str Name of the variable. Used for better error messages. var : Variable A variable holding potentially CF encoded information. concat_characters : bool Should character arrays be concatenated to strings, for example: ["h", "e", "l", "l", "o"] -> "hello" mask_and_scale : bool Lazily scale (using scale_factor and add_offset) and mask (using _FillValue). If the _Unsigned attribute is present treat integer arrays as unsigned. decode_times : bool Decode cf times ("hours since 2000-01-01") to np.datetime64. decode_endianness : bool Decode arrays from non-native to native endianness. stack_char_dim : bool Whether to stack characters into bytes along the last dimension of this array. Passed as an argument because we need to look at the full dataset to figure out if this is appropriate. use_cftime : bool, optional Only relevant if encoded dates come from a standard calendar (e.g. "gregorian", "proleptic_gregorian", "standard", or not specified). If None (default), attempt to decode times to ``np.datetime64[ns]`` objects; if this is not possible, decode times to ``cftime.datetime`` objects. If True, always decode times to ``cftime.datetime`` objects, regardless of whether or not they can be represented using ``np.datetime64[ns]`` objects. If False, always decode times to ``np.datetime64[ns]`` objects; if this is not possible raise an error. Returns ------- out : Variable A variable holding the decoded equivalent of var. """ # Ensure datetime-like Variables are passed through unmodified (GH 6453) if _contains_datetime_like_objects(var): return var original_dtype = var.dtype if decode_timedelta is None: decode_timedelta = decode_times if concat_characters: if stack_char_dim: var = strings.CharacterArrayCoder().decode(var, name=name) var = strings.EncodedStringCoder().decode(var) if mask_and_scale: for coder in [ variables.UnsignedIntegerCoder(), variables.CFMaskCoder(), variables.CFScaleOffsetCoder(), ]: var = coder.decode(var, name=name) if decode_timedelta: var = times.CFTimedeltaCoder().decode(var, name=name) if decode_times: > var = times.CFDatetimeCoder(use_cftime=use_cftime).decode(var, name=name) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/conventions.py:397: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = variable = [3 values with dtype=float64] Attributes: units: days since 2000-01-01 00:00:00 calendar: proleptic_gregorian name = 't' def decode(self, variable: Variable, name: T_Name = None) -> Variable: units = variable.attrs.get("units", None) if isinstance(units, str) and "since" in units: dims, data, attrs, encoding = unpack_for_decoding(variable) units = pop_to(attrs, encoding, "units") calendar = pop_to(attrs, encoding, "calendar") > dtype = _decode_cf_datetime_dtype(data, units, calendar, self.use_cftime) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:716: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ data = units = 'days since 2000-01-01 00:00:00', calendar = 'proleptic_gregorian' use_cftime = None def _decode_cf_datetime_dtype( data, units: str, calendar: str, use_cftime: bool | None ) -> np.dtype: # Verify that at least the first and last date can be decoded # successfully. Otherwise, tracebacks end up swallowed by # Dataset.__repr__ when users try to view their lazily decoded array. values = indexing.ImplicitToExplicitIndexingAdapter(indexing.as_indexable(data)) example_value = np.concatenate( [first_n_items(values, 1) or [0], last_item(values) or [0]] ) try: result = decode_cf_datetime(example_value, units, calendar, use_cftime) except Exception: calendar_msg = ( "the default calendar" if calendar is None else f"calendar {calendar!r}" ) msg = ( f"unable to decode time units {units!r} with {calendar_msg!r}. Try " "opening your dataset with decode_times=False or installing cftime " "if it is not installed." ) > raise ValueError(msg) E ValueError: unable to decode time units 'days since 2000-01-01 00:00:00' with "calendar 'proleptic_gregorian'". Try opening your dataset with decode_times=False or installing cftime if it is not installed. /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:194: ValueError During handling of the above exception, another exception occurred: self = @arm_xfail def test_roundtrip_numpy_datetime_data(self) -> None: times = pd.to_datetime(["2000-01-01", "2000-01-02", "NaT"]) expected = Dataset({"t": ("t", times), "t0": times[0]}) kwargs = {"encoding": {"t0": {"units": "days since 1950-01-01"}}} > with self.roundtrip(expected, save_kwargs=kwargs) as actual: /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:535: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.11/contextlib.py:137: in __enter__ return next(self.gen) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:2716: in roundtrip with self.open(f, **open_kwargs) as ds: /usr/lib64/python3.11/contextlib.py:137: in __enter__ return next(self.gen) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:337: in open with open_dataset(path, engine=self.engine, **kwargs) as ds: /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/backends/api.py:541: in open_dataset backend_ds = backend.open_dataset( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/backends/scipy_.py:307: in open_dataset ds = store_entrypoint.open_dataset( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/backends/store.py:35: in open_dataset vars, attrs, coord_names = conventions.decode_cf_variables( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ variables = Frozen({'t': [3 values with dtype=float64] Attributes: units: days since 2000-01-01...e ()> [1 values with dtype=int32] Attributes: units: days since 1950-01-01 calendar: proleptic_gregorian}) attributes = Frozen({}), concat_characters = True, mask_and_scale = True decode_times = True, decode_coords = True, drop_variables = set() use_cftime = None, decode_timedelta = None def decode_cf_variables( variables: T_Variables, attributes: T_Attrs, concat_characters: bool = True, mask_and_scale: bool = True, decode_times: bool = True, decode_coords: bool = True, drop_variables: T_DropVariables = None, use_cftime: bool | None = None, decode_timedelta: bool | None = None, ) -> tuple[T_Variables, T_Attrs, set[Hashable]]: """ Decode several CF encoded variables. See: decode_cf_variable """ dimensions_used_by = defaultdict(list) for v in variables.values(): for d in v.dims: dimensions_used_by[d].append(v) def stackable(dim: Hashable) -> bool: # figure out if a dimension can be concatenated over if dim in variables: return False for v in dimensions_used_by[dim]: if v.dtype.kind != "S" or dim != v.dims[-1]: return False return True coord_names = set() if isinstance(drop_variables, str): drop_variables = [drop_variables] elif drop_variables is None: drop_variables = [] drop_variables = set(drop_variables) # Time bounds coordinates might miss the decoding attributes if decode_times: _update_bounds_attributes(variables) new_vars = {} for k, v in variables.items(): if k in drop_variables: continue stack_char_dim = ( concat_characters and v.dtype == "S1" and v.ndim > 0 and stackable(v.dims[-1]) ) try: new_vars[k] = decode_cf_variable( k, v, concat_characters=concat_characters, mask_and_scale=mask_and_scale, decode_times=decode_times, stack_char_dim=stack_char_dim, use_cftime=use_cftime, decode_timedelta=decode_timedelta, ) except Exception as e: > raise type(e)(f"Failed to decode variable {k!r}: {e}") E ValueError: Failed to decode variable 't': unable to decode time units 'days since 2000-01-01 00:00:00' with "calendar 'proleptic_gregorian'". Try opening your dataset with decode_times=False or installing cftime if it is not installed. /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/conventions.py:562: ValueError __________ TestNetCDF4ViaDaskData.test_roundtrip_numpy_datetime_data ___________ [gw1] linux -- Python 3.11.4 /usr/bin/python3 num_dates = array([ 0., nan]), units = 'days since 2000-01-01 00:00:00' calendar = 'proleptic_gregorian', use_cftime = None def decode_cf_datetime( num_dates, units: str, calendar: str | None = None, use_cftime: bool | None = None ) -> np.ndarray: """Given an array of numeric dates in netCDF format, convert it into a numpy array of date time objects. For standard (Gregorian) calendars, this function uses vectorized operations, which makes it much faster than cftime.num2date. In such a case, the returned array will be of type np.datetime64. Note that time unit in `units` must not be smaller than microseconds and not larger than days. See Also -------- cftime.num2date """ num_dates = np.asarray(num_dates) flat_num_dates = num_dates.ravel() if calendar is None: calendar = "standard" if use_cftime is None: try: > dates = _decode_datetime_with_pandas(flat_num_dates, units, calendar) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:285: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ flat_num_dates = array([ 0., nan]), units = 'days since 2000-01-01 00:00:00' calendar = 'proleptic_gregorian' def _decode_datetime_with_pandas( flat_num_dates: np.ndarray, units: str, calendar: str ) -> np.ndarray: if not _is_standard_calendar(calendar): raise OutOfBoundsDatetime( "Cannot decode times from a non-standard calendar, {!r}, using " "pandas.".format(calendar) ) delta, ref_date = _unpack_netcdf_time_units(units) delta = _netcdf_to_numpy_timeunit(delta) try: ref_date = pd.Timestamp(ref_date) except ValueError: # ValueError is raised by pd.Timestamp for non-ISO timestamp # strings, in which case we fall back to using cftime raise OutOfBoundsDatetime with warnings.catch_warnings(): warnings.filterwarnings("ignore", "invalid value encountered", RuntimeWarning) if flat_num_dates.size > 0: # avoid size 0 datetimes GH1329 pd.to_timedelta(flat_num_dates.min(), delta) + ref_date pd.to_timedelta(flat_num_dates.max(), delta) + ref_date # To avoid integer overflow when converting to nanosecond units for integer # dtypes smaller than np.int64 cast all integer and unsigned integer dtype # arrays to np.int64 (GH 2002, GH 6589). Note this is safe even in the case # of np.uint64 values, because any np.uint64 value that would lead to # overflow when converting to np.int64 would not be representable with a # timedelta64 value, and therefore would raise an error in the lines above. if flat_num_dates.dtype.kind in "iu": flat_num_dates = flat_num_dates.astype(np.int64) # Cast input ordinals to integers of nanoseconds because pd.to_timedelta # works much faster when dealing with integers (GH 1399). flat_num_dates_ns_int = (flat_num_dates * _NS_PER_TIME_DELTA[delta]).astype( np.int64 ) # Use pd.to_timedelta to safely cast integer values to timedeltas, # and add those to a Timestamp to safely produce a DatetimeIndex. This # ensures that we do not encounter integer overflow at any point in the # process without raising OutOfBoundsDatetime. > return (pd.to_timedelta(flat_num_dates_ns_int, "ns") + ref_date).values /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:258: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['0 days 00:00:00', '106751 days 23:47:16.854775807'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00') @wraps(method) def new_method(self, other): if is_cmp and isinstance(self, ABCIndex) and isinstance(other, ABCSeries): # For comparison ops, Index does *not* defer to Series pass else: for cls in [ABCDataFrame, ABCSeries, ABCIndex]: if isinstance(self, cls): break if isinstance(other, cls): return NotImplemented other = item_from_zerodim(other) > return method(self, other) /usr/lib64/python3.11/site-packages/pandas/core/ops/common.py:72: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['0 days 00:00:00', '106751 days 23:47:16.854775807'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00') @unpack_zerodim_and_defer("__add__") def __add__(self, other): > return self._arith_method(other, operator.add) /usr/lib64/python3.11/site-packages/pandas/core/arraylike.py:102: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['0 days 00:00:00', '106751 days 23:47:16.854775807'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00'), op = def _arith_method(self, other, op): if ( isinstance(other, Index) and is_object_dtype(other.dtype) and type(other) is not Index ): # We return NotImplemented for object-dtype index *subclasses* so they have # a chance to implement ops before we unwrap them. # See https://github.com/pandas-dev/pandas/issues/31109 return NotImplemented > return super()._arith_method(other, op) /usr/lib64/python3.11/site-packages/pandas/core/indexes/base.py:7007: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['0 days 00:00:00', '106751 days 23:47:16.854775807'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00'), op = def _arith_method(self, other, op): res_name = ops.get_op_result_name(self, other) lvalues = self._values rvalues = extract_array(other, extract_numpy=True, extract_range=True) rvalues = ops.maybe_prepare_scalar_for_op(rvalues, lvalues.shape) rvalues = ensure_wrapped_if_datetimelike(rvalues) with np.errstate(all="ignore"): > result = ops.arithmetic_op(lvalues, rvalues, op) /usr/lib64/python3.11/site-packages/pandas/core/base.py:1325: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ left = ['0 days 00:00:00', '106751 days 23:47:16.854775807'] Length: 2, dtype: timedelta64[ns] right = Timestamp('2000-01-01 00:00:00'), op = def arithmetic_op(left: ArrayLike, right: Any, op): """ Evaluate an arithmetic operation `+`, `-`, `*`, `/`, `//`, `%`, `**`, ... Note: the caller is responsible for ensuring that numpy warnings are suppressed (with np.errstate(all="ignore")) if needed. Parameters ---------- left : np.ndarray or ExtensionArray right : object Cannot be a DataFrame or Index. Series is *not* excluded. op : {operator.add, operator.sub, ...} Or one of the reversed variants from roperator. Returns ------- ndarray or ExtensionArray Or a 2-tuple of these in the case of divmod or rdivmod. """ # NB: We assume that extract_array and ensure_wrapped_if_datetimelike # have already been called on `left` and `right`, # and `maybe_prepare_scalar_for_op` has already been called on `right` # We need to special-case datetime64/timedelta64 dtypes (e.g. because numpy # casts integer dtypes to timedelta64 when operating with timedelta64 - GH#22390) if ( should_extension_dispatch(left, right) or isinstance(right, (Timedelta, BaseOffset, Timestamp)) or right is NaT ): # Timedelta/Timestamp and other custom scalars are included in the check # because numexpr will fail on it, see GH#31457 > res_values = op(left, right) /usr/lib64/python3.11/site-packages/pandas/core/ops/array_ops.py:218: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = ['0 days 00:00:00', '106751 days 23:47:16.854775807'] Length: 2, dtype: timedelta64[ns] other = Timestamp('2000-01-01 00:00:00') @wraps(method) def new_method(self, other): if is_cmp and isinstance(self, ABCIndex) and isinstance(other, ABCSeries): # For comparison ops, Index does *not* defer to Series pass else: for cls in [ABCDataFrame, ABCSeries, ABCIndex]: if isinstance(self, cls): break if isinstance(other, cls): return NotImplemented other = item_from_zerodim(other) > return method(self, other) /usr/lib64/python3.11/site-packages/pandas/core/ops/common.py:72: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = ['0 days 00:00:00', '106751 days 23:47:16.854775807'] Length: 2, dtype: timedelta64[ns] other = Timestamp('2000-01-01 00:00:00') @unpack_zerodim_and_defer("__add__") def __add__(self, other): other_dtype = getattr(other, "dtype", None) # scalar others if other is NaT: result = self._add_nat() elif isinstance(other, (Tick, timedelta, np.timedelta64)): result = self._add_timedeltalike_scalar(other) elif isinstance(other, BaseOffset): # specifically _not_ a Tick result = self._add_offset(other) elif isinstance(other, (datetime, np.datetime64)): > result = self._add_datetimelike_scalar(other) /usr/lib64/python3.11/site-packages/pandas/core/arrays/datetimelike.py:1441: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = ['0 days 00:00:00', '106751 days 23:47:16.854775807'] Length: 2, dtype: timedelta64[ns] other = Timestamp('2000-01-01 00:00:00') @final def _add_datetimelike_scalar(self, other) -> DatetimeArray: if not is_timedelta64_dtype(self.dtype): raise TypeError( f"cannot add {type(self).__name__} and {type(other).__name__}" ) self = cast("TimedeltaArray", self) from pandas.core.arrays import DatetimeArray from pandas.core.arrays.datetimes import tz_to_dtype assert other is not NaT other = Timestamp(other) if other is NaT: # In this case we specifically interpret NaT as a datetime, not # the timedelta interpretation we would get by returning self + NaT result = self._ndarray + NaT.to_datetime64().astype(f"M8[{self._unit}]") # Preserve our resolution return DatetimeArray._simple_new(result, dtype=result.dtype) if self._reso != other._reso: raise NotImplementedError( "Addition between TimedeltaArray and Timestamp with mis-matched " "resolutions is not yet supported." ) i8 = self.asi8 > result = checked_add_with_arr(i8, other.value, arr_mask=self._isnan) /usr/lib64/python3.11/site-packages/pandas/core/arrays/datetimelike.py:1142: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ arr = array([ 0, 9223372036854775807]), b = 946684800000000000 arr_mask = array([False, False]), b_mask = None def checked_add_with_arr( arr: npt.NDArray[np.int64], b: int | npt.NDArray[np.int64], arr_mask: npt.NDArray[np.bool_] | None = None, b_mask: npt.NDArray[np.bool_] | None = None, ) -> npt.NDArray[np.int64]: """ Perform array addition that checks for underflow and overflow. Performs the addition of an int64 array and an int64 integer (or array) but checks that they do not result in overflow first. For elements that are indicated to be NaN, whether or not there is overflow for that element is automatically ignored. Parameters ---------- arr : np.ndarray[int64] addend. b : array or scalar addend. arr_mask : np.ndarray[bool] or None, default None array indicating which elements to exclude from checking b_mask : np.ndarray[bool] or None, default None array or scalar indicating which element(s) to exclude from checking Returns ------- sum : An array for elements x + b for each element x in arr if b is a scalar or an array for elements x + y for each element pair (x, y) in (arr, b). Raises ------ OverflowError if any x + y exceeds the maximum or minimum int64 value. """ # For performance reasons, we broadcast 'b' to the new array 'b2' # so that it has the same size as 'arr'. b2 = np.broadcast_to(b, arr.shape) if b_mask is not None: # We do the same broadcasting for b_mask as well. b2_mask = np.broadcast_to(b_mask, arr.shape) else: b2_mask = None # For elements that are NaN, regardless of their value, we should # ignore whether they overflow or not when doing the checked add. if arr_mask is not None and b2_mask is not None: not_nan = np.logical_not(arr_mask | b2_mask) elif arr_mask is not None: not_nan = np.logical_not(arr_mask) elif b_mask is not None: # error: Argument 1 to "__call__" of "_UFunc_Nin1_Nout1" has # incompatible type "Optional[ndarray[Any, dtype[bool_]]]"; # expected "Union[_SupportsArray[dtype[Any]], _NestedSequence # [_SupportsArray[dtype[Any]]], bool, int, float, complex, str # , bytes, _NestedSequence[Union[bool, int, float, complex, str # , bytes]]]" not_nan = np.logical_not(b2_mask) # type: ignore[arg-type] else: not_nan = np.empty(arr.shape, dtype=bool) not_nan.fill(True) # gh-14324: For each element in 'arr' and its corresponding element # in 'b2', we check the sign of the element in 'b2'. If it is positive, # we then check whether its sum with the element in 'arr' exceeds # np.iinfo(np.int64).max. If so, we have an overflow error. If it # it is negative, we then check whether its sum with the element in # 'arr' exceeds np.iinfo(np.int64).min. If so, we have an overflow # error as well. i8max = lib.i8max i8min = iNaT mask1 = b2 > 0 mask2 = b2 < 0 if not mask1.any(): to_raise = ((i8min - b2 > arr) & not_nan).any() elif not mask2.any(): to_raise = ((i8max - b2 < arr) & not_nan).any() else: to_raise = ((i8max - b2[mask1] < arr[mask1]) & not_nan[mask1]).any() or ( (i8min - b2[mask2] > arr[mask2]) & not_nan[mask2] ).any() if to_raise: > raise OverflowError("Overflow in int64 addition") E OverflowError: Overflow in int64 addition /usr/lib64/python3.11/site-packages/pandas/core/algorithms.py:1249: OverflowError During handling of the above exception, another exception occurred: times = array([cftime.DatetimeProlepticGregorian(2000, 1, 1, 0, 0, 0, 0, has_year_zero=True), cftime.DatetimeProlepticGregorian(294277, 1, 9, 4, 0, 54, 775807, has_year_zero=True)], dtype=object) raise_on_invalid = True def cftime_to_nptime(times, raise_on_invalid: bool = True) -> np.ndarray: """Given an array of cftime.datetime objects, return an array of numpy.datetime64 objects of the same size If raise_on_invalid is True (default), invalid dates trigger a ValueError. Otherwise, the invalid element is replaced by np.NaT.""" times = np.asarray(times) new = np.empty(times.shape, dtype="M8[ns]") for i, t in np.ndenumerate(times): try: # Use pandas.Timestamp in place of datetime.datetime, because # NumPy casts it safely it np.datetime64[ns] for dates outside # 1678 to 2262 (this is not currently the case for # datetime.datetime). > dt = pd.Timestamp( t.year, t.month, t.day, t.hour, t.minute, t.second, t.microsecond ) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:448: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > ??? E ValueError: year 294277 is out of range pandas/_libs/tslibs/timestamps.pyx:1673: ValueError During handling of the above exception, another exception occurred: data = LazilyIndexedArray(array=, key=BasicIndexer((slice(None, None, None),))) units = 'days since 2000-01-01 00:00:00', calendar = 'proleptic_gregorian' use_cftime = None def _decode_cf_datetime_dtype( data, units: str, calendar: str, use_cftime: bool | None ) -> np.dtype: # Verify that at least the first and last date can be decoded # successfully. Otherwise, tracebacks end up swallowed by # Dataset.__repr__ when users try to view their lazily decoded array. values = indexing.ImplicitToExplicitIndexingAdapter(indexing.as_indexable(data)) example_value = np.concatenate( [first_n_items(values, 1) or [0], last_item(values) or [0]] ) try: > result = decode_cf_datetime(example_value, units, calendar, use_cftime) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:184: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ num_dates = array([ 0., nan]), units = 'days since 2000-01-01 00:00:00' calendar = 'proleptic_gregorian', use_cftime = None def decode_cf_datetime( num_dates, units: str, calendar: str | None = None, use_cftime: bool | None = None ) -> np.ndarray: """Given an array of numeric dates in netCDF format, convert it into a numpy array of date time objects. For standard (Gregorian) calendars, this function uses vectorized operations, which makes it much faster than cftime.num2date. In such a case, the returned array will be of type np.datetime64. Note that time unit in `units` must not be smaller than microseconds and not larger than days. See Also -------- cftime.num2date """ num_dates = np.asarray(num_dates) flat_num_dates = num_dates.ravel() if calendar is None: calendar = "standard" if use_cftime is None: try: dates = _decode_datetime_with_pandas(flat_num_dates, units, calendar) except (KeyError, OutOfBoundsDatetime, OutOfBoundsTimedelta, OverflowError): dates = _decode_datetime_with_cftime( flat_num_dates.astype(float), units, calendar ) if ( dates[np.nanargmin(num_dates)].year < 1678 or dates[np.nanargmax(num_dates)].year >= 2262 ): if _is_standard_calendar(calendar): warnings.warn( "Unable to decode time axis into full " "numpy.datetime64 objects, continuing using " "cftime.datetime objects instead, reason: dates out " "of range", SerializationWarning, stacklevel=3, ) else: if _is_standard_calendar(calendar): > dates = cftime_to_nptime(dates) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:306: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ times = array([cftime.DatetimeProlepticGregorian(2000, 1, 1, 0, 0, 0, 0, has_year_zero=True), cftime.DatetimeProlepticGregorian(294277, 1, 9, 4, 0, 54, 775807, has_year_zero=True)], dtype=object) raise_on_invalid = True def cftime_to_nptime(times, raise_on_invalid: bool = True) -> np.ndarray: """Given an array of cftime.datetime objects, return an array of numpy.datetime64 objects of the same size If raise_on_invalid is True (default), invalid dates trigger a ValueError. Otherwise, the invalid element is replaced by np.NaT.""" times = np.asarray(times) new = np.empty(times.shape, dtype="M8[ns]") for i, t in np.ndenumerate(times): try: # Use pandas.Timestamp in place of datetime.datetime, because # NumPy casts it safely it np.datetime64[ns] for dates outside # 1678 to 2262 (this is not currently the case for # datetime.datetime). dt = pd.Timestamp( t.year, t.month, t.day, t.hour, t.minute, t.second, t.microsecond ) except ValueError as e: if raise_on_invalid: > raise ValueError( "Cannot convert date {} to a date in the " "standard calendar. Reason: {}.".format(t, e) ) E ValueError: Cannot convert date 294277-01-09 04:00:54 to a date in the standard calendar. Reason: year 294277 is out of range. /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:453: ValueError During handling of the above exception, another exception occurred: variables = Frozen({'t': [3 values with dtype=float64] Attributes: _FillValue: nan units: ...e ()> [1 values with dtype=int64] Attributes: units: days since 1950-01-01 calendar: proleptic_gregorian}) attributes = Frozen({}), concat_characters = True, mask_and_scale = True decode_times = True, decode_coords = True, drop_variables = set() use_cftime = None, decode_timedelta = None def decode_cf_variables( variables: T_Variables, attributes: T_Attrs, concat_characters: bool = True, mask_and_scale: bool = True, decode_times: bool = True, decode_coords: bool = True, drop_variables: T_DropVariables = None, use_cftime: bool | None = None, decode_timedelta: bool | None = None, ) -> tuple[T_Variables, T_Attrs, set[Hashable]]: """ Decode several CF encoded variables. See: decode_cf_variable """ dimensions_used_by = defaultdict(list) for v in variables.values(): for d in v.dims: dimensions_used_by[d].append(v) def stackable(dim: Hashable) -> bool: # figure out if a dimension can be concatenated over if dim in variables: return False for v in dimensions_used_by[dim]: if v.dtype.kind != "S" or dim != v.dims[-1]: return False return True coord_names = set() if isinstance(drop_variables, str): drop_variables = [drop_variables] elif drop_variables is None: drop_variables = [] drop_variables = set(drop_variables) # Time bounds coordinates might miss the decoding attributes if decode_times: _update_bounds_attributes(variables) new_vars = {} for k, v in variables.items(): if k in drop_variables: continue stack_char_dim = ( concat_characters and v.dtype == "S1" and v.ndim > 0 and stackable(v.dims[-1]) ) try: > new_vars[k] = decode_cf_variable( k, v, concat_characters=concat_characters, mask_and_scale=mask_and_scale, decode_times=decode_times, stack_char_dim=stack_char_dim, use_cftime=use_cftime, decode_timedelta=decode_timedelta, ) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/conventions.py:551: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ name = 't' var = [3 values with dtype=float64] Attributes: units: days since 2000-01-01 00:00:00 calendar: proleptic_gregorian concat_characters = True, mask_and_scale = True, decode_times = True decode_endianness = True, stack_char_dim = False, use_cftime = None decode_timedelta = True def decode_cf_variable( name: Hashable, var: Variable, concat_characters: bool = True, mask_and_scale: bool = True, decode_times: bool = True, decode_endianness: bool = True, stack_char_dim: bool = True, use_cftime: bool | None = None, decode_timedelta: bool | None = None, ) -> Variable: """ Decodes a variable which may hold CF encoded information. This includes variables that have been masked and scaled, which hold CF style time variables (this is almost always the case if the dataset has been serialized) and which have strings encoded as character arrays. Parameters ---------- name : str Name of the variable. Used for better error messages. var : Variable A variable holding potentially CF encoded information. concat_characters : bool Should character arrays be concatenated to strings, for example: ["h", "e", "l", "l", "o"] -> "hello" mask_and_scale : bool Lazily scale (using scale_factor and add_offset) and mask (using _FillValue). If the _Unsigned attribute is present treat integer arrays as unsigned. decode_times : bool Decode cf times ("hours since 2000-01-01") to np.datetime64. decode_endianness : bool Decode arrays from non-native to native endianness. stack_char_dim : bool Whether to stack characters into bytes along the last dimension of this array. Passed as an argument because we need to look at the full dataset to figure out if this is appropriate. use_cftime : bool, optional Only relevant if encoded dates come from a standard calendar (e.g. "gregorian", "proleptic_gregorian", "standard", or not specified). If None (default), attempt to decode times to ``np.datetime64[ns]`` objects; if this is not possible, decode times to ``cftime.datetime`` objects. If True, always decode times to ``cftime.datetime`` objects, regardless of whether or not they can be represented using ``np.datetime64[ns]`` objects. If False, always decode times to ``np.datetime64[ns]`` objects; if this is not possible raise an error. Returns ------- out : Variable A variable holding the decoded equivalent of var. """ # Ensure datetime-like Variables are passed through unmodified (GH 6453) if _contains_datetime_like_objects(var): return var original_dtype = var.dtype if decode_timedelta is None: decode_timedelta = decode_times if concat_characters: if stack_char_dim: var = strings.CharacterArrayCoder().decode(var, name=name) var = strings.EncodedStringCoder().decode(var) if mask_and_scale: for coder in [ variables.UnsignedIntegerCoder(), variables.CFMaskCoder(), variables.CFScaleOffsetCoder(), ]: var = coder.decode(var, name=name) if decode_timedelta: var = times.CFTimedeltaCoder().decode(var, name=name) if decode_times: > var = times.CFDatetimeCoder(use_cftime=use_cftime).decode(var, name=name) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/conventions.py:397: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = variable = [3 values with dtype=float64] Attributes: units: days since 2000-01-01 00:00:00 calendar: proleptic_gregorian name = 't' def decode(self, variable: Variable, name: T_Name = None) -> Variable: units = variable.attrs.get("units", None) if isinstance(units, str) and "since" in units: dims, data, attrs, encoding = unpack_for_decoding(variable) units = pop_to(attrs, encoding, "units") calendar = pop_to(attrs, encoding, "calendar") > dtype = _decode_cf_datetime_dtype(data, units, calendar, self.use_cftime) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:716: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ data = LazilyIndexedArray(array=, key=BasicIndexer((slice(None, None, None),))) units = 'days since 2000-01-01 00:00:00', calendar = 'proleptic_gregorian' use_cftime = None def _decode_cf_datetime_dtype( data, units: str, calendar: str, use_cftime: bool | None ) -> np.dtype: # Verify that at least the first and last date can be decoded # successfully. Otherwise, tracebacks end up swallowed by # Dataset.__repr__ when users try to view their lazily decoded array. values = indexing.ImplicitToExplicitIndexingAdapter(indexing.as_indexable(data)) example_value = np.concatenate( [first_n_items(values, 1) or [0], last_item(values) or [0]] ) try: result = decode_cf_datetime(example_value, units, calendar, use_cftime) except Exception: calendar_msg = ( "the default calendar" if calendar is None else f"calendar {calendar!r}" ) msg = ( f"unable to decode time units {units!r} with {calendar_msg!r}. Try " "opening your dataset with decode_times=False or installing cftime " "if it is not installed." ) > raise ValueError(msg) E ValueError: unable to decode time units 'days since 2000-01-01 00:00:00' with "calendar 'proleptic_gregorian'". Try opening your dataset with decode_times=False or installing cftime if it is not installed. /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:194: ValueError During handling of the above exception, another exception occurred: self = @arm_xfail def test_roundtrip_numpy_datetime_data(self) -> None: times = pd.to_datetime(["2000-01-01", "2000-01-02", "NaT"]) expected = Dataset({"t": ("t", times), "t0": times[0]}) kwargs = {"encoding": {"t0": {"units": "days since 1950-01-01"}}} > with self.roundtrip(expected, save_kwargs=kwargs) as actual: /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:535: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.11/contextlib.py:137: in __enter__ return next(self.gen) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1719: in roundtrip with TestNetCDF4Data.roundtrip( /usr/lib64/python3.11/contextlib.py:137: in __enter__ return next(self.gen) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:311: in roundtrip with self.open(path, **open_kwargs) as ds: /usr/lib64/python3.11/contextlib.py:137: in __enter__ return next(self.gen) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:337: in open with open_dataset(path, engine=self.engine, **kwargs) as ds: /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/backends/api.py:541: in open_dataset backend_ds = backend.open_dataset( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/backends/netCDF4_.py:592: in open_dataset ds = store_entrypoint.open_dataset( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/backends/store.py:35: in open_dataset vars, attrs, coord_names = conventions.decode_cf_variables( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ variables = Frozen({'t': [3 values with dtype=float64] Attributes: _FillValue: nan units: ...e ()> [1 values with dtype=int64] Attributes: units: days since 1950-01-01 calendar: proleptic_gregorian}) attributes = Frozen({}), concat_characters = True, mask_and_scale = True decode_times = True, decode_coords = True, drop_variables = set() use_cftime = None, decode_timedelta = None def decode_cf_variables( variables: T_Variables, attributes: T_Attrs, concat_characters: bool = True, mask_and_scale: bool = True, decode_times: bool = True, decode_coords: bool = True, drop_variables: T_DropVariables = None, use_cftime: bool | None = None, decode_timedelta: bool | None = None, ) -> tuple[T_Variables, T_Attrs, set[Hashable]]: """ Decode several CF encoded variables. See: decode_cf_variable """ dimensions_used_by = defaultdict(list) for v in variables.values(): for d in v.dims: dimensions_used_by[d].append(v) def stackable(dim: Hashable) -> bool: # figure out if a dimension can be concatenated over if dim in variables: return False for v in dimensions_used_by[dim]: if v.dtype.kind != "S" or dim != v.dims[-1]: return False return True coord_names = set() if isinstance(drop_variables, str): drop_variables = [drop_variables] elif drop_variables is None: drop_variables = [] drop_variables = set(drop_variables) # Time bounds coordinates might miss the decoding attributes if decode_times: _update_bounds_attributes(variables) new_vars = {} for k, v in variables.items(): if k in drop_variables: continue stack_char_dim = ( concat_characters and v.dtype == "S1" and v.ndim > 0 and stackable(v.dims[-1]) ) try: new_vars[k] = decode_cf_variable( k, v, concat_characters=concat_characters, mask_and_scale=mask_and_scale, decode_times=decode_times, stack_char_dim=stack_char_dim, use_cftime=use_cftime, decode_timedelta=decode_timedelta, ) except Exception as e: > raise type(e)(f"Failed to decode variable {k!r}: {e}") E ValueError: Failed to decode variable 't': unable to decode time units 'days since 2000-01-01 00:00:00' with "calendar 'proleptic_gregorian'". Try opening your dataset with decode_times=False or installing cftime if it is not installed. /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/conventions.py:562: ValueError _____________ TestScipyFilePath.test_roundtrip_numpy_datetime_data _____________ [gw2] linux -- Python 3.11.4 /usr/bin/python3 num_dates = array([ 0., nan]), units = 'days since 2000-01-01 00:00:00' calendar = 'proleptic_gregorian', use_cftime = None def decode_cf_datetime( num_dates, units: str, calendar: str | None = None, use_cftime: bool | None = None ) -> np.ndarray: """Given an array of numeric dates in netCDF format, convert it into a numpy array of date time objects. For standard (Gregorian) calendars, this function uses vectorized operations, which makes it much faster than cftime.num2date. In such a case, the returned array will be of type np.datetime64. Note that time unit in `units` must not be smaller than microseconds and not larger than days. See Also -------- cftime.num2date """ num_dates = np.asarray(num_dates) flat_num_dates = num_dates.ravel() if calendar is None: calendar = "standard" if use_cftime is None: try: > dates = _decode_datetime_with_pandas(flat_num_dates, units, calendar) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:285: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ flat_num_dates = array([ 0., nan]), units = 'days since 2000-01-01 00:00:00' calendar = 'proleptic_gregorian' def _decode_datetime_with_pandas( flat_num_dates: np.ndarray, units: str, calendar: str ) -> np.ndarray: if not _is_standard_calendar(calendar): raise OutOfBoundsDatetime( "Cannot decode times from a non-standard calendar, {!r}, using " "pandas.".format(calendar) ) delta, ref_date = _unpack_netcdf_time_units(units) delta = _netcdf_to_numpy_timeunit(delta) try: ref_date = pd.Timestamp(ref_date) except ValueError: # ValueError is raised by pd.Timestamp for non-ISO timestamp # strings, in which case we fall back to using cftime raise OutOfBoundsDatetime with warnings.catch_warnings(): warnings.filterwarnings("ignore", "invalid value encountered", RuntimeWarning) if flat_num_dates.size > 0: # avoid size 0 datetimes GH1329 pd.to_timedelta(flat_num_dates.min(), delta) + ref_date pd.to_timedelta(flat_num_dates.max(), delta) + ref_date # To avoid integer overflow when converting to nanosecond units for integer # dtypes smaller than np.int64 cast all integer and unsigned integer dtype # arrays to np.int64 (GH 2002, GH 6589). Note this is safe even in the case # of np.uint64 values, because any np.uint64 value that would lead to # overflow when converting to np.int64 would not be representable with a # timedelta64 value, and therefore would raise an error in the lines above. if flat_num_dates.dtype.kind in "iu": flat_num_dates = flat_num_dates.astype(np.int64) # Cast input ordinals to integers of nanoseconds because pd.to_timedelta # works much faster when dealing with integers (GH 1399). flat_num_dates_ns_int = (flat_num_dates * _NS_PER_TIME_DELTA[delta]).astype( np.int64 ) # Use pd.to_timedelta to safely cast integer values to timedeltas, # and add those to a Timestamp to safely produce a DatetimeIndex. This # ensures that we do not encounter integer overflow at any point in the # process without raising OutOfBoundsDatetime. > return (pd.to_timedelta(flat_num_dates_ns_int, "ns") + ref_date).values /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:258: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['0 days 00:00:00', '106751 days 23:47:16.854775807'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00') @wraps(method) def new_method(self, other): if is_cmp and isinstance(self, ABCIndex) and isinstance(other, ABCSeries): # For comparison ops, Index does *not* defer to Series pass else: for cls in [ABCDataFrame, ABCSeries, ABCIndex]: if isinstance(self, cls): break if isinstance(other, cls): return NotImplemented other = item_from_zerodim(other) > return method(self, other) /usr/lib64/python3.11/site-packages/pandas/core/ops/common.py:72: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['0 days 00:00:00', '106751 days 23:47:16.854775807'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00') @unpack_zerodim_and_defer("__add__") def __add__(self, other): > return self._arith_method(other, operator.add) /usr/lib64/python3.11/site-packages/pandas/core/arraylike.py:102: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['0 days 00:00:00', '106751 days 23:47:16.854775807'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00'), op = def _arith_method(self, other, op): if ( isinstance(other, Index) and is_object_dtype(other.dtype) and type(other) is not Index ): # We return NotImplemented for object-dtype index *subclasses* so they have # a chance to implement ops before we unwrap them. # See https://github.com/pandas-dev/pandas/issues/31109 return NotImplemented > return super()._arith_method(other, op) /usr/lib64/python3.11/site-packages/pandas/core/indexes/base.py:7007: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['0 days 00:00:00', '106751 days 23:47:16.854775807'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00'), op = def _arith_method(self, other, op): res_name = ops.get_op_result_name(self, other) lvalues = self._values rvalues = extract_array(other, extract_numpy=True, extract_range=True) rvalues = ops.maybe_prepare_scalar_for_op(rvalues, lvalues.shape) rvalues = ensure_wrapped_if_datetimelike(rvalues) with np.errstate(all="ignore"): > result = ops.arithmetic_op(lvalues, rvalues, op) /usr/lib64/python3.11/site-packages/pandas/core/base.py:1325: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ left = ['0 days 00:00:00', '106751 days 23:47:16.854775807'] Length: 2, dtype: timedelta64[ns] right = Timestamp('2000-01-01 00:00:00'), op = def arithmetic_op(left: ArrayLike, right: Any, op): """ Evaluate an arithmetic operation `+`, `-`, `*`, `/`, `//`, `%`, `**`, ... Note: the caller is responsible for ensuring that numpy warnings are suppressed (with np.errstate(all="ignore")) if needed. Parameters ---------- left : np.ndarray or ExtensionArray right : object Cannot be a DataFrame or Index. Series is *not* excluded. op : {operator.add, operator.sub, ...} Or one of the reversed variants from roperator. Returns ------- ndarray or ExtensionArray Or a 2-tuple of these in the case of divmod or rdivmod. """ # NB: We assume that extract_array and ensure_wrapped_if_datetimelike # have already been called on `left` and `right`, # and `maybe_prepare_scalar_for_op` has already been called on `right` # We need to special-case datetime64/timedelta64 dtypes (e.g. because numpy # casts integer dtypes to timedelta64 when operating with timedelta64 - GH#22390) if ( should_extension_dispatch(left, right) or isinstance(right, (Timedelta, BaseOffset, Timestamp)) or right is NaT ): # Timedelta/Timestamp and other custom scalars are included in the check # because numexpr will fail on it, see GH#31457 > res_values = op(left, right) /usr/lib64/python3.11/site-packages/pandas/core/ops/array_ops.py:218: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = ['0 days 00:00:00', '106751 days 23:47:16.854775807'] Length: 2, dtype: timedelta64[ns] other = Timestamp('2000-01-01 00:00:00') @wraps(method) def new_method(self, other): if is_cmp and isinstance(self, ABCIndex) and isinstance(other, ABCSeries): # For comparison ops, Index does *not* defer to Series pass else: for cls in [ABCDataFrame, ABCSeries, ABCIndex]: if isinstance(self, cls): break if isinstance(other, cls): return NotImplemented other = item_from_zerodim(other) > return method(self, other) /usr/lib64/python3.11/site-packages/pandas/core/ops/common.py:72: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = ['0 days 00:00:00', '106751 days 23:47:16.854775807'] Length: 2, dtype: timedelta64[ns] other = Timestamp('2000-01-01 00:00:00') @unpack_zerodim_and_defer("__add__") def __add__(self, other): other_dtype = getattr(other, "dtype", None) # scalar others if other is NaT: result = self._add_nat() elif isinstance(other, (Tick, timedelta, np.timedelta64)): result = self._add_timedeltalike_scalar(other) elif isinstance(other, BaseOffset): # specifically _not_ a Tick result = self._add_offset(other) elif isinstance(other, (datetime, np.datetime64)): > result = self._add_datetimelike_scalar(other) /usr/lib64/python3.11/site-packages/pandas/core/arrays/datetimelike.py:1441: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = ['0 days 00:00:00', '106751 days 23:47:16.854775807'] Length: 2, dtype: timedelta64[ns] other = Timestamp('2000-01-01 00:00:00') @final def _add_datetimelike_scalar(self, other) -> DatetimeArray: if not is_timedelta64_dtype(self.dtype): raise TypeError( f"cannot add {type(self).__name__} and {type(other).__name__}" ) self = cast("TimedeltaArray", self) from pandas.core.arrays import DatetimeArray from pandas.core.arrays.datetimes import tz_to_dtype assert other is not NaT other = Timestamp(other) if other is NaT: # In this case we specifically interpret NaT as a datetime, not # the timedelta interpretation we would get by returning self + NaT result = self._ndarray + NaT.to_datetime64().astype(f"M8[{self._unit}]") # Preserve our resolution return DatetimeArray._simple_new(result, dtype=result.dtype) if self._reso != other._reso: raise NotImplementedError( "Addition between TimedeltaArray and Timestamp with mis-matched " "resolutions is not yet supported." ) i8 = self.asi8 > result = checked_add_with_arr(i8, other.value, arr_mask=self._isnan) /usr/lib64/python3.11/site-packages/pandas/core/arrays/datetimelike.py:1142: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ arr = array([ 0, 9223372036854775807]), b = 946684800000000000 arr_mask = array([False, False]), b_mask = None def checked_add_with_arr( arr: npt.NDArray[np.int64], b: int | npt.NDArray[np.int64], arr_mask: npt.NDArray[np.bool_] | None = None, b_mask: npt.NDArray[np.bool_] | None = None, ) -> npt.NDArray[np.int64]: """ Perform array addition that checks for underflow and overflow. Performs the addition of an int64 array and an int64 integer (or array) but checks that they do not result in overflow first. For elements that are indicated to be NaN, whether or not there is overflow for that element is automatically ignored. Parameters ---------- arr : np.ndarray[int64] addend. b : array or scalar addend. arr_mask : np.ndarray[bool] or None, default None array indicating which elements to exclude from checking b_mask : np.ndarray[bool] or None, default None array or scalar indicating which element(s) to exclude from checking Returns ------- sum : An array for elements x + b for each element x in arr if b is a scalar or an array for elements x + y for each element pair (x, y) in (arr, b). Raises ------ OverflowError if any x + y exceeds the maximum or minimum int64 value. """ # For performance reasons, we broadcast 'b' to the new array 'b2' # so that it has the same size as 'arr'. b2 = np.broadcast_to(b, arr.shape) if b_mask is not None: # We do the same broadcasting for b_mask as well. b2_mask = np.broadcast_to(b_mask, arr.shape) else: b2_mask = None # For elements that are NaN, regardless of their value, we should # ignore whether they overflow or not when doing the checked add. if arr_mask is not None and b2_mask is not None: not_nan = np.logical_not(arr_mask | b2_mask) elif arr_mask is not None: not_nan = np.logical_not(arr_mask) elif b_mask is not None: # error: Argument 1 to "__call__" of "_UFunc_Nin1_Nout1" has # incompatible type "Optional[ndarray[Any, dtype[bool_]]]"; # expected "Union[_SupportsArray[dtype[Any]], _NestedSequence # [_SupportsArray[dtype[Any]]], bool, int, float, complex, str # , bytes, _NestedSequence[Union[bool, int, float, complex, str # , bytes]]]" not_nan = np.logical_not(b2_mask) # type: ignore[arg-type] else: not_nan = np.empty(arr.shape, dtype=bool) not_nan.fill(True) # gh-14324: For each element in 'arr' and its corresponding element # in 'b2', we check the sign of the element in 'b2'. If it is positive, # we then check whether its sum with the element in 'arr' exceeds # np.iinfo(np.int64).max. If so, we have an overflow error. If it # it is negative, we then check whether its sum with the element in # 'arr' exceeds np.iinfo(np.int64).min. If so, we have an overflow # error as well. i8max = lib.i8max i8min = iNaT mask1 = b2 > 0 mask2 = b2 < 0 if not mask1.any(): to_raise = ((i8min - b2 > arr) & not_nan).any() elif not mask2.any(): to_raise = ((i8max - b2 < arr) & not_nan).any() else: to_raise = ((i8max - b2[mask1] < arr[mask1]) & not_nan[mask1]).any() or ( (i8min - b2[mask2] > arr[mask2]) & not_nan[mask2] ).any() if to_raise: > raise OverflowError("Overflow in int64 addition") E OverflowError: Overflow in int64 addition /usr/lib64/python3.11/site-packages/pandas/core/algorithms.py:1249: OverflowError During handling of the above exception, another exception occurred: times = array([cftime.DatetimeProlepticGregorian(2000, 1, 1, 0, 0, 0, 0, has_year_zero=True), cftime.DatetimeProlepticGregorian(294277, 1, 9, 4, 0, 54, 775807, has_year_zero=True)], dtype=object) raise_on_invalid = True def cftime_to_nptime(times, raise_on_invalid: bool = True) -> np.ndarray: """Given an array of cftime.datetime objects, return an array of numpy.datetime64 objects of the same size If raise_on_invalid is True (default), invalid dates trigger a ValueError. Otherwise, the invalid element is replaced by np.NaT.""" times = np.asarray(times) new = np.empty(times.shape, dtype="M8[ns]") for i, t in np.ndenumerate(times): try: # Use pandas.Timestamp in place of datetime.datetime, because # NumPy casts it safely it np.datetime64[ns] for dates outside # 1678 to 2262 (this is not currently the case for # datetime.datetime). > dt = pd.Timestamp( t.year, t.month, t.day, t.hour, t.minute, t.second, t.microsecond ) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:448: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > ??? E ValueError: year 294277 is out of range pandas/_libs/tslibs/timestamps.pyx:1673: ValueError During handling of the above exception, another exception occurred: data = units = 'days since 2000-01-01 00:00:00', calendar = 'proleptic_gregorian' use_cftime = None def _decode_cf_datetime_dtype( data, units: str, calendar: str, use_cftime: bool | None ) -> np.dtype: # Verify that at least the first and last date can be decoded # successfully. Otherwise, tracebacks end up swallowed by # Dataset.__repr__ when users try to view their lazily decoded array. values = indexing.ImplicitToExplicitIndexingAdapter(indexing.as_indexable(data)) example_value = np.concatenate( [first_n_items(values, 1) or [0], last_item(values) or [0]] ) try: > result = decode_cf_datetime(example_value, units, calendar, use_cftime) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:184: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ num_dates = array([ 0., nan]), units = 'days since 2000-01-01 00:00:00' calendar = 'proleptic_gregorian', use_cftime = None def decode_cf_datetime( num_dates, units: str, calendar: str | None = None, use_cftime: bool | None = None ) -> np.ndarray: """Given an array of numeric dates in netCDF format, convert it into a numpy array of date time objects. For standard (Gregorian) calendars, this function uses vectorized operations, which makes it much faster than cftime.num2date. In such a case, the returned array will be of type np.datetime64. Note that time unit in `units` must not be smaller than microseconds and not larger than days. See Also -------- cftime.num2date """ num_dates = np.asarray(num_dates) flat_num_dates = num_dates.ravel() if calendar is None: calendar = "standard" if use_cftime is None: try: dates = _decode_datetime_with_pandas(flat_num_dates, units, calendar) except (KeyError, OutOfBoundsDatetime, OutOfBoundsTimedelta, OverflowError): dates = _decode_datetime_with_cftime( flat_num_dates.astype(float), units, calendar ) if ( dates[np.nanargmin(num_dates)].year < 1678 or dates[np.nanargmax(num_dates)].year >= 2262 ): if _is_standard_calendar(calendar): warnings.warn( "Unable to decode time axis into full " "numpy.datetime64 objects, continuing using " "cftime.datetime objects instead, reason: dates out " "of range", SerializationWarning, stacklevel=3, ) else: if _is_standard_calendar(calendar): > dates = cftime_to_nptime(dates) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:306: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ times = array([cftime.DatetimeProlepticGregorian(2000, 1, 1, 0, 0, 0, 0, has_year_zero=True), cftime.DatetimeProlepticGregorian(294277, 1, 9, 4, 0, 54, 775807, has_year_zero=True)], dtype=object) raise_on_invalid = True def cftime_to_nptime(times, raise_on_invalid: bool = True) -> np.ndarray: """Given an array of cftime.datetime objects, return an array of numpy.datetime64 objects of the same size If raise_on_invalid is True (default), invalid dates trigger a ValueError. Otherwise, the invalid element is replaced by np.NaT.""" times = np.asarray(times) new = np.empty(times.shape, dtype="M8[ns]") for i, t in np.ndenumerate(times): try: # Use pandas.Timestamp in place of datetime.datetime, because # NumPy casts it safely it np.datetime64[ns] for dates outside # 1678 to 2262 (this is not currently the case for # datetime.datetime). dt = pd.Timestamp( t.year, t.month, t.day, t.hour, t.minute, t.second, t.microsecond ) except ValueError as e: if raise_on_invalid: > raise ValueError( "Cannot convert date {} to a date in the " "standard calendar. Reason: {}.".format(t, e) ) E ValueError: Cannot convert date 294277-01-09 04:00:54 to a date in the standard calendar. Reason: year 294277 is out of range. /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:453: ValueError During handling of the above exception, another exception occurred: variables = Frozen({'t': [3 values with dtype=float64] Attributes: units: days since 2000-01-01...e ()> [1 values with dtype=int32] Attributes: units: days since 1950-01-01 calendar: proleptic_gregorian}) attributes = Frozen({}), concat_characters = True, mask_and_scale = True decode_times = True, decode_coords = True, drop_variables = set() use_cftime = None, decode_timedelta = None def decode_cf_variables( variables: T_Variables, attributes: T_Attrs, concat_characters: bool = True, mask_and_scale: bool = True, decode_times: bool = True, decode_coords: bool = True, drop_variables: T_DropVariables = None, use_cftime: bool | None = None, decode_timedelta: bool | None = None, ) -> tuple[T_Variables, T_Attrs, set[Hashable]]: """ Decode several CF encoded variables. See: decode_cf_variable """ dimensions_used_by = defaultdict(list) for v in variables.values(): for d in v.dims: dimensions_used_by[d].append(v) def stackable(dim: Hashable) -> bool: # figure out if a dimension can be concatenated over if dim in variables: return False for v in dimensions_used_by[dim]: if v.dtype.kind != "S" or dim != v.dims[-1]: return False return True coord_names = set() if isinstance(drop_variables, str): drop_variables = [drop_variables] elif drop_variables is None: drop_variables = [] drop_variables = set(drop_variables) # Time bounds coordinates might miss the decoding attributes if decode_times: _update_bounds_attributes(variables) new_vars = {} for k, v in variables.items(): if k in drop_variables: continue stack_char_dim = ( concat_characters and v.dtype == "S1" and v.ndim > 0 and stackable(v.dims[-1]) ) try: > new_vars[k] = decode_cf_variable( k, v, concat_characters=concat_characters, mask_and_scale=mask_and_scale, decode_times=decode_times, stack_char_dim=stack_char_dim, use_cftime=use_cftime, decode_timedelta=decode_timedelta, ) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/conventions.py:551: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ name = 't' var = [3 values with dtype=float64] Attributes: units: days since 2000-01-01 00:00:00 calendar: proleptic_gregorian concat_characters = True, mask_and_scale = True, decode_times = True decode_endianness = True, stack_char_dim = False, use_cftime = None decode_timedelta = True def decode_cf_variable( name: Hashable, var: Variable, concat_characters: bool = True, mask_and_scale: bool = True, decode_times: bool = True, decode_endianness: bool = True, stack_char_dim: bool = True, use_cftime: bool | None = None, decode_timedelta: bool | None = None, ) -> Variable: """ Decodes a variable which may hold CF encoded information. This includes variables that have been masked and scaled, which hold CF style time variables (this is almost always the case if the dataset has been serialized) and which have strings encoded as character arrays. Parameters ---------- name : str Name of the variable. Used for better error messages. var : Variable A variable holding potentially CF encoded information. concat_characters : bool Should character arrays be concatenated to strings, for example: ["h", "e", "l", "l", "o"] -> "hello" mask_and_scale : bool Lazily scale (using scale_factor and add_offset) and mask (using _FillValue). If the _Unsigned attribute is present treat integer arrays as unsigned. decode_times : bool Decode cf times ("hours since 2000-01-01") to np.datetime64. decode_endianness : bool Decode arrays from non-native to native endianness. stack_char_dim : bool Whether to stack characters into bytes along the last dimension of this array. Passed as an argument because we need to look at the full dataset to figure out if this is appropriate. use_cftime : bool, optional Only relevant if encoded dates come from a standard calendar (e.g. "gregorian", "proleptic_gregorian", "standard", or not specified). If None (default), attempt to decode times to ``np.datetime64[ns]`` objects; if this is not possible, decode times to ``cftime.datetime`` objects. If True, always decode times to ``cftime.datetime`` objects, regardless of whether or not they can be represented using ``np.datetime64[ns]`` objects. If False, always decode times to ``np.datetime64[ns]`` objects; if this is not possible raise an error. Returns ------- out : Variable A variable holding the decoded equivalent of var. """ # Ensure datetime-like Variables are passed through unmodified (GH 6453) if _contains_datetime_like_objects(var): return var original_dtype = var.dtype if decode_timedelta is None: decode_timedelta = decode_times if concat_characters: if stack_char_dim: var = strings.CharacterArrayCoder().decode(var, name=name) var = strings.EncodedStringCoder().decode(var) if mask_and_scale: for coder in [ variables.UnsignedIntegerCoder(), variables.CFMaskCoder(), variables.CFScaleOffsetCoder(), ]: var = coder.decode(var, name=name) if decode_timedelta: var = times.CFTimedeltaCoder().decode(var, name=name) if decode_times: > var = times.CFDatetimeCoder(use_cftime=use_cftime).decode(var, name=name) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/conventions.py:397: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = variable = [3 values with dtype=float64] Attributes: units: days since 2000-01-01 00:00:00 calendar: proleptic_gregorian name = 't' def decode(self, variable: Variable, name: T_Name = None) -> Variable: units = variable.attrs.get("units", None) if isinstance(units, str) and "since" in units: dims, data, attrs, encoding = unpack_for_decoding(variable) units = pop_to(attrs, encoding, "units") calendar = pop_to(attrs, encoding, "calendar") > dtype = _decode_cf_datetime_dtype(data, units, calendar, self.use_cftime) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:716: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ data = units = 'days since 2000-01-01 00:00:00', calendar = 'proleptic_gregorian' use_cftime = None def _decode_cf_datetime_dtype( data, units: str, calendar: str, use_cftime: bool | None ) -> np.dtype: # Verify that at least the first and last date can be decoded # successfully. Otherwise, tracebacks end up swallowed by # Dataset.__repr__ when users try to view their lazily decoded array. values = indexing.ImplicitToExplicitIndexingAdapter(indexing.as_indexable(data)) example_value = np.concatenate( [first_n_items(values, 1) or [0], last_item(values) or [0]] ) try: result = decode_cf_datetime(example_value, units, calendar, use_cftime) except Exception: calendar_msg = ( "the default calendar" if calendar is None else f"calendar {calendar!r}" ) msg = ( f"unable to decode time units {units!r} with {calendar_msg!r}. Try " "opening your dataset with decode_times=False or installing cftime " "if it is not installed." ) > raise ValueError(msg) E ValueError: unable to decode time units 'days since 2000-01-01 00:00:00' with "calendar 'proleptic_gregorian'". Try opening your dataset with decode_times=False or installing cftime if it is not installed. /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:194: ValueError During handling of the above exception, another exception occurred: self = @arm_xfail def test_roundtrip_numpy_datetime_data(self) -> None: times = pd.to_datetime(["2000-01-01", "2000-01-02", "NaT"]) expected = Dataset({"t": ("t", times), "t0": times[0]}) kwargs = {"encoding": {"t0": {"units": "days since 1950-01-01"}}} > with self.roundtrip(expected, save_kwargs=kwargs) as actual: /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:535: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.11/contextlib.py:137: in __enter__ return next(self.gen) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:311: in roundtrip with self.open(path, **open_kwargs) as ds: /usr/lib64/python3.11/contextlib.py:137: in __enter__ return next(self.gen) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:337: in open with open_dataset(path, engine=self.engine, **kwargs) as ds: /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/backends/api.py:541: in open_dataset backend_ds = backend.open_dataset( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/backends/scipy_.py:307: in open_dataset ds = store_entrypoint.open_dataset( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/backends/store.py:35: in open_dataset vars, attrs, coord_names = conventions.decode_cf_variables( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ variables = Frozen({'t': [3 values with dtype=float64] Attributes: units: days since 2000-01-01...e ()> [1 values with dtype=int32] Attributes: units: days since 1950-01-01 calendar: proleptic_gregorian}) attributes = Frozen({}), concat_characters = True, mask_and_scale = True decode_times = True, decode_coords = True, drop_variables = set() use_cftime = None, decode_timedelta = None def decode_cf_variables( variables: T_Variables, attributes: T_Attrs, concat_characters: bool = True, mask_and_scale: bool = True, decode_times: bool = True, decode_coords: bool = True, drop_variables: T_DropVariables = None, use_cftime: bool | None = None, decode_timedelta: bool | None = None, ) -> tuple[T_Variables, T_Attrs, set[Hashable]]: """ Decode several CF encoded variables. See: decode_cf_variable """ dimensions_used_by = defaultdict(list) for v in variables.values(): for d in v.dims: dimensions_used_by[d].append(v) def stackable(dim: Hashable) -> bool: # figure out if a dimension can be concatenated over if dim in variables: return False for v in dimensions_used_by[dim]: if v.dtype.kind != "S" or dim != v.dims[-1]: return False return True coord_names = set() if isinstance(drop_variables, str): drop_variables = [drop_variables] elif drop_variables is None: drop_variables = [] drop_variables = set(drop_variables) # Time bounds coordinates might miss the decoding attributes if decode_times: _update_bounds_attributes(variables) new_vars = {} for k, v in variables.items(): if k in drop_variables: continue stack_char_dim = ( concat_characters and v.dtype == "S1" and v.ndim > 0 and stackable(v.dims[-1]) ) try: new_vars[k] = decode_cf_variable( k, v, concat_characters=concat_characters, mask_and_scale=mask_and_scale, decode_times=decode_times, stack_char_dim=stack_char_dim, use_cftime=use_cftime, decode_timedelta=decode_timedelta, ) except Exception as e: > raise type(e)(f"Failed to decode variable {k!r}: {e}") E ValueError: Failed to decode variable 't': unable to decode time units 'days since 2000-01-01 00:00:00' with "calendar 'proleptic_gregorian'". Try opening your dataset with decode_times=False or installing cftime if it is not installed. /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/conventions.py:562: ValueError __________ TestCFEncodedDataStore.test_roundtrip_numpy_datetime_data ___________ [gw0] linux -- Python 3.11.4 /usr/bin/python3 num_dates = array([ 0., nan]), units = 'days since 2000-01-01 00:00:00' calendar = 'proleptic_gregorian', use_cftime = None def decode_cf_datetime( num_dates, units: str, calendar: str | None = None, use_cftime: bool | None = None ) -> np.ndarray: """Given an array of numeric dates in netCDF format, convert it into a numpy array of date time objects. For standard (Gregorian) calendars, this function uses vectorized operations, which makes it much faster than cftime.num2date. In such a case, the returned array will be of type np.datetime64. Note that time unit in `units` must not be smaller than microseconds and not larger than days. See Also -------- cftime.num2date """ num_dates = np.asarray(num_dates) flat_num_dates = num_dates.ravel() if calendar is None: calendar = "standard" if use_cftime is None: try: > dates = _decode_datetime_with_pandas(flat_num_dates, units, calendar) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:285: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ flat_num_dates = array([ 0., nan]), units = 'days since 2000-01-01 00:00:00' calendar = 'proleptic_gregorian' def _decode_datetime_with_pandas( flat_num_dates: np.ndarray, units: str, calendar: str ) -> np.ndarray: if not _is_standard_calendar(calendar): raise OutOfBoundsDatetime( "Cannot decode times from a non-standard calendar, {!r}, using " "pandas.".format(calendar) ) delta, ref_date = _unpack_netcdf_time_units(units) delta = _netcdf_to_numpy_timeunit(delta) try: ref_date = pd.Timestamp(ref_date) except ValueError: # ValueError is raised by pd.Timestamp for non-ISO timestamp # strings, in which case we fall back to using cftime raise OutOfBoundsDatetime with warnings.catch_warnings(): warnings.filterwarnings("ignore", "invalid value encountered", RuntimeWarning) if flat_num_dates.size > 0: # avoid size 0 datetimes GH1329 pd.to_timedelta(flat_num_dates.min(), delta) + ref_date pd.to_timedelta(flat_num_dates.max(), delta) + ref_date # To avoid integer overflow when converting to nanosecond units for integer # dtypes smaller than np.int64 cast all integer and unsigned integer dtype # arrays to np.int64 (GH 2002, GH 6589). Note this is safe even in the case # of np.uint64 values, because any np.uint64 value that would lead to # overflow when converting to np.int64 would not be representable with a # timedelta64 value, and therefore would raise an error in the lines above. if flat_num_dates.dtype.kind in "iu": flat_num_dates = flat_num_dates.astype(np.int64) # Cast input ordinals to integers of nanoseconds because pd.to_timedelta # works much faster when dealing with integers (GH 1399). flat_num_dates_ns_int = (flat_num_dates * _NS_PER_TIME_DELTA[delta]).astype( np.int64 ) # Use pd.to_timedelta to safely cast integer values to timedeltas, # and add those to a Timestamp to safely produce a DatetimeIndex. This # ensures that we do not encounter integer overflow at any point in the # process without raising OutOfBoundsDatetime. > return (pd.to_timedelta(flat_num_dates_ns_int, "ns") + ref_date).values /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:258: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['0 days 00:00:00', '106751 days 23:47:16.854775807'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00') @wraps(method) def new_method(self, other): if is_cmp and isinstance(self, ABCIndex) and isinstance(other, ABCSeries): # For comparison ops, Index does *not* defer to Series pass else: for cls in [ABCDataFrame, ABCSeries, ABCIndex]: if isinstance(self, cls): break if isinstance(other, cls): return NotImplemented other = item_from_zerodim(other) > return method(self, other) /usr/lib64/python3.11/site-packages/pandas/core/ops/common.py:72: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['0 days 00:00:00', '106751 days 23:47:16.854775807'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00') @unpack_zerodim_and_defer("__add__") def __add__(self, other): > return self._arith_method(other, operator.add) /usr/lib64/python3.11/site-packages/pandas/core/arraylike.py:102: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['0 days 00:00:00', '106751 days 23:47:16.854775807'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00'), op = def _arith_method(self, other, op): if ( isinstance(other, Index) and is_object_dtype(other.dtype) and type(other) is not Index ): # We return NotImplemented for object-dtype index *subclasses* so they have # a chance to implement ops before we unwrap them. # See https://github.com/pandas-dev/pandas/issues/31109 return NotImplemented > return super()._arith_method(other, op) /usr/lib64/python3.11/site-packages/pandas/core/indexes/base.py:7007: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['0 days 00:00:00', '106751 days 23:47:16.854775807'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00'), op = def _arith_method(self, other, op): res_name = ops.get_op_result_name(self, other) lvalues = self._values rvalues = extract_array(other, extract_numpy=True, extract_range=True) rvalues = ops.maybe_prepare_scalar_for_op(rvalues, lvalues.shape) rvalues = ensure_wrapped_if_datetimelike(rvalues) with np.errstate(all="ignore"): > result = ops.arithmetic_op(lvalues, rvalues, op) /usr/lib64/python3.11/site-packages/pandas/core/base.py:1325: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ left = ['0 days 00:00:00', '106751 days 23:47:16.854775807'] Length: 2, dtype: timedelta64[ns] right = Timestamp('2000-01-01 00:00:00'), op = def arithmetic_op(left: ArrayLike, right: Any, op): """ Evaluate an arithmetic operation `+`, `-`, `*`, `/`, `//`, `%`, `**`, ... Note: the caller is responsible for ensuring that numpy warnings are suppressed (with np.errstate(all="ignore")) if needed. Parameters ---------- left : np.ndarray or ExtensionArray right : object Cannot be a DataFrame or Index. Series is *not* excluded. op : {operator.add, operator.sub, ...} Or one of the reversed variants from roperator. Returns ------- ndarray or ExtensionArray Or a 2-tuple of these in the case of divmod or rdivmod. """ # NB: We assume that extract_array and ensure_wrapped_if_datetimelike # have already been called on `left` and `right`, # and `maybe_prepare_scalar_for_op` has already been called on `right` # We need to special-case datetime64/timedelta64 dtypes (e.g. because numpy # casts integer dtypes to timedelta64 when operating with timedelta64 - GH#22390) if ( should_extension_dispatch(left, right) or isinstance(right, (Timedelta, BaseOffset, Timestamp)) or right is NaT ): # Timedelta/Timestamp and other custom scalars are included in the check # because numexpr will fail on it, see GH#31457 > res_values = op(left, right) /usr/lib64/python3.11/site-packages/pandas/core/ops/array_ops.py:218: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = ['0 days 00:00:00', '106751 days 23:47:16.854775807'] Length: 2, dtype: timedelta64[ns] other = Timestamp('2000-01-01 00:00:00') @wraps(method) def new_method(self, other): if is_cmp and isinstance(self, ABCIndex) and isinstance(other, ABCSeries): # For comparison ops, Index does *not* defer to Series pass else: for cls in [ABCDataFrame, ABCSeries, ABCIndex]: if isinstance(self, cls): break if isinstance(other, cls): return NotImplemented other = item_from_zerodim(other) > return method(self, other) /usr/lib64/python3.11/site-packages/pandas/core/ops/common.py:72: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = ['0 days 00:00:00', '106751 days 23:47:16.854775807'] Length: 2, dtype: timedelta64[ns] other = Timestamp('2000-01-01 00:00:00') @unpack_zerodim_and_defer("__add__") def __add__(self, other): other_dtype = getattr(other, "dtype", None) # scalar others if other is NaT: result = self._add_nat() elif isinstance(other, (Tick, timedelta, np.timedelta64)): result = self._add_timedeltalike_scalar(other) elif isinstance(other, BaseOffset): # specifically _not_ a Tick result = self._add_offset(other) elif isinstance(other, (datetime, np.datetime64)): > result = self._add_datetimelike_scalar(other) /usr/lib64/python3.11/site-packages/pandas/core/arrays/datetimelike.py:1441: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = ['0 days 00:00:00', '106751 days 23:47:16.854775807'] Length: 2, dtype: timedelta64[ns] other = Timestamp('2000-01-01 00:00:00') @final def _add_datetimelike_scalar(self, other) -> DatetimeArray: if not is_timedelta64_dtype(self.dtype): raise TypeError( f"cannot add {type(self).__name__} and {type(other).__name__}" ) self = cast("TimedeltaArray", self) from pandas.core.arrays import DatetimeArray from pandas.core.arrays.datetimes import tz_to_dtype assert other is not NaT other = Timestamp(other) if other is NaT: # In this case we specifically interpret NaT as a datetime, not # the timedelta interpretation we would get by returning self + NaT result = self._ndarray + NaT.to_datetime64().astype(f"M8[{self._unit}]") # Preserve our resolution return DatetimeArray._simple_new(result, dtype=result.dtype) if self._reso != other._reso: raise NotImplementedError( "Addition between TimedeltaArray and Timestamp with mis-matched " "resolutions is not yet supported." ) i8 = self.asi8 > result = checked_add_with_arr(i8, other.value, arr_mask=self._isnan) /usr/lib64/python3.11/site-packages/pandas/core/arrays/datetimelike.py:1142: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ arr = array([ 0, 9223372036854775807]), b = 946684800000000000 arr_mask = array([False, False]), b_mask = None def checked_add_with_arr( arr: npt.NDArray[np.int64], b: int | npt.NDArray[np.int64], arr_mask: npt.NDArray[np.bool_] | None = None, b_mask: npt.NDArray[np.bool_] | None = None, ) -> npt.NDArray[np.int64]: """ Perform array addition that checks for underflow and overflow. Performs the addition of an int64 array and an int64 integer (or array) but checks that they do not result in overflow first. For elements that are indicated to be NaN, whether or not there is overflow for that element is automatically ignored. Parameters ---------- arr : np.ndarray[int64] addend. b : array or scalar addend. arr_mask : np.ndarray[bool] or None, default None array indicating which elements to exclude from checking b_mask : np.ndarray[bool] or None, default None array or scalar indicating which element(s) to exclude from checking Returns ------- sum : An array for elements x + b for each element x in arr if b is a scalar or an array for elements x + y for each element pair (x, y) in (arr, b). Raises ------ OverflowError if any x + y exceeds the maximum or minimum int64 value. """ # For performance reasons, we broadcast 'b' to the new array 'b2' # so that it has the same size as 'arr'. b2 = np.broadcast_to(b, arr.shape) if b_mask is not None: # We do the same broadcasting for b_mask as well. b2_mask = np.broadcast_to(b_mask, arr.shape) else: b2_mask = None # For elements that are NaN, regardless of their value, we should # ignore whether they overflow or not when doing the checked add. if arr_mask is not None and b2_mask is not None: not_nan = np.logical_not(arr_mask | b2_mask) elif arr_mask is not None: not_nan = np.logical_not(arr_mask) elif b_mask is not None: # error: Argument 1 to "__call__" of "_UFunc_Nin1_Nout1" has # incompatible type "Optional[ndarray[Any, dtype[bool_]]]"; # expected "Union[_SupportsArray[dtype[Any]], _NestedSequence # [_SupportsArray[dtype[Any]]], bool, int, float, complex, str # , bytes, _NestedSequence[Union[bool, int, float, complex, str # , bytes]]]" not_nan = np.logical_not(b2_mask) # type: ignore[arg-type] else: not_nan = np.empty(arr.shape, dtype=bool) not_nan.fill(True) # gh-14324: For each element in 'arr' and its corresponding element # in 'b2', we check the sign of the element in 'b2'. If it is positive, # we then check whether its sum with the element in 'arr' exceeds # np.iinfo(np.int64).max. If so, we have an overflow error. If it # it is negative, we then check whether its sum with the element in # 'arr' exceeds np.iinfo(np.int64).min. If so, we have an overflow # error as well. i8max = lib.i8max i8min = iNaT mask1 = b2 > 0 mask2 = b2 < 0 if not mask1.any(): to_raise = ((i8min - b2 > arr) & not_nan).any() elif not mask2.any(): to_raise = ((i8max - b2 < arr) & not_nan).any() else: to_raise = ((i8max - b2[mask1] < arr[mask1]) & not_nan[mask1]).any() or ( (i8min - b2[mask2] > arr[mask2]) & not_nan[mask2] ).any() if to_raise: > raise OverflowError("Overflow in int64 addition") E OverflowError: Overflow in int64 addition /usr/lib64/python3.11/site-packages/pandas/core/algorithms.py:1249: OverflowError During handling of the above exception, another exception occurred: times = array([cftime.DatetimeProlepticGregorian(2000, 1, 1, 0, 0, 0, 0, has_year_zero=True), cftime.DatetimeProlepticGregorian(294277, 1, 9, 4, 0, 54, 775807, has_year_zero=True)], dtype=object) raise_on_invalid = True def cftime_to_nptime(times, raise_on_invalid: bool = True) -> np.ndarray: """Given an array of cftime.datetime objects, return an array of numpy.datetime64 objects of the same size If raise_on_invalid is True (default), invalid dates trigger a ValueError. Otherwise, the invalid element is replaced by np.NaT.""" times = np.asarray(times) new = np.empty(times.shape, dtype="M8[ns]") for i, t in np.ndenumerate(times): try: # Use pandas.Timestamp in place of datetime.datetime, because # NumPy casts it safely it np.datetime64[ns] for dates outside # 1678 to 2262 (this is not currently the case for # datetime.datetime). > dt = pd.Timestamp( t.year, t.month, t.day, t.hour, t.minute, t.second, t.microsecond ) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:448: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > ??? E ValueError: year 294277 is out of range pandas/_libs/tslibs/timestamps.pyx:1673: ValueError During handling of the above exception, another exception occurred: data = array([ 0., 1., nan]), units = 'days since 2000-01-01 00:00:00' calendar = 'proleptic_gregorian', use_cftime = None def _decode_cf_datetime_dtype( data, units: str, calendar: str, use_cftime: bool | None ) -> np.dtype: # Verify that at least the first and last date can be decoded # successfully. Otherwise, tracebacks end up swallowed by # Dataset.__repr__ when users try to view their lazily decoded array. values = indexing.ImplicitToExplicitIndexingAdapter(indexing.as_indexable(data)) example_value = np.concatenate( [first_n_items(values, 1) or [0], last_item(values) or [0]] ) try: > result = decode_cf_datetime(example_value, units, calendar, use_cftime) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:184: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ num_dates = array([ 0., nan]), units = 'days since 2000-01-01 00:00:00' calendar = 'proleptic_gregorian', use_cftime = None def decode_cf_datetime( num_dates, units: str, calendar: str | None = None, use_cftime: bool | None = None ) -> np.ndarray: """Given an array of numeric dates in netCDF format, convert it into a numpy array of date time objects. For standard (Gregorian) calendars, this function uses vectorized operations, which makes it much faster than cftime.num2date. In such a case, the returned array will be of type np.datetime64. Note that time unit in `units` must not be smaller than microseconds and not larger than days. See Also -------- cftime.num2date """ num_dates = np.asarray(num_dates) flat_num_dates = num_dates.ravel() if calendar is None: calendar = "standard" if use_cftime is None: try: dates = _decode_datetime_with_pandas(flat_num_dates, units, calendar) except (KeyError, OutOfBoundsDatetime, OutOfBoundsTimedelta, OverflowError): dates = _decode_datetime_with_cftime( flat_num_dates.astype(float), units, calendar ) if ( dates[np.nanargmin(num_dates)].year < 1678 or dates[np.nanargmax(num_dates)].year >= 2262 ): if _is_standard_calendar(calendar): warnings.warn( "Unable to decode time axis into full " "numpy.datetime64 objects, continuing using " "cftime.datetime objects instead, reason: dates out " "of range", SerializationWarning, stacklevel=3, ) else: if _is_standard_calendar(calendar): > dates = cftime_to_nptime(dates) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:306: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ times = array([cftime.DatetimeProlepticGregorian(2000, 1, 1, 0, 0, 0, 0, has_year_zero=True), cftime.DatetimeProlepticGregorian(294277, 1, 9, 4, 0, 54, 775807, has_year_zero=True)], dtype=object) raise_on_invalid = True def cftime_to_nptime(times, raise_on_invalid: bool = True) -> np.ndarray: """Given an array of cftime.datetime objects, return an array of numpy.datetime64 objects of the same size If raise_on_invalid is True (default), invalid dates trigger a ValueError. Otherwise, the invalid element is replaced by np.NaT.""" times = np.asarray(times) new = np.empty(times.shape, dtype="M8[ns]") for i, t in np.ndenumerate(times): try: # Use pandas.Timestamp in place of datetime.datetime, because # NumPy casts it safely it np.datetime64[ns] for dates outside # 1678 to 2262 (this is not currently the case for # datetime.datetime). dt = pd.Timestamp( t.year, t.month, t.day, t.hour, t.minute, t.second, t.microsecond ) except ValueError as e: if raise_on_invalid: > raise ValueError( "Cannot convert date {} to a date in the " "standard calendar. Reason: {}.".format(t, e) ) E ValueError: Cannot convert date 294277-01-09 04:00:54 to a date in the standard calendar. Reason: year 294277 is out of range. /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:453: ValueError During handling of the above exception, another exception occurred: variables = Frozen({'t': array([ 0., 1., nan]) Attributes: units: days since 2000-01-01 00:00:... array(18262) Attributes: units: days since 1950-01-01 calendar: proleptic_gregorian}) attributes = Frozen({}), concat_characters = True, mask_and_scale = True decode_times = True, decode_coords = True, drop_variables = set() use_cftime = None, decode_timedelta = None def decode_cf_variables( variables: T_Variables, attributes: T_Attrs, concat_characters: bool = True, mask_and_scale: bool = True, decode_times: bool = True, decode_coords: bool = True, drop_variables: T_DropVariables = None, use_cftime: bool | None = None, decode_timedelta: bool | None = None, ) -> tuple[T_Variables, T_Attrs, set[Hashable]]: """ Decode several CF encoded variables. See: decode_cf_variable """ dimensions_used_by = defaultdict(list) for v in variables.values(): for d in v.dims: dimensions_used_by[d].append(v) def stackable(dim: Hashable) -> bool: # figure out if a dimension can be concatenated over if dim in variables: return False for v in dimensions_used_by[dim]: if v.dtype.kind != "S" or dim != v.dims[-1]: return False return True coord_names = set() if isinstance(drop_variables, str): drop_variables = [drop_variables] elif drop_variables is None: drop_variables = [] drop_variables = set(drop_variables) # Time bounds coordinates might miss the decoding attributes if decode_times: _update_bounds_attributes(variables) new_vars = {} for k, v in variables.items(): if k in drop_variables: continue stack_char_dim = ( concat_characters and v.dtype == "S1" and v.ndim > 0 and stackable(v.dims[-1]) ) try: > new_vars[k] = decode_cf_variable( k, v, concat_characters=concat_characters, mask_and_scale=mask_and_scale, decode_times=decode_times, stack_char_dim=stack_char_dim, use_cftime=use_cftime, decode_timedelta=decode_timedelta, ) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/conventions.py:551: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ name = 't' var = array([ 0., 1., nan]) Attributes: units: days since 2000-01-01 00:00:00 calendar: proleptic_gregorian concat_characters = True, mask_and_scale = True, decode_times = True decode_endianness = True, stack_char_dim = False, use_cftime = None decode_timedelta = True def decode_cf_variable( name: Hashable, var: Variable, concat_characters: bool = True, mask_and_scale: bool = True, decode_times: bool = True, decode_endianness: bool = True, stack_char_dim: bool = True, use_cftime: bool | None = None, decode_timedelta: bool | None = None, ) -> Variable: """ Decodes a variable which may hold CF encoded information. This includes variables that have been masked and scaled, which hold CF style time variables (this is almost always the case if the dataset has been serialized) and which have strings encoded as character arrays. Parameters ---------- name : str Name of the variable. Used for better error messages. var : Variable A variable holding potentially CF encoded information. concat_characters : bool Should character arrays be concatenated to strings, for example: ["h", "e", "l", "l", "o"] -> "hello" mask_and_scale : bool Lazily scale (using scale_factor and add_offset) and mask (using _FillValue). If the _Unsigned attribute is present treat integer arrays as unsigned. decode_times : bool Decode cf times ("hours since 2000-01-01") to np.datetime64. decode_endianness : bool Decode arrays from non-native to native endianness. stack_char_dim : bool Whether to stack characters into bytes along the last dimension of this array. Passed as an argument because we need to look at the full dataset to figure out if this is appropriate. use_cftime : bool, optional Only relevant if encoded dates come from a standard calendar (e.g. "gregorian", "proleptic_gregorian", "standard", or not specified). If None (default), attempt to decode times to ``np.datetime64[ns]`` objects; if this is not possible, decode times to ``cftime.datetime`` objects. If True, always decode times to ``cftime.datetime`` objects, regardless of whether or not they can be represented using ``np.datetime64[ns]`` objects. If False, always decode times to ``np.datetime64[ns]`` objects; if this is not possible raise an error. Returns ------- out : Variable A variable holding the decoded equivalent of var. """ # Ensure datetime-like Variables are passed through unmodified (GH 6453) if _contains_datetime_like_objects(var): return var original_dtype = var.dtype if decode_timedelta is None: decode_timedelta = decode_times if concat_characters: if stack_char_dim: var = strings.CharacterArrayCoder().decode(var, name=name) var = strings.EncodedStringCoder().decode(var) if mask_and_scale: for coder in [ variables.UnsignedIntegerCoder(), variables.CFMaskCoder(), variables.CFScaleOffsetCoder(), ]: var = coder.decode(var, name=name) if decode_timedelta: var = times.CFTimedeltaCoder().decode(var, name=name) if decode_times: > var = times.CFDatetimeCoder(use_cftime=use_cftime).decode(var, name=name) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/conventions.py:397: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = variable = array([ 0., 1., nan]) Attributes: units: days since 2000-01-01 00:00:00 calendar: proleptic_gregorian name = 't' def decode(self, variable: Variable, name: T_Name = None) -> Variable: units = variable.attrs.get("units", None) if isinstance(units, str) and "since" in units: dims, data, attrs, encoding = unpack_for_decoding(variable) units = pop_to(attrs, encoding, "units") calendar = pop_to(attrs, encoding, "calendar") > dtype = _decode_cf_datetime_dtype(data, units, calendar, self.use_cftime) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:716: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ data = array([ 0., 1., nan]), units = 'days since 2000-01-01 00:00:00' calendar = 'proleptic_gregorian', use_cftime = None def _decode_cf_datetime_dtype( data, units: str, calendar: str, use_cftime: bool | None ) -> np.dtype: # Verify that at least the first and last date can be decoded # successfully. Otherwise, tracebacks end up swallowed by # Dataset.__repr__ when users try to view their lazily decoded array. values = indexing.ImplicitToExplicitIndexingAdapter(indexing.as_indexable(data)) example_value = np.concatenate( [first_n_items(values, 1) or [0], last_item(values) or [0]] ) try: result = decode_cf_datetime(example_value, units, calendar, use_cftime) except Exception: calendar_msg = ( "the default calendar" if calendar is None else f"calendar {calendar!r}" ) msg = ( f"unable to decode time units {units!r} with {calendar_msg!r}. Try " "opening your dataset with decode_times=False or installing cftime " "if it is not installed." ) > raise ValueError(msg) E ValueError: unable to decode time units 'days since 2000-01-01 00:00:00' with "calendar 'proleptic_gregorian'". Try opening your dataset with decode_times=False or installing cftime if it is not installed. /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:194: ValueError During handling of the above exception, another exception occurred: self = @arm_xfail def test_roundtrip_numpy_datetime_data(self) -> None: times = pd.to_datetime(["2000-01-01", "2000-01-02", "NaT"]) expected = Dataset({"t": ("t", times), "t0": times[0]}) kwargs = {"encoding": {"t0": {"units": "days since 1950-01-01"}}} > with self.roundtrip(expected, save_kwargs=kwargs) as actual: /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:535: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.11/contextlib.py:137: in __enter__ return next(self.gen) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_conventions.py:427: in roundtrip yield open_dataset(store, **open_kwargs) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/backends/api.py:541: in open_dataset backend_ds = backend.open_dataset( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/backends/store.py:35: in open_dataset vars, attrs, coord_names = conventions.decode_cf_variables( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ variables = Frozen({'t': array([ 0., 1., nan]) Attributes: units: days since 2000-01-01 00:00:... array(18262) Attributes: units: days since 1950-01-01 calendar: proleptic_gregorian}) attributes = Frozen({}), concat_characters = True, mask_and_scale = True decode_times = True, decode_coords = True, drop_variables = set() use_cftime = None, decode_timedelta = None def decode_cf_variables( variables: T_Variables, attributes: T_Attrs, concat_characters: bool = True, mask_and_scale: bool = True, decode_times: bool = True, decode_coords: bool = True, drop_variables: T_DropVariables = None, use_cftime: bool | None = None, decode_timedelta: bool | None = None, ) -> tuple[T_Variables, T_Attrs, set[Hashable]]: """ Decode several CF encoded variables. See: decode_cf_variable """ dimensions_used_by = defaultdict(list) for v in variables.values(): for d in v.dims: dimensions_used_by[d].append(v) def stackable(dim: Hashable) -> bool: # figure out if a dimension can be concatenated over if dim in variables: return False for v in dimensions_used_by[dim]: if v.dtype.kind != "S" or dim != v.dims[-1]: return False return True coord_names = set() if isinstance(drop_variables, str): drop_variables = [drop_variables] elif drop_variables is None: drop_variables = [] drop_variables = set(drop_variables) # Time bounds coordinates might miss the decoding attributes if decode_times: _update_bounds_attributes(variables) new_vars = {} for k, v in variables.items(): if k in drop_variables: continue stack_char_dim = ( concat_characters and v.dtype == "S1" and v.ndim > 0 and stackable(v.dims[-1]) ) try: new_vars[k] = decode_cf_variable( k, v, concat_characters=concat_characters, mask_and_scale=mask_and_scale, decode_times=decode_times, stack_char_dim=stack_char_dim, use_cftime=use_cftime, decode_timedelta=decode_timedelta, ) except Exception as e: > raise type(e)(f"Failed to decode variable {k!r}: {e}") E ValueError: Failed to decode variable 't': unable to decode time units 'days since 2000-01-01 00:00:00' with "calendar 'proleptic_gregorian'". Try opening your dataset with decode_times=False or installing cftime if it is not installed. /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/conventions.py:562: ValueError _________ TestNetCDF3ViaNetCDF4Data.test_roundtrip_numpy_datetime_data _________ [gw2] linux -- Python 3.11.4 /usr/bin/python3 num_dates = array([ 0., nan]), units = 'days since 2000-01-01 00:00:00' calendar = 'proleptic_gregorian', use_cftime = None def decode_cf_datetime( num_dates, units: str, calendar: str | None = None, use_cftime: bool | None = None ) -> np.ndarray: """Given an array of numeric dates in netCDF format, convert it into a numpy array of date time objects. For standard (Gregorian) calendars, this function uses vectorized operations, which makes it much faster than cftime.num2date. In such a case, the returned array will be of type np.datetime64. Note that time unit in `units` must not be smaller than microseconds and not larger than days. See Also -------- cftime.num2date """ num_dates = np.asarray(num_dates) flat_num_dates = num_dates.ravel() if calendar is None: calendar = "standard" if use_cftime is None: try: > dates = _decode_datetime_with_pandas(flat_num_dates, units, calendar) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:285: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ flat_num_dates = array([ 0., nan]), units = 'days since 2000-01-01 00:00:00' calendar = 'proleptic_gregorian' def _decode_datetime_with_pandas( flat_num_dates: np.ndarray, units: str, calendar: str ) -> np.ndarray: if not _is_standard_calendar(calendar): raise OutOfBoundsDatetime( "Cannot decode times from a non-standard calendar, {!r}, using " "pandas.".format(calendar) ) delta, ref_date = _unpack_netcdf_time_units(units) delta = _netcdf_to_numpy_timeunit(delta) try: ref_date = pd.Timestamp(ref_date) except ValueError: # ValueError is raised by pd.Timestamp for non-ISO timestamp # strings, in which case we fall back to using cftime raise OutOfBoundsDatetime with warnings.catch_warnings(): warnings.filterwarnings("ignore", "invalid value encountered", RuntimeWarning) if flat_num_dates.size > 0: # avoid size 0 datetimes GH1329 pd.to_timedelta(flat_num_dates.min(), delta) + ref_date pd.to_timedelta(flat_num_dates.max(), delta) + ref_date # To avoid integer overflow when converting to nanosecond units for integer # dtypes smaller than np.int64 cast all integer and unsigned integer dtype # arrays to np.int64 (GH 2002, GH 6589). Note this is safe even in the case # of np.uint64 values, because any np.uint64 value that would lead to # overflow when converting to np.int64 would not be representable with a # timedelta64 value, and therefore would raise an error in the lines above. if flat_num_dates.dtype.kind in "iu": flat_num_dates = flat_num_dates.astype(np.int64) # Cast input ordinals to integers of nanoseconds because pd.to_timedelta # works much faster when dealing with integers (GH 1399). flat_num_dates_ns_int = (flat_num_dates * _NS_PER_TIME_DELTA[delta]).astype( np.int64 ) # Use pd.to_timedelta to safely cast integer values to timedeltas, # and add those to a Timestamp to safely produce a DatetimeIndex. This # ensures that we do not encounter integer overflow at any point in the # process without raising OutOfBoundsDatetime. > return (pd.to_timedelta(flat_num_dates_ns_int, "ns") + ref_date).values /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:258: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['0 days 00:00:00', '106751 days 23:47:16.854775807'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00') @wraps(method) def new_method(self, other): if is_cmp and isinstance(self, ABCIndex) and isinstance(other, ABCSeries): # For comparison ops, Index does *not* defer to Series pass else: for cls in [ABCDataFrame, ABCSeries, ABCIndex]: if isinstance(self, cls): break if isinstance(other, cls): return NotImplemented other = item_from_zerodim(other) > return method(self, other) /usr/lib64/python3.11/site-packages/pandas/core/ops/common.py:72: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['0 days 00:00:00', '106751 days 23:47:16.854775807'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00') @unpack_zerodim_and_defer("__add__") def __add__(self, other): > return self._arith_method(other, operator.add) /usr/lib64/python3.11/site-packages/pandas/core/arraylike.py:102: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['0 days 00:00:00', '106751 days 23:47:16.854775807'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00'), op = def _arith_method(self, other, op): if ( isinstance(other, Index) and is_object_dtype(other.dtype) and type(other) is not Index ): # We return NotImplemented for object-dtype index *subclasses* so they have # a chance to implement ops before we unwrap them. # See https://github.com/pandas-dev/pandas/issues/31109 return NotImplemented > return super()._arith_method(other, op) /usr/lib64/python3.11/site-packages/pandas/core/indexes/base.py:7007: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['0 days 00:00:00', '106751 days 23:47:16.854775807'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00'), op = def _arith_method(self, other, op): res_name = ops.get_op_result_name(self, other) lvalues = self._values rvalues = extract_array(other, extract_numpy=True, extract_range=True) rvalues = ops.maybe_prepare_scalar_for_op(rvalues, lvalues.shape) rvalues = ensure_wrapped_if_datetimelike(rvalues) with np.errstate(all="ignore"): > result = ops.arithmetic_op(lvalues, rvalues, op) /usr/lib64/python3.11/site-packages/pandas/core/base.py:1325: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ left = ['0 days 00:00:00', '106751 days 23:47:16.854775807'] Length: 2, dtype: timedelta64[ns] right = Timestamp('2000-01-01 00:00:00'), op = def arithmetic_op(left: ArrayLike, right: Any, op): """ Evaluate an arithmetic operation `+`, `-`, `*`, `/`, `//`, `%`, `**`, ... Note: the caller is responsible for ensuring that numpy warnings are suppressed (with np.errstate(all="ignore")) if needed. Parameters ---------- left : np.ndarray or ExtensionArray right : object Cannot be a DataFrame or Index. Series is *not* excluded. op : {operator.add, operator.sub, ...} Or one of the reversed variants from roperator. Returns ------- ndarray or ExtensionArray Or a 2-tuple of these in the case of divmod or rdivmod. """ # NB: We assume that extract_array and ensure_wrapped_if_datetimelike # have already been called on `left` and `right`, # and `maybe_prepare_scalar_for_op` has already been called on `right` # We need to special-case datetime64/timedelta64 dtypes (e.g. because numpy # casts integer dtypes to timedelta64 when operating with timedelta64 - GH#22390) if ( should_extension_dispatch(left, right) or isinstance(right, (Timedelta, BaseOffset, Timestamp)) or right is NaT ): # Timedelta/Timestamp and other custom scalars are included in the check # because numexpr will fail on it, see GH#31457 > res_values = op(left, right) /usr/lib64/python3.11/site-packages/pandas/core/ops/array_ops.py:218: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = ['0 days 00:00:00', '106751 days 23:47:16.854775807'] Length: 2, dtype: timedelta64[ns] other = Timestamp('2000-01-01 00:00:00') @wraps(method) def new_method(self, other): if is_cmp and isinstance(self, ABCIndex) and isinstance(other, ABCSeries): # For comparison ops, Index does *not* defer to Series pass else: for cls in [ABCDataFrame, ABCSeries, ABCIndex]: if isinstance(self, cls): break if isinstance(other, cls): return NotImplemented other = item_from_zerodim(other) > return method(self, other) /usr/lib64/python3.11/site-packages/pandas/core/ops/common.py:72: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = ['0 days 00:00:00', '106751 days 23:47:16.854775807'] Length: 2, dtype: timedelta64[ns] other = Timestamp('2000-01-01 00:00:00') @unpack_zerodim_and_defer("__add__") def __add__(self, other): other_dtype = getattr(other, "dtype", None) # scalar others if other is NaT: result = self._add_nat() elif isinstance(other, (Tick, timedelta, np.timedelta64)): result = self._add_timedeltalike_scalar(other) elif isinstance(other, BaseOffset): # specifically _not_ a Tick result = self._add_offset(other) elif isinstance(other, (datetime, np.datetime64)): > result = self._add_datetimelike_scalar(other) /usr/lib64/python3.11/site-packages/pandas/core/arrays/datetimelike.py:1441: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = ['0 days 00:00:00', '106751 days 23:47:16.854775807'] Length: 2, dtype: timedelta64[ns] other = Timestamp('2000-01-01 00:00:00') @final def _add_datetimelike_scalar(self, other) -> DatetimeArray: if not is_timedelta64_dtype(self.dtype): raise TypeError( f"cannot add {type(self).__name__} and {type(other).__name__}" ) self = cast("TimedeltaArray", self) from pandas.core.arrays import DatetimeArray from pandas.core.arrays.datetimes import tz_to_dtype assert other is not NaT other = Timestamp(other) if other is NaT: # In this case we specifically interpret NaT as a datetime, not # the timedelta interpretation we would get by returning self + NaT result = self._ndarray + NaT.to_datetime64().astype(f"M8[{self._unit}]") # Preserve our resolution return DatetimeArray._simple_new(result, dtype=result.dtype) if self._reso != other._reso: raise NotImplementedError( "Addition between TimedeltaArray and Timestamp with mis-matched " "resolutions is not yet supported." ) i8 = self.asi8 > result = checked_add_with_arr(i8, other.value, arr_mask=self._isnan) /usr/lib64/python3.11/site-packages/pandas/core/arrays/datetimelike.py:1142: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ arr = array([ 0, 9223372036854775807]), b = 946684800000000000 arr_mask = array([False, False]), b_mask = None def checked_add_with_arr( arr: npt.NDArray[np.int64], b: int | npt.NDArray[np.int64], arr_mask: npt.NDArray[np.bool_] | None = None, b_mask: npt.NDArray[np.bool_] | None = None, ) -> npt.NDArray[np.int64]: """ Perform array addition that checks for underflow and overflow. Performs the addition of an int64 array and an int64 integer (or array) but checks that they do not result in overflow first. For elements that are indicated to be NaN, whether or not there is overflow for that element is automatically ignored. Parameters ---------- arr : np.ndarray[int64] addend. b : array or scalar addend. arr_mask : np.ndarray[bool] or None, default None array indicating which elements to exclude from checking b_mask : np.ndarray[bool] or None, default None array or scalar indicating which element(s) to exclude from checking Returns ------- sum : An array for elements x + b for each element x in arr if b is a scalar or an array for elements x + y for each element pair (x, y) in (arr, b). Raises ------ OverflowError if any x + y exceeds the maximum or minimum int64 value. """ # For performance reasons, we broadcast 'b' to the new array 'b2' # so that it has the same size as 'arr'. b2 = np.broadcast_to(b, arr.shape) if b_mask is not None: # We do the same broadcasting for b_mask as well. b2_mask = np.broadcast_to(b_mask, arr.shape) else: b2_mask = None # For elements that are NaN, regardless of their value, we should # ignore whether they overflow or not when doing the checked add. if arr_mask is not None and b2_mask is not None: not_nan = np.logical_not(arr_mask | b2_mask) elif arr_mask is not None: not_nan = np.logical_not(arr_mask) elif b_mask is not None: # error: Argument 1 to "__call__" of "_UFunc_Nin1_Nout1" has # incompatible type "Optional[ndarray[Any, dtype[bool_]]]"; # expected "Union[_SupportsArray[dtype[Any]], _NestedSequence # [_SupportsArray[dtype[Any]]], bool, int, float, complex, str # , bytes, _NestedSequence[Union[bool, int, float, complex, str # , bytes]]]" not_nan = np.logical_not(b2_mask) # type: ignore[arg-type] else: not_nan = np.empty(arr.shape, dtype=bool) not_nan.fill(True) # gh-14324: For each element in 'arr' and its corresponding element # in 'b2', we check the sign of the element in 'b2'. If it is positive, # we then check whether its sum with the element in 'arr' exceeds # np.iinfo(np.int64).max. If so, we have an overflow error. If it # it is negative, we then check whether its sum with the element in # 'arr' exceeds np.iinfo(np.int64).min. If so, we have an overflow # error as well. i8max = lib.i8max i8min = iNaT mask1 = b2 > 0 mask2 = b2 < 0 if not mask1.any(): to_raise = ((i8min - b2 > arr) & not_nan).any() elif not mask2.any(): to_raise = ((i8max - b2 < arr) & not_nan).any() else: to_raise = ((i8max - b2[mask1] < arr[mask1]) & not_nan[mask1]).any() or ( (i8min - b2[mask2] > arr[mask2]) & not_nan[mask2] ).any() if to_raise: > raise OverflowError("Overflow in int64 addition") E OverflowError: Overflow in int64 addition /usr/lib64/python3.11/site-packages/pandas/core/algorithms.py:1249: OverflowError During handling of the above exception, another exception occurred: times = array([cftime.DatetimeProlepticGregorian(2000, 1, 1, 0, 0, 0, 0, has_year_zero=True), cftime.DatetimeProlepticGregorian(294277, 1, 9, 4, 0, 54, 775807, has_year_zero=True)], dtype=object) raise_on_invalid = True def cftime_to_nptime(times, raise_on_invalid: bool = True) -> np.ndarray: """Given an array of cftime.datetime objects, return an array of numpy.datetime64 objects of the same size If raise_on_invalid is True (default), invalid dates trigger a ValueError. Otherwise, the invalid element is replaced by np.NaT.""" times = np.asarray(times) new = np.empty(times.shape, dtype="M8[ns]") for i, t in np.ndenumerate(times): try: # Use pandas.Timestamp in place of datetime.datetime, because # NumPy casts it safely it np.datetime64[ns] for dates outside # 1678 to 2262 (this is not currently the case for # datetime.datetime). > dt = pd.Timestamp( t.year, t.month, t.day, t.hour, t.minute, t.second, t.microsecond ) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:448: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > ??? E ValueError: year 294277 is out of range pandas/_libs/tslibs/timestamps.pyx:1673: ValueError During handling of the above exception, another exception occurred: data = LazilyIndexedArray(array=, key=BasicIndexer((slice(None, None, None),))) units = 'days since 2000-01-01 00:00:00', calendar = 'proleptic_gregorian' use_cftime = None def _decode_cf_datetime_dtype( data, units: str, calendar: str, use_cftime: bool | None ) -> np.dtype: # Verify that at least the first and last date can be decoded # successfully. Otherwise, tracebacks end up swallowed by # Dataset.__repr__ when users try to view their lazily decoded array. values = indexing.ImplicitToExplicitIndexingAdapter(indexing.as_indexable(data)) example_value = np.concatenate( [first_n_items(values, 1) or [0], last_item(values) or [0]] ) try: > result = decode_cf_datetime(example_value, units, calendar, use_cftime) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:184: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ num_dates = array([ 0., nan]), units = 'days since 2000-01-01 00:00:00' calendar = 'proleptic_gregorian', use_cftime = None def decode_cf_datetime( num_dates, units: str, calendar: str | None = None, use_cftime: bool | None = None ) -> np.ndarray: """Given an array of numeric dates in netCDF format, convert it into a numpy array of date time objects. For standard (Gregorian) calendars, this function uses vectorized operations, which makes it much faster than cftime.num2date. In such a case, the returned array will be of type np.datetime64. Note that time unit in `units` must not be smaller than microseconds and not larger than days. See Also -------- cftime.num2date """ num_dates = np.asarray(num_dates) flat_num_dates = num_dates.ravel() if calendar is None: calendar = "standard" if use_cftime is None: try: dates = _decode_datetime_with_pandas(flat_num_dates, units, calendar) except (KeyError, OutOfBoundsDatetime, OutOfBoundsTimedelta, OverflowError): dates = _decode_datetime_with_cftime( flat_num_dates.astype(float), units, calendar ) if ( dates[np.nanargmin(num_dates)].year < 1678 or dates[np.nanargmax(num_dates)].year >= 2262 ): if _is_standard_calendar(calendar): warnings.warn( "Unable to decode time axis into full " "numpy.datetime64 objects, continuing using " "cftime.datetime objects instead, reason: dates out " "of range", SerializationWarning, stacklevel=3, ) else: if _is_standard_calendar(calendar): > dates = cftime_to_nptime(dates) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:306: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ times = array([cftime.DatetimeProlepticGregorian(2000, 1, 1, 0, 0, 0, 0, has_year_zero=True), cftime.DatetimeProlepticGregorian(294277, 1, 9, 4, 0, 54, 775807, has_year_zero=True)], dtype=object) raise_on_invalid = True def cftime_to_nptime(times, raise_on_invalid: bool = True) -> np.ndarray: """Given an array of cftime.datetime objects, return an array of numpy.datetime64 objects of the same size If raise_on_invalid is True (default), invalid dates trigger a ValueError. Otherwise, the invalid element is replaced by np.NaT.""" times = np.asarray(times) new = np.empty(times.shape, dtype="M8[ns]") for i, t in np.ndenumerate(times): try: # Use pandas.Timestamp in place of datetime.datetime, because # NumPy casts it safely it np.datetime64[ns] for dates outside # 1678 to 2262 (this is not currently the case for # datetime.datetime). dt = pd.Timestamp( t.year, t.month, t.day, t.hour, t.minute, t.second, t.microsecond ) except ValueError as e: if raise_on_invalid: > raise ValueError( "Cannot convert date {} to a date in the " "standard calendar. Reason: {}.".format(t, e) ) E ValueError: Cannot convert date 294277-01-09 04:00:54 to a date in the standard calendar. Reason: year 294277 is out of range. /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:453: ValueError During handling of the above exception, another exception occurred: variables = Frozen({'t': [3 values with dtype=float64] Attributes: _FillValue: nan units: ...e ()> [1 values with dtype=int32] Attributes: units: days since 1950-01-01 calendar: proleptic_gregorian}) attributes = Frozen({}), concat_characters = True, mask_and_scale = True decode_times = True, decode_coords = True, drop_variables = set() use_cftime = None, decode_timedelta = None def decode_cf_variables( variables: T_Variables, attributes: T_Attrs, concat_characters: bool = True, mask_and_scale: bool = True, decode_times: bool = True, decode_coords: bool = True, drop_variables: T_DropVariables = None, use_cftime: bool | None = None, decode_timedelta: bool | None = None, ) -> tuple[T_Variables, T_Attrs, set[Hashable]]: """ Decode several CF encoded variables. See: decode_cf_variable """ dimensions_used_by = defaultdict(list) for v in variables.values(): for d in v.dims: dimensions_used_by[d].append(v) def stackable(dim: Hashable) -> bool: # figure out if a dimension can be concatenated over if dim in variables: return False for v in dimensions_used_by[dim]: if v.dtype.kind != "S" or dim != v.dims[-1]: return False return True coord_names = set() if isinstance(drop_variables, str): drop_variables = [drop_variables] elif drop_variables is None: drop_variables = [] drop_variables = set(drop_variables) # Time bounds coordinates might miss the decoding attributes if decode_times: _update_bounds_attributes(variables) new_vars = {} for k, v in variables.items(): if k in drop_variables: continue stack_char_dim = ( concat_characters and v.dtype == "S1" and v.ndim > 0 and stackable(v.dims[-1]) ) try: > new_vars[k] = decode_cf_variable( k, v, concat_characters=concat_characters, mask_and_scale=mask_and_scale, decode_times=decode_times, stack_char_dim=stack_char_dim, use_cftime=use_cftime, decode_timedelta=decode_timedelta, ) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/conventions.py:551: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ name = 't' var = [3 values with dtype=float64] Attributes: units: days since 2000-01-01 00:00:00 calendar: proleptic_gregorian concat_characters = True, mask_and_scale = True, decode_times = True decode_endianness = True, stack_char_dim = False, use_cftime = None decode_timedelta = True def decode_cf_variable( name: Hashable, var: Variable, concat_characters: bool = True, mask_and_scale: bool = True, decode_times: bool = True, decode_endianness: bool = True, stack_char_dim: bool = True, use_cftime: bool | None = None, decode_timedelta: bool | None = None, ) -> Variable: """ Decodes a variable which may hold CF encoded information. This includes variables that have been masked and scaled, which hold CF style time variables (this is almost always the case if the dataset has been serialized) and which have strings encoded as character arrays. Parameters ---------- name : str Name of the variable. Used for better error messages. var : Variable A variable holding potentially CF encoded information. concat_characters : bool Should character arrays be concatenated to strings, for example: ["h", "e", "l", "l", "o"] -> "hello" mask_and_scale : bool Lazily scale (using scale_factor and add_offset) and mask (using _FillValue). If the _Unsigned attribute is present treat integer arrays as unsigned. decode_times : bool Decode cf times ("hours since 2000-01-01") to np.datetime64. decode_endianness : bool Decode arrays from non-native to native endianness. stack_char_dim : bool Whether to stack characters into bytes along the last dimension of this array. Passed as an argument because we need to look at the full dataset to figure out if this is appropriate. use_cftime : bool, optional Only relevant if encoded dates come from a standard calendar (e.g. "gregorian", "proleptic_gregorian", "standard", or not specified). If None (default), attempt to decode times to ``np.datetime64[ns]`` objects; if this is not possible, decode times to ``cftime.datetime`` objects. If True, always decode times to ``cftime.datetime`` objects, regardless of whether or not they can be represented using ``np.datetime64[ns]`` objects. If False, always decode times to ``np.datetime64[ns]`` objects; if this is not possible raise an error. Returns ------- out : Variable A variable holding the decoded equivalent of var. """ # Ensure datetime-like Variables are passed through unmodified (GH 6453) if _contains_datetime_like_objects(var): return var original_dtype = var.dtype if decode_timedelta is None: decode_timedelta = decode_times if concat_characters: if stack_char_dim: var = strings.CharacterArrayCoder().decode(var, name=name) var = strings.EncodedStringCoder().decode(var) if mask_and_scale: for coder in [ variables.UnsignedIntegerCoder(), variables.CFMaskCoder(), variables.CFScaleOffsetCoder(), ]: var = coder.decode(var, name=name) if decode_timedelta: var = times.CFTimedeltaCoder().decode(var, name=name) if decode_times: > var = times.CFDatetimeCoder(use_cftime=use_cftime).decode(var, name=name) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/conventions.py:397: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = variable = [3 values with dtype=float64] Attributes: units: days since 2000-01-01 00:00:00 calendar: proleptic_gregorian name = 't' def decode(self, variable: Variable, name: T_Name = None) -> Variable: units = variable.attrs.get("units", None) if isinstance(units, str) and "since" in units: dims, data, attrs, encoding = unpack_for_decoding(variable) units = pop_to(attrs, encoding, "units") calendar = pop_to(attrs, encoding, "calendar") > dtype = _decode_cf_datetime_dtype(data, units, calendar, self.use_cftime) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:716: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ data = LazilyIndexedArray(array=, key=BasicIndexer((slice(None, None, None),))) units = 'days since 2000-01-01 00:00:00', calendar = 'proleptic_gregorian' use_cftime = None def _decode_cf_datetime_dtype( data, units: str, calendar: str, use_cftime: bool | None ) -> np.dtype: # Verify that at least the first and last date can be decoded # successfully. Otherwise, tracebacks end up swallowed by # Dataset.__repr__ when users try to view their lazily decoded array. values = indexing.ImplicitToExplicitIndexingAdapter(indexing.as_indexable(data)) example_value = np.concatenate( [first_n_items(values, 1) or [0], last_item(values) or [0]] ) try: result = decode_cf_datetime(example_value, units, calendar, use_cftime) except Exception: calendar_msg = ( "the default calendar" if calendar is None else f"calendar {calendar!r}" ) msg = ( f"unable to decode time units {units!r} with {calendar_msg!r}. Try " "opening your dataset with decode_times=False or installing cftime " "if it is not installed." ) > raise ValueError(msg) E ValueError: unable to decode time units 'days since 2000-01-01 00:00:00' with "calendar 'proleptic_gregorian'". Try opening your dataset with decode_times=False or installing cftime if it is not installed. /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:194: ValueError During handling of the above exception, another exception occurred: self = @arm_xfail def test_roundtrip_numpy_datetime_data(self) -> None: times = pd.to_datetime(["2000-01-01", "2000-01-02", "NaT"]) expected = Dataset({"t": ("t", times), "t0": times[0]}) kwargs = {"encoding": {"t0": {"units": "days since 1950-01-01"}}} > with self.roundtrip(expected, save_kwargs=kwargs) as actual: /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:535: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.11/contextlib.py:137: in __enter__ return next(self.gen) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:311: in roundtrip with self.open(path, **open_kwargs) as ds: /usr/lib64/python3.11/contextlib.py:137: in __enter__ return next(self.gen) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:337: in open with open_dataset(path, engine=self.engine, **kwargs) as ds: /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/backends/api.py:541: in open_dataset backend_ds = backend.open_dataset( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/backends/netCDF4_.py:592: in open_dataset ds = store_entrypoint.open_dataset( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/backends/store.py:35: in open_dataset vars, attrs, coord_names = conventions.decode_cf_variables( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ variables = Frozen({'t': [3 values with dtype=float64] Attributes: _FillValue: nan units: ...e ()> [1 values with dtype=int32] Attributes: units: days since 1950-01-01 calendar: proleptic_gregorian}) attributes = Frozen({}), concat_characters = True, mask_and_scale = True decode_times = True, decode_coords = True, drop_variables = set() use_cftime = None, decode_timedelta = None def decode_cf_variables( variables: T_Variables, attributes: T_Attrs, concat_characters: bool = True, mask_and_scale: bool = True, decode_times: bool = True, decode_coords: bool = True, drop_variables: T_DropVariables = None, use_cftime: bool | None = None, decode_timedelta: bool | None = None, ) -> tuple[T_Variables, T_Attrs, set[Hashable]]: """ Decode several CF encoded variables. See: decode_cf_variable """ dimensions_used_by = defaultdict(list) for v in variables.values(): for d in v.dims: dimensions_used_by[d].append(v) def stackable(dim: Hashable) -> bool: # figure out if a dimension can be concatenated over if dim in variables: return False for v in dimensions_used_by[dim]: if v.dtype.kind != "S" or dim != v.dims[-1]: return False return True coord_names = set() if isinstance(drop_variables, str): drop_variables = [drop_variables] elif drop_variables is None: drop_variables = [] drop_variables = set(drop_variables) # Time bounds coordinates might miss the decoding attributes if decode_times: _update_bounds_attributes(variables) new_vars = {} for k, v in variables.items(): if k in drop_variables: continue stack_char_dim = ( concat_characters and v.dtype == "S1" and v.ndim > 0 and stackable(v.dims[-1]) ) try: new_vars[k] = decode_cf_variable( k, v, concat_characters=concat_characters, mask_and_scale=mask_and_scale, decode_times=decode_times, stack_char_dim=stack_char_dim, use_cftime=use_cftime, decode_timedelta=decode_timedelta, ) except Exception as e: > raise type(e)(f"Failed to decode variable {k!r}: {e}") E ValueError: Failed to decode variable 't': unable to decode time units 'days since 2000-01-01 00:00:00' with "calendar 'proleptic_gregorian'". Try opening your dataset with decode_times=False or installing cftime if it is not installed. /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/conventions.py:562: ValueError _____________ TestZarrDictStore.test_roundtrip_numpy_datetime_data _____________ [gw1] linux -- Python 3.11.4 /usr/bin/python3 num_dates = array([ 0., nan]), units = 'days since 2000-01-01 00:00:00' calendar = 'proleptic_gregorian', use_cftime = None def decode_cf_datetime( num_dates, units: str, calendar: str | None = None, use_cftime: bool | None = None ) -> np.ndarray: """Given an array of numeric dates in netCDF format, convert it into a numpy array of date time objects. For standard (Gregorian) calendars, this function uses vectorized operations, which makes it much faster than cftime.num2date. In such a case, the returned array will be of type np.datetime64. Note that time unit in `units` must not be smaller than microseconds and not larger than days. See Also -------- cftime.num2date """ num_dates = np.asarray(num_dates) flat_num_dates = num_dates.ravel() if calendar is None: calendar = "standard" if use_cftime is None: try: > dates = _decode_datetime_with_pandas(flat_num_dates, units, calendar) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:285: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ flat_num_dates = array([ 0., nan]), units = 'days since 2000-01-01 00:00:00' calendar = 'proleptic_gregorian' def _decode_datetime_with_pandas( flat_num_dates: np.ndarray, units: str, calendar: str ) -> np.ndarray: if not _is_standard_calendar(calendar): raise OutOfBoundsDatetime( "Cannot decode times from a non-standard calendar, {!r}, using " "pandas.".format(calendar) ) delta, ref_date = _unpack_netcdf_time_units(units) delta = _netcdf_to_numpy_timeunit(delta) try: ref_date = pd.Timestamp(ref_date) except ValueError: # ValueError is raised by pd.Timestamp for non-ISO timestamp # strings, in which case we fall back to using cftime raise OutOfBoundsDatetime with warnings.catch_warnings(): warnings.filterwarnings("ignore", "invalid value encountered", RuntimeWarning) if flat_num_dates.size > 0: # avoid size 0 datetimes GH1329 pd.to_timedelta(flat_num_dates.min(), delta) + ref_date pd.to_timedelta(flat_num_dates.max(), delta) + ref_date # To avoid integer overflow when converting to nanosecond units for integer # dtypes smaller than np.int64 cast all integer and unsigned integer dtype # arrays to np.int64 (GH 2002, GH 6589). Note this is safe even in the case # of np.uint64 values, because any np.uint64 value that would lead to # overflow when converting to np.int64 would not be representable with a # timedelta64 value, and therefore would raise an error in the lines above. if flat_num_dates.dtype.kind in "iu": flat_num_dates = flat_num_dates.astype(np.int64) # Cast input ordinals to integers of nanoseconds because pd.to_timedelta # works much faster when dealing with integers (GH 1399). flat_num_dates_ns_int = (flat_num_dates * _NS_PER_TIME_DELTA[delta]).astype( np.int64 ) # Use pd.to_timedelta to safely cast integer values to timedeltas, # and add those to a Timestamp to safely produce a DatetimeIndex. This # ensures that we do not encounter integer overflow at any point in the # process without raising OutOfBoundsDatetime. > return (pd.to_timedelta(flat_num_dates_ns_int, "ns") + ref_date).values /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:258: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['0 days 00:00:00', '106751 days 23:47:16.854775807'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00') @wraps(method) def new_method(self, other): if is_cmp and isinstance(self, ABCIndex) and isinstance(other, ABCSeries): # For comparison ops, Index does *not* defer to Series pass else: for cls in [ABCDataFrame, ABCSeries, ABCIndex]: if isinstance(self, cls): break if isinstance(other, cls): return NotImplemented other = item_from_zerodim(other) > return method(self, other) /usr/lib64/python3.11/site-packages/pandas/core/ops/common.py:72: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['0 days 00:00:00', '106751 days 23:47:16.854775807'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00') @unpack_zerodim_and_defer("__add__") def __add__(self, other): > return self._arith_method(other, operator.add) /usr/lib64/python3.11/site-packages/pandas/core/arraylike.py:102: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['0 days 00:00:00', '106751 days 23:47:16.854775807'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00'), op = def _arith_method(self, other, op): if ( isinstance(other, Index) and is_object_dtype(other.dtype) and type(other) is not Index ): # We return NotImplemented for object-dtype index *subclasses* so they have # a chance to implement ops before we unwrap them. # See https://github.com/pandas-dev/pandas/issues/31109 return NotImplemented > return super()._arith_method(other, op) /usr/lib64/python3.11/site-packages/pandas/core/indexes/base.py:7007: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['0 days 00:00:00', '106751 days 23:47:16.854775807'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00'), op = def _arith_method(self, other, op): res_name = ops.get_op_result_name(self, other) lvalues = self._values rvalues = extract_array(other, extract_numpy=True, extract_range=True) rvalues = ops.maybe_prepare_scalar_for_op(rvalues, lvalues.shape) rvalues = ensure_wrapped_if_datetimelike(rvalues) with np.errstate(all="ignore"): > result = ops.arithmetic_op(lvalues, rvalues, op) /usr/lib64/python3.11/site-packages/pandas/core/base.py:1325: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ left = ['0 days 00:00:00', '106751 days 23:47:16.854775807'] Length: 2, dtype: timedelta64[ns] right = Timestamp('2000-01-01 00:00:00'), op = def arithmetic_op(left: ArrayLike, right: Any, op): """ Evaluate an arithmetic operation `+`, `-`, `*`, `/`, `//`, `%`, `**`, ... Note: the caller is responsible for ensuring that numpy warnings are suppressed (with np.errstate(all="ignore")) if needed. Parameters ---------- left : np.ndarray or ExtensionArray right : object Cannot be a DataFrame or Index. Series is *not* excluded. op : {operator.add, operator.sub, ...} Or one of the reversed variants from roperator. Returns ------- ndarray or ExtensionArray Or a 2-tuple of these in the case of divmod or rdivmod. """ # NB: We assume that extract_array and ensure_wrapped_if_datetimelike # have already been called on `left` and `right`, # and `maybe_prepare_scalar_for_op` has already been called on `right` # We need to special-case datetime64/timedelta64 dtypes (e.g. because numpy # casts integer dtypes to timedelta64 when operating with timedelta64 - GH#22390) if ( should_extension_dispatch(left, right) or isinstance(right, (Timedelta, BaseOffset, Timestamp)) or right is NaT ): # Timedelta/Timestamp and other custom scalars are included in the check # because numexpr will fail on it, see GH#31457 > res_values = op(left, right) /usr/lib64/python3.11/site-packages/pandas/core/ops/array_ops.py:218: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = ['0 days 00:00:00', '106751 days 23:47:16.854775807'] Length: 2, dtype: timedelta64[ns] other = Timestamp('2000-01-01 00:00:00') @wraps(method) def new_method(self, other): if is_cmp and isinstance(self, ABCIndex) and isinstance(other, ABCSeries): # For comparison ops, Index does *not* defer to Series pass else: for cls in [ABCDataFrame, ABCSeries, ABCIndex]: if isinstance(self, cls): break if isinstance(other, cls): return NotImplemented other = item_from_zerodim(other) > return method(self, other) /usr/lib64/python3.11/site-packages/pandas/core/ops/common.py:72: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = ['0 days 00:00:00', '106751 days 23:47:16.854775807'] Length: 2, dtype: timedelta64[ns] other = Timestamp('2000-01-01 00:00:00') @unpack_zerodim_and_defer("__add__") def __add__(self, other): other_dtype = getattr(other, "dtype", None) # scalar others if other is NaT: result = self._add_nat() elif isinstance(other, (Tick, timedelta, np.timedelta64)): result = self._add_timedeltalike_scalar(other) elif isinstance(other, BaseOffset): # specifically _not_ a Tick result = self._add_offset(other) elif isinstance(other, (datetime, np.datetime64)): > result = self._add_datetimelike_scalar(other) /usr/lib64/python3.11/site-packages/pandas/core/arrays/datetimelike.py:1441: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = ['0 days 00:00:00', '106751 days 23:47:16.854775807'] Length: 2, dtype: timedelta64[ns] other = Timestamp('2000-01-01 00:00:00') @final def _add_datetimelike_scalar(self, other) -> DatetimeArray: if not is_timedelta64_dtype(self.dtype): raise TypeError( f"cannot add {type(self).__name__} and {type(other).__name__}" ) self = cast("TimedeltaArray", self) from pandas.core.arrays import DatetimeArray from pandas.core.arrays.datetimes import tz_to_dtype assert other is not NaT other = Timestamp(other) if other is NaT: # In this case we specifically interpret NaT as a datetime, not # the timedelta interpretation we would get by returning self + NaT result = self._ndarray + NaT.to_datetime64().astype(f"M8[{self._unit}]") # Preserve our resolution return DatetimeArray._simple_new(result, dtype=result.dtype) if self._reso != other._reso: raise NotImplementedError( "Addition between TimedeltaArray and Timestamp with mis-matched " "resolutions is not yet supported." ) i8 = self.asi8 > result = checked_add_with_arr(i8, other.value, arr_mask=self._isnan) /usr/lib64/python3.11/site-packages/pandas/core/arrays/datetimelike.py:1142: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ arr = array([ 0, 9223372036854775807]), b = 946684800000000000 arr_mask = array([False, False]), b_mask = None def checked_add_with_arr( arr: npt.NDArray[np.int64], b: int | npt.NDArray[np.int64], arr_mask: npt.NDArray[np.bool_] | None = None, b_mask: npt.NDArray[np.bool_] | None = None, ) -> npt.NDArray[np.int64]: """ Perform array addition that checks for underflow and overflow. Performs the addition of an int64 array and an int64 integer (or array) but checks that they do not result in overflow first. For elements that are indicated to be NaN, whether or not there is overflow for that element is automatically ignored. Parameters ---------- arr : np.ndarray[int64] addend. b : array or scalar addend. arr_mask : np.ndarray[bool] or None, default None array indicating which elements to exclude from checking b_mask : np.ndarray[bool] or None, default None array or scalar indicating which element(s) to exclude from checking Returns ------- sum : An array for elements x + b for each element x in arr if b is a scalar or an array for elements x + y for each element pair (x, y) in (arr, b). Raises ------ OverflowError if any x + y exceeds the maximum or minimum int64 value. """ # For performance reasons, we broadcast 'b' to the new array 'b2' # so that it has the same size as 'arr'. b2 = np.broadcast_to(b, arr.shape) if b_mask is not None: # We do the same broadcasting for b_mask as well. b2_mask = np.broadcast_to(b_mask, arr.shape) else: b2_mask = None # For elements that are NaN, regardless of their value, we should # ignore whether they overflow or not when doing the checked add. if arr_mask is not None and b2_mask is not None: not_nan = np.logical_not(arr_mask | b2_mask) elif arr_mask is not None: not_nan = np.logical_not(arr_mask) elif b_mask is not None: # error: Argument 1 to "__call__" of "_UFunc_Nin1_Nout1" has # incompatible type "Optional[ndarray[Any, dtype[bool_]]]"; # expected "Union[_SupportsArray[dtype[Any]], _NestedSequence # [_SupportsArray[dtype[Any]]], bool, int, float, complex, str # , bytes, _NestedSequence[Union[bool, int, float, complex, str # , bytes]]]" not_nan = np.logical_not(b2_mask) # type: ignore[arg-type] else: not_nan = np.empty(arr.shape, dtype=bool) not_nan.fill(True) # gh-14324: For each element in 'arr' and its corresponding element # in 'b2', we check the sign of the element in 'b2'. If it is positive, # we then check whether its sum with the element in 'arr' exceeds # np.iinfo(np.int64).max. If so, we have an overflow error. If it # it is negative, we then check whether its sum with the element in # 'arr' exceeds np.iinfo(np.int64).min. If so, we have an overflow # error as well. i8max = lib.i8max i8min = iNaT mask1 = b2 > 0 mask2 = b2 < 0 if not mask1.any(): to_raise = ((i8min - b2 > arr) & not_nan).any() elif not mask2.any(): to_raise = ((i8max - b2 < arr) & not_nan).any() else: to_raise = ((i8max - b2[mask1] < arr[mask1]) & not_nan[mask1]).any() or ( (i8min - b2[mask2] > arr[mask2]) & not_nan[mask2] ).any() if to_raise: > raise OverflowError("Overflow in int64 addition") E OverflowError: Overflow in int64 addition /usr/lib64/python3.11/site-packages/pandas/core/algorithms.py:1249: OverflowError During handling of the above exception, another exception occurred: times = array([cftime.DatetimeProlepticGregorian(2000, 1, 1, 0, 0, 0, 0, has_year_zero=True), cftime.DatetimeProlepticGregorian(294277, 1, 9, 4, 0, 54, 775807, has_year_zero=True)], dtype=object) raise_on_invalid = True def cftime_to_nptime(times, raise_on_invalid: bool = True) -> np.ndarray: """Given an array of cftime.datetime objects, return an array of numpy.datetime64 objects of the same size If raise_on_invalid is True (default), invalid dates trigger a ValueError. Otherwise, the invalid element is replaced by np.NaT.""" times = np.asarray(times) new = np.empty(times.shape, dtype="M8[ns]") for i, t in np.ndenumerate(times): try: # Use pandas.Timestamp in place of datetime.datetime, because # NumPy casts it safely it np.datetime64[ns] for dates outside # 1678 to 2262 (this is not currently the case for # datetime.datetime). > dt = pd.Timestamp( t.year, t.month, t.day, t.hour, t.minute, t.second, t.microsecond ) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:448: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > ??? E ValueError: year 294277 is out of range pandas/_libs/tslibs/timestamps.pyx:1673: ValueError During handling of the above exception, another exception occurred: data = LazilyIndexedArray(array=, key=BasicIndexer((slice(None, None, None),))) units = 'days since 2000-01-01 00:00:00', calendar = 'proleptic_gregorian' use_cftime = None def _decode_cf_datetime_dtype( data, units: str, calendar: str, use_cftime: bool | None ) -> np.dtype: # Verify that at least the first and last date can be decoded # successfully. Otherwise, tracebacks end up swallowed by # Dataset.__repr__ when users try to view their lazily decoded array. values = indexing.ImplicitToExplicitIndexingAdapter(indexing.as_indexable(data)) example_value = np.concatenate( [first_n_items(values, 1) or [0], last_item(values) or [0]] ) try: > result = decode_cf_datetime(example_value, units, calendar, use_cftime) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:184: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ num_dates = array([ 0., nan]), units = 'days since 2000-01-01 00:00:00' calendar = 'proleptic_gregorian', use_cftime = None def decode_cf_datetime( num_dates, units: str, calendar: str | None = None, use_cftime: bool | None = None ) -> np.ndarray: """Given an array of numeric dates in netCDF format, convert it into a numpy array of date time objects. For standard (Gregorian) calendars, this function uses vectorized operations, which makes it much faster than cftime.num2date. In such a case, the returned array will be of type np.datetime64. Note that time unit in `units` must not be smaller than microseconds and not larger than days. See Also -------- cftime.num2date """ num_dates = np.asarray(num_dates) flat_num_dates = num_dates.ravel() if calendar is None: calendar = "standard" if use_cftime is None: try: dates = _decode_datetime_with_pandas(flat_num_dates, units, calendar) except (KeyError, OutOfBoundsDatetime, OutOfBoundsTimedelta, OverflowError): dates = _decode_datetime_with_cftime( flat_num_dates.astype(float), units, calendar ) if ( dates[np.nanargmin(num_dates)].year < 1678 or dates[np.nanargmax(num_dates)].year >= 2262 ): if _is_standard_calendar(calendar): warnings.warn( "Unable to decode time axis into full " "numpy.datetime64 objects, continuing using " "cftime.datetime objects instead, reason: dates out " "of range", SerializationWarning, stacklevel=3, ) else: if _is_standard_calendar(calendar): > dates = cftime_to_nptime(dates) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:306: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ times = array([cftime.DatetimeProlepticGregorian(2000, 1, 1, 0, 0, 0, 0, has_year_zero=True), cftime.DatetimeProlepticGregorian(294277, 1, 9, 4, 0, 54, 775807, has_year_zero=True)], dtype=object) raise_on_invalid = True def cftime_to_nptime(times, raise_on_invalid: bool = True) -> np.ndarray: """Given an array of cftime.datetime objects, return an array of numpy.datetime64 objects of the same size If raise_on_invalid is True (default), invalid dates trigger a ValueError. Otherwise, the invalid element is replaced by np.NaT.""" times = np.asarray(times) new = np.empty(times.shape, dtype="M8[ns]") for i, t in np.ndenumerate(times): try: # Use pandas.Timestamp in place of datetime.datetime, because # NumPy casts it safely it np.datetime64[ns] for dates outside # 1678 to 2262 (this is not currently the case for # datetime.datetime). dt = pd.Timestamp( t.year, t.month, t.day, t.hour, t.minute, t.second, t.microsecond ) except ValueError as e: if raise_on_invalid: > raise ValueError( "Cannot convert date {} to a date in the " "standard calendar. Reason: {}.".format(t, e) ) E ValueError: Cannot convert date 294277-01-09 04:00:54 to a date in the standard calendar. Reason: year 294277 is out of range. /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:453: ValueError During handling of the above exception, another exception occurred: variables = Frozen({'t': [3 values with dtype=float64] Attributes: calendar: proleptic_gregorian ...e ()> [1 values with dtype=int64] Attributes: calendar: proleptic_gregorian units: days since 1950-01-01}) attributes = Frozen({}), concat_characters = True, mask_and_scale = True decode_times = True, decode_coords = True, drop_variables = set() use_cftime = None, decode_timedelta = None def decode_cf_variables( variables: T_Variables, attributes: T_Attrs, concat_characters: bool = True, mask_and_scale: bool = True, decode_times: bool = True, decode_coords: bool = True, drop_variables: T_DropVariables = None, use_cftime: bool | None = None, decode_timedelta: bool | None = None, ) -> tuple[T_Variables, T_Attrs, set[Hashable]]: """ Decode several CF encoded variables. See: decode_cf_variable """ dimensions_used_by = defaultdict(list) for v in variables.values(): for d in v.dims: dimensions_used_by[d].append(v) def stackable(dim: Hashable) -> bool: # figure out if a dimension can be concatenated over if dim in variables: return False for v in dimensions_used_by[dim]: if v.dtype.kind != "S" or dim != v.dims[-1]: return False return True coord_names = set() if isinstance(drop_variables, str): drop_variables = [drop_variables] elif drop_variables is None: drop_variables = [] drop_variables = set(drop_variables) # Time bounds coordinates might miss the decoding attributes if decode_times: _update_bounds_attributes(variables) new_vars = {} for k, v in variables.items(): if k in drop_variables: continue stack_char_dim = ( concat_characters and v.dtype == "S1" and v.ndim > 0 and stackable(v.dims[-1]) ) try: > new_vars[k] = decode_cf_variable( k, v, concat_characters=concat_characters, mask_and_scale=mask_and_scale, decode_times=decode_times, stack_char_dim=stack_char_dim, use_cftime=use_cftime, decode_timedelta=decode_timedelta, ) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/conventions.py:551: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ name = 't' var = [3 values with dtype=float64] Attributes: calendar: proleptic_gregorian units: days since 2000-01-01 00:00:00 concat_characters = True, mask_and_scale = True, decode_times = True decode_endianness = True, stack_char_dim = False, use_cftime = None decode_timedelta = True def decode_cf_variable( name: Hashable, var: Variable, concat_characters: bool = True, mask_and_scale: bool = True, decode_times: bool = True, decode_endianness: bool = True, stack_char_dim: bool = True, use_cftime: bool | None = None, decode_timedelta: bool | None = None, ) -> Variable: """ Decodes a variable which may hold CF encoded information. This includes variables that have been masked and scaled, which hold CF style time variables (this is almost always the case if the dataset has been serialized) and which have strings encoded as character arrays. Parameters ---------- name : str Name of the variable. Used for better error messages. var : Variable A variable holding potentially CF encoded information. concat_characters : bool Should character arrays be concatenated to strings, for example: ["h", "e", "l", "l", "o"] -> "hello" mask_and_scale : bool Lazily scale (using scale_factor and add_offset) and mask (using _FillValue). If the _Unsigned attribute is present treat integer arrays as unsigned. decode_times : bool Decode cf times ("hours since 2000-01-01") to np.datetime64. decode_endianness : bool Decode arrays from non-native to native endianness. stack_char_dim : bool Whether to stack characters into bytes along the last dimension of this array. Passed as an argument because we need to look at the full dataset to figure out if this is appropriate. use_cftime : bool, optional Only relevant if encoded dates come from a standard calendar (e.g. "gregorian", "proleptic_gregorian", "standard", or not specified). If None (default), attempt to decode times to ``np.datetime64[ns]`` objects; if this is not possible, decode times to ``cftime.datetime`` objects. If True, always decode times to ``cftime.datetime`` objects, regardless of whether or not they can be represented using ``np.datetime64[ns]`` objects. If False, always decode times to ``np.datetime64[ns]`` objects; if this is not possible raise an error. Returns ------- out : Variable A variable holding the decoded equivalent of var. """ # Ensure datetime-like Variables are passed through unmodified (GH 6453) if _contains_datetime_like_objects(var): return var original_dtype = var.dtype if decode_timedelta is None: decode_timedelta = decode_times if concat_characters: if stack_char_dim: var = strings.CharacterArrayCoder().decode(var, name=name) var = strings.EncodedStringCoder().decode(var) if mask_and_scale: for coder in [ variables.UnsignedIntegerCoder(), variables.CFMaskCoder(), variables.CFScaleOffsetCoder(), ]: var = coder.decode(var, name=name) if decode_timedelta: var = times.CFTimedeltaCoder().decode(var, name=name) if decode_times: > var = times.CFDatetimeCoder(use_cftime=use_cftime).decode(var, name=name) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/conventions.py:397: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = variable = [3 values with dtype=float64] Attributes: calendar: proleptic_gregorian units: days since 2000-01-01 00:00:00 name = 't' def decode(self, variable: Variable, name: T_Name = None) -> Variable: units = variable.attrs.get("units", None) if isinstance(units, str) and "since" in units: dims, data, attrs, encoding = unpack_for_decoding(variable) units = pop_to(attrs, encoding, "units") calendar = pop_to(attrs, encoding, "calendar") > dtype = _decode_cf_datetime_dtype(data, units, calendar, self.use_cftime) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:716: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ data = LazilyIndexedArray(array=, key=BasicIndexer((slice(None, None, None),))) units = 'days since 2000-01-01 00:00:00', calendar = 'proleptic_gregorian' use_cftime = None def _decode_cf_datetime_dtype( data, units: str, calendar: str, use_cftime: bool | None ) -> np.dtype: # Verify that at least the first and last date can be decoded # successfully. Otherwise, tracebacks end up swallowed by # Dataset.__repr__ when users try to view their lazily decoded array. values = indexing.ImplicitToExplicitIndexingAdapter(indexing.as_indexable(data)) example_value = np.concatenate( [first_n_items(values, 1) or [0], last_item(values) or [0]] ) try: result = decode_cf_datetime(example_value, units, calendar, use_cftime) except Exception: calendar_msg = ( "the default calendar" if calendar is None else f"calendar {calendar!r}" ) msg = ( f"unable to decode time units {units!r} with {calendar_msg!r}. Try " "opening your dataset with decode_times=False or installing cftime " "if it is not installed." ) > raise ValueError(msg) E ValueError: unable to decode time units 'days since 2000-01-01 00:00:00' with "calendar 'proleptic_gregorian'". Try opening your dataset with decode_times=False or installing cftime if it is not installed. /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:194: ValueError During handling of the above exception, another exception occurred: self = @arm_xfail def test_roundtrip_numpy_datetime_data(self) -> None: times = pd.to_datetime(["2000-01-01", "2000-01-02", "NaT"]) expected = Dataset({"t": ("t", times), "t0": times[0]}) kwargs = {"encoding": {"t0": {"units": "days since 1950-01-01"}}} > with self.roundtrip(expected, save_kwargs=kwargs) as actual: /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:535: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.11/contextlib.py:137: in __enter__ return next(self.gen) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1788: in roundtrip with self.open(store_target, **open_kwargs) as ds: /usr/lib64/python3.11/contextlib.py:137: in __enter__ return next(self.gen) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1773: in open with xr.open_dataset( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/backends/api.py:541: in open_dataset backend_ds = backend.open_dataset( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/backends/zarr.py:902: in open_dataset ds = store_entrypoint.open_dataset( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/backends/store.py:35: in open_dataset vars, attrs, coord_names = conventions.decode_cf_variables( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ variables = Frozen({'t': [3 values with dtype=float64] Attributes: calendar: proleptic_gregorian ...e ()> [1 values with dtype=int64] Attributes: calendar: proleptic_gregorian units: days since 1950-01-01}) attributes = Frozen({}), concat_characters = True, mask_and_scale = True decode_times = True, decode_coords = True, drop_variables = set() use_cftime = None, decode_timedelta = None def decode_cf_variables( variables: T_Variables, attributes: T_Attrs, concat_characters: bool = True, mask_and_scale: bool = True, decode_times: bool = True, decode_coords: bool = True, drop_variables: T_DropVariables = None, use_cftime: bool | None = None, decode_timedelta: bool | None = None, ) -> tuple[T_Variables, T_Attrs, set[Hashable]]: """ Decode several CF encoded variables. See: decode_cf_variable """ dimensions_used_by = defaultdict(list) for v in variables.values(): for d in v.dims: dimensions_used_by[d].append(v) def stackable(dim: Hashable) -> bool: # figure out if a dimension can be concatenated over if dim in variables: return False for v in dimensions_used_by[dim]: if v.dtype.kind != "S" or dim != v.dims[-1]: return False return True coord_names = set() if isinstance(drop_variables, str): drop_variables = [drop_variables] elif drop_variables is None: drop_variables = [] drop_variables = set(drop_variables) # Time bounds coordinates might miss the decoding attributes if decode_times: _update_bounds_attributes(variables) new_vars = {} for k, v in variables.items(): if k in drop_variables: continue stack_char_dim = ( concat_characters and v.dtype == "S1" and v.ndim > 0 and stackable(v.dims[-1]) ) try: new_vars[k] = decode_cf_variable( k, v, concat_characters=concat_characters, mask_and_scale=mask_and_scale, decode_times=decode_times, stack_char_dim=stack_char_dim, use_cftime=use_cftime, decode_timedelta=decode_timedelta, ) except Exception as e: > raise type(e)(f"Failed to decode variable {k!r}: {e}") E ValueError: Failed to decode variable 't': unable to decode time units 'days since 2000-01-01 00:00:00' with "calendar 'proleptic_gregorian'". Try opening your dataset with decode_times=False or installing cftime if it is not installed. /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/conventions.py:562: ValueError _____ TestNetCDF4ClassicViaNetCDF4Data.test_roundtrip_numpy_datetime_data ______ [gw2] linux -- Python 3.11.4 /usr/bin/python3 num_dates = array([ 0., nan]), units = 'days since 2000-01-01 00:00:00' calendar = 'proleptic_gregorian', use_cftime = None def decode_cf_datetime( num_dates, units: str, calendar: str | None = None, use_cftime: bool | None = None ) -> np.ndarray: """Given an array of numeric dates in netCDF format, convert it into a numpy array of date time objects. For standard (Gregorian) calendars, this function uses vectorized operations, which makes it much faster than cftime.num2date. In such a case, the returned array will be of type np.datetime64. Note that time unit in `units` must not be smaller than microseconds and not larger than days. See Also -------- cftime.num2date """ num_dates = np.asarray(num_dates) flat_num_dates = num_dates.ravel() if calendar is None: calendar = "standard" if use_cftime is None: try: > dates = _decode_datetime_with_pandas(flat_num_dates, units, calendar) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:285: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ flat_num_dates = array([ 0., nan]), units = 'days since 2000-01-01 00:00:00' calendar = 'proleptic_gregorian' def _decode_datetime_with_pandas( flat_num_dates: np.ndarray, units: str, calendar: str ) -> np.ndarray: if not _is_standard_calendar(calendar): raise OutOfBoundsDatetime( "Cannot decode times from a non-standard calendar, {!r}, using " "pandas.".format(calendar) ) delta, ref_date = _unpack_netcdf_time_units(units) delta = _netcdf_to_numpy_timeunit(delta) try: ref_date = pd.Timestamp(ref_date) except ValueError: # ValueError is raised by pd.Timestamp for non-ISO timestamp # strings, in which case we fall back to using cftime raise OutOfBoundsDatetime with warnings.catch_warnings(): warnings.filterwarnings("ignore", "invalid value encountered", RuntimeWarning) if flat_num_dates.size > 0: # avoid size 0 datetimes GH1329 pd.to_timedelta(flat_num_dates.min(), delta) + ref_date pd.to_timedelta(flat_num_dates.max(), delta) + ref_date # To avoid integer overflow when converting to nanosecond units for integer # dtypes smaller than np.int64 cast all integer and unsigned integer dtype # arrays to np.int64 (GH 2002, GH 6589). Note this is safe even in the case # of np.uint64 values, because any np.uint64 value that would lead to # overflow when converting to np.int64 would not be representable with a # timedelta64 value, and therefore would raise an error in the lines above. if flat_num_dates.dtype.kind in "iu": flat_num_dates = flat_num_dates.astype(np.int64) # Cast input ordinals to integers of nanoseconds because pd.to_timedelta # works much faster when dealing with integers (GH 1399). flat_num_dates_ns_int = (flat_num_dates * _NS_PER_TIME_DELTA[delta]).astype( np.int64 ) # Use pd.to_timedelta to safely cast integer values to timedeltas, # and add those to a Timestamp to safely produce a DatetimeIndex. This # ensures that we do not encounter integer overflow at any point in the # process without raising OutOfBoundsDatetime. > return (pd.to_timedelta(flat_num_dates_ns_int, "ns") + ref_date).values /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:258: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['0 days 00:00:00', '106751 days 23:47:16.854775807'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00') @wraps(method) def new_method(self, other): if is_cmp and isinstance(self, ABCIndex) and isinstance(other, ABCSeries): # For comparison ops, Index does *not* defer to Series pass else: for cls in [ABCDataFrame, ABCSeries, ABCIndex]: if isinstance(self, cls): break if isinstance(other, cls): return NotImplemented other = item_from_zerodim(other) > return method(self, other) /usr/lib64/python3.11/site-packages/pandas/core/ops/common.py:72: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['0 days 00:00:00', '106751 days 23:47:16.854775807'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00') @unpack_zerodim_and_defer("__add__") def __add__(self, other): > return self._arith_method(other, operator.add) /usr/lib64/python3.11/site-packages/pandas/core/arraylike.py:102: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['0 days 00:00:00', '106751 days 23:47:16.854775807'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00'), op = def _arith_method(self, other, op): if ( isinstance(other, Index) and is_object_dtype(other.dtype) and type(other) is not Index ): # We return NotImplemented for object-dtype index *subclasses* so they have # a chance to implement ops before we unwrap them. # See https://github.com/pandas-dev/pandas/issues/31109 return NotImplemented > return super()._arith_method(other, op) /usr/lib64/python3.11/site-packages/pandas/core/indexes/base.py:7007: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['0 days 00:00:00', '106751 days 23:47:16.854775807'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00'), op = def _arith_method(self, other, op): res_name = ops.get_op_result_name(self, other) lvalues = self._values rvalues = extract_array(other, extract_numpy=True, extract_range=True) rvalues = ops.maybe_prepare_scalar_for_op(rvalues, lvalues.shape) rvalues = ensure_wrapped_if_datetimelike(rvalues) with np.errstate(all="ignore"): > result = ops.arithmetic_op(lvalues, rvalues, op) /usr/lib64/python3.11/site-packages/pandas/core/base.py:1325: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ left = ['0 days 00:00:00', '106751 days 23:47:16.854775807'] Length: 2, dtype: timedelta64[ns] right = Timestamp('2000-01-01 00:00:00'), op = def arithmetic_op(left: ArrayLike, right: Any, op): """ Evaluate an arithmetic operation `+`, `-`, `*`, `/`, `//`, `%`, `**`, ... Note: the caller is responsible for ensuring that numpy warnings are suppressed (with np.errstate(all="ignore")) if needed. Parameters ---------- left : np.ndarray or ExtensionArray right : object Cannot be a DataFrame or Index. Series is *not* excluded. op : {operator.add, operator.sub, ...} Or one of the reversed variants from roperator. Returns ------- ndarray or ExtensionArray Or a 2-tuple of these in the case of divmod or rdivmod. """ # NB: We assume that extract_array and ensure_wrapped_if_datetimelike # have already been called on `left` and `right`, # and `maybe_prepare_scalar_for_op` has already been called on `right` # We need to special-case datetime64/timedelta64 dtypes (e.g. because numpy # casts integer dtypes to timedelta64 when operating with timedelta64 - GH#22390) if ( should_extension_dispatch(left, right) or isinstance(right, (Timedelta, BaseOffset, Timestamp)) or right is NaT ): # Timedelta/Timestamp and other custom scalars are included in the check # because numexpr will fail on it, see GH#31457 > res_values = op(left, right) /usr/lib64/python3.11/site-packages/pandas/core/ops/array_ops.py:218: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = ['0 days 00:00:00', '106751 days 23:47:16.854775807'] Length: 2, dtype: timedelta64[ns] other = Timestamp('2000-01-01 00:00:00') @wraps(method) def new_method(self, other): if is_cmp and isinstance(self, ABCIndex) and isinstance(other, ABCSeries): # For comparison ops, Index does *not* defer to Series pass else: for cls in [ABCDataFrame, ABCSeries, ABCIndex]: if isinstance(self, cls): break if isinstance(other, cls): return NotImplemented other = item_from_zerodim(other) > return method(self, other) /usr/lib64/python3.11/site-packages/pandas/core/ops/common.py:72: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = ['0 days 00:00:00', '106751 days 23:47:16.854775807'] Length: 2, dtype: timedelta64[ns] other = Timestamp('2000-01-01 00:00:00') @unpack_zerodim_and_defer("__add__") def __add__(self, other): other_dtype = getattr(other, "dtype", None) # scalar others if other is NaT: result = self._add_nat() elif isinstance(other, (Tick, timedelta, np.timedelta64)): result = self._add_timedeltalike_scalar(other) elif isinstance(other, BaseOffset): # specifically _not_ a Tick result = self._add_offset(other) elif isinstance(other, (datetime, np.datetime64)): > result = self._add_datetimelike_scalar(other) /usr/lib64/python3.11/site-packages/pandas/core/arrays/datetimelike.py:1441: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = ['0 days 00:00:00', '106751 days 23:47:16.854775807'] Length: 2, dtype: timedelta64[ns] other = Timestamp('2000-01-01 00:00:00') @final def _add_datetimelike_scalar(self, other) -> DatetimeArray: if not is_timedelta64_dtype(self.dtype): raise TypeError( f"cannot add {type(self).__name__} and {type(other).__name__}" ) self = cast("TimedeltaArray", self) from pandas.core.arrays import DatetimeArray from pandas.core.arrays.datetimes import tz_to_dtype assert other is not NaT other = Timestamp(other) if other is NaT: # In this case we specifically interpret NaT as a datetime, not # the timedelta interpretation we would get by returning self + NaT result = self._ndarray + NaT.to_datetime64().astype(f"M8[{self._unit}]") # Preserve our resolution return DatetimeArray._simple_new(result, dtype=result.dtype) if self._reso != other._reso: raise NotImplementedError( "Addition between TimedeltaArray and Timestamp with mis-matched " "resolutions is not yet supported." ) i8 = self.asi8 > result = checked_add_with_arr(i8, other.value, arr_mask=self._isnan) /usr/lib64/python3.11/site-packages/pandas/core/arrays/datetimelike.py:1142: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ arr = array([ 0, 9223372036854775807]), b = 946684800000000000 arr_mask = array([False, False]), b_mask = None def checked_add_with_arr( arr: npt.NDArray[np.int64], b: int | npt.NDArray[np.int64], arr_mask: npt.NDArray[np.bool_] | None = None, b_mask: npt.NDArray[np.bool_] | None = None, ) -> npt.NDArray[np.int64]: """ Perform array addition that checks for underflow and overflow. Performs the addition of an int64 array and an int64 integer (or array) but checks that they do not result in overflow first. For elements that are indicated to be NaN, whether or not there is overflow for that element is automatically ignored. Parameters ---------- arr : np.ndarray[int64] addend. b : array or scalar addend. arr_mask : np.ndarray[bool] or None, default None array indicating which elements to exclude from checking b_mask : np.ndarray[bool] or None, default None array or scalar indicating which element(s) to exclude from checking Returns ------- sum : An array for elements x + b for each element x in arr if b is a scalar or an array for elements x + y for each element pair (x, y) in (arr, b). Raises ------ OverflowError if any x + y exceeds the maximum or minimum int64 value. """ # For performance reasons, we broadcast 'b' to the new array 'b2' # so that it has the same size as 'arr'. b2 = np.broadcast_to(b, arr.shape) if b_mask is not None: # We do the same broadcasting for b_mask as well. b2_mask = np.broadcast_to(b_mask, arr.shape) else: b2_mask = None # For elements that are NaN, regardless of their value, we should # ignore whether they overflow or not when doing the checked add. if arr_mask is not None and b2_mask is not None: not_nan = np.logical_not(arr_mask | b2_mask) elif arr_mask is not None: not_nan = np.logical_not(arr_mask) elif b_mask is not None: # error: Argument 1 to "__call__" of "_UFunc_Nin1_Nout1" has # incompatible type "Optional[ndarray[Any, dtype[bool_]]]"; # expected "Union[_SupportsArray[dtype[Any]], _NestedSequence # [_SupportsArray[dtype[Any]]], bool, int, float, complex, str # , bytes, _NestedSequence[Union[bool, int, float, complex, str # , bytes]]]" not_nan = np.logical_not(b2_mask) # type: ignore[arg-type] else: not_nan = np.empty(arr.shape, dtype=bool) not_nan.fill(True) # gh-14324: For each element in 'arr' and its corresponding element # in 'b2', we check the sign of the element in 'b2'. If it is positive, # we then check whether its sum with the element in 'arr' exceeds # np.iinfo(np.int64).max. If so, we have an overflow error. If it # it is negative, we then check whether its sum with the element in # 'arr' exceeds np.iinfo(np.int64).min. If so, we have an overflow # error as well. i8max = lib.i8max i8min = iNaT mask1 = b2 > 0 mask2 = b2 < 0 if not mask1.any(): to_raise = ((i8min - b2 > arr) & not_nan).any() elif not mask2.any(): to_raise = ((i8max - b2 < arr) & not_nan).any() else: to_raise = ((i8max - b2[mask1] < arr[mask1]) & not_nan[mask1]).any() or ( (i8min - b2[mask2] > arr[mask2]) & not_nan[mask2] ).any() if to_raise: > raise OverflowError("Overflow in int64 addition") E OverflowError: Overflow in int64 addition /usr/lib64/python3.11/site-packages/pandas/core/algorithms.py:1249: OverflowError During handling of the above exception, another exception occurred: times = array([cftime.DatetimeProlepticGregorian(2000, 1, 1, 0, 0, 0, 0, has_year_zero=True), cftime.DatetimeProlepticGregorian(294277, 1, 9, 4, 0, 54, 775807, has_year_zero=True)], dtype=object) raise_on_invalid = True def cftime_to_nptime(times, raise_on_invalid: bool = True) -> np.ndarray: """Given an array of cftime.datetime objects, return an array of numpy.datetime64 objects of the same size If raise_on_invalid is True (default), invalid dates trigger a ValueError. Otherwise, the invalid element is replaced by np.NaT.""" times = np.asarray(times) new = np.empty(times.shape, dtype="M8[ns]") for i, t in np.ndenumerate(times): try: # Use pandas.Timestamp in place of datetime.datetime, because # NumPy casts it safely it np.datetime64[ns] for dates outside # 1678 to 2262 (this is not currently the case for # datetime.datetime). > dt = pd.Timestamp( t.year, t.month, t.day, t.hour, t.minute, t.second, t.microsecond ) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:448: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > ??? E ValueError: year 294277 is out of range pandas/_libs/tslibs/timestamps.pyx:1673: ValueError During handling of the above exception, another exception occurred: data = LazilyIndexedArray(array=, key=BasicIndexer((slice(None, None, None),))) units = 'days since 2000-01-01 00:00:00', calendar = 'proleptic_gregorian' use_cftime = None def _decode_cf_datetime_dtype( data, units: str, calendar: str, use_cftime: bool | None ) -> np.dtype: # Verify that at least the first and last date can be decoded # successfully. Otherwise, tracebacks end up swallowed by # Dataset.__repr__ when users try to view their lazily decoded array. values = indexing.ImplicitToExplicitIndexingAdapter(indexing.as_indexable(data)) example_value = np.concatenate( [first_n_items(values, 1) or [0], last_item(values) or [0]] ) try: > result = decode_cf_datetime(example_value, units, calendar, use_cftime) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:184: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ num_dates = array([ 0., nan]), units = 'days since 2000-01-01 00:00:00' calendar = 'proleptic_gregorian', use_cftime = None def decode_cf_datetime( num_dates, units: str, calendar: str | None = None, use_cftime: bool | None = None ) -> np.ndarray: """Given an array of numeric dates in netCDF format, convert it into a numpy array of date time objects. For standard (Gregorian) calendars, this function uses vectorized operations, which makes it much faster than cftime.num2date. In such a case, the returned array will be of type np.datetime64. Note that time unit in `units` must not be smaller than microseconds and not larger than days. See Also -------- cftime.num2date """ num_dates = np.asarray(num_dates) flat_num_dates = num_dates.ravel() if calendar is None: calendar = "standard" if use_cftime is None: try: dates = _decode_datetime_with_pandas(flat_num_dates, units, calendar) except (KeyError, OutOfBoundsDatetime, OutOfBoundsTimedelta, OverflowError): dates = _decode_datetime_with_cftime( flat_num_dates.astype(float), units, calendar ) if ( dates[np.nanargmin(num_dates)].year < 1678 or dates[np.nanargmax(num_dates)].year >= 2262 ): if _is_standard_calendar(calendar): warnings.warn( "Unable to decode time axis into full " "numpy.datetime64 objects, continuing using " "cftime.datetime objects instead, reason: dates out " "of range", SerializationWarning, stacklevel=3, ) else: if _is_standard_calendar(calendar): > dates = cftime_to_nptime(dates) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:306: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ times = array([cftime.DatetimeProlepticGregorian(2000, 1, 1, 0, 0, 0, 0, has_year_zero=True), cftime.DatetimeProlepticGregorian(294277, 1, 9, 4, 0, 54, 775807, has_year_zero=True)], dtype=object) raise_on_invalid = True def cftime_to_nptime(times, raise_on_invalid: bool = True) -> np.ndarray: """Given an array of cftime.datetime objects, return an array of numpy.datetime64 objects of the same size If raise_on_invalid is True (default), invalid dates trigger a ValueError. Otherwise, the invalid element is replaced by np.NaT.""" times = np.asarray(times) new = np.empty(times.shape, dtype="M8[ns]") for i, t in np.ndenumerate(times): try: # Use pandas.Timestamp in place of datetime.datetime, because # NumPy casts it safely it np.datetime64[ns] for dates outside # 1678 to 2262 (this is not currently the case for # datetime.datetime). dt = pd.Timestamp( t.year, t.month, t.day, t.hour, t.minute, t.second, t.microsecond ) except ValueError as e: if raise_on_invalid: > raise ValueError( "Cannot convert date {} to a date in the " "standard calendar. Reason: {}.".format(t, e) ) E ValueError: Cannot convert date 294277-01-09 04:00:54 to a date in the standard calendar. Reason: year 294277 is out of range. /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:453: ValueError During handling of the above exception, another exception occurred: variables = Frozen({'t': [3 values with dtype=float64] Attributes: _FillValue: nan units: ...e ()> [1 values with dtype=int32] Attributes: units: days since 1950-01-01 calendar: proleptic_gregorian}) attributes = Frozen({}), concat_characters = True, mask_and_scale = True decode_times = True, decode_coords = True, drop_variables = set() use_cftime = None, decode_timedelta = None def decode_cf_variables( variables: T_Variables, attributes: T_Attrs, concat_characters: bool = True, mask_and_scale: bool = True, decode_times: bool = True, decode_coords: bool = True, drop_variables: T_DropVariables = None, use_cftime: bool | None = None, decode_timedelta: bool | None = None, ) -> tuple[T_Variables, T_Attrs, set[Hashable]]: """ Decode several CF encoded variables. See: decode_cf_variable """ dimensions_used_by = defaultdict(list) for v in variables.values(): for d in v.dims: dimensions_used_by[d].append(v) def stackable(dim: Hashable) -> bool: # figure out if a dimension can be concatenated over if dim in variables: return False for v in dimensions_used_by[dim]: if v.dtype.kind != "S" or dim != v.dims[-1]: return False return True coord_names = set() if isinstance(drop_variables, str): drop_variables = [drop_variables] elif drop_variables is None: drop_variables = [] drop_variables = set(drop_variables) # Time bounds coordinates might miss the decoding attributes if decode_times: _update_bounds_attributes(variables) new_vars = {} for k, v in variables.items(): if k in drop_variables: continue stack_char_dim = ( concat_characters and v.dtype == "S1" and v.ndim > 0 and stackable(v.dims[-1]) ) try: > new_vars[k] = decode_cf_variable( k, v, concat_characters=concat_characters, mask_and_scale=mask_and_scale, decode_times=decode_times, stack_char_dim=stack_char_dim, use_cftime=use_cftime, decode_timedelta=decode_timedelta, ) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/conventions.py:551: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ name = 't' var = [3 values with dtype=float64] Attributes: units: days since 2000-01-01 00:00:00 calendar: proleptic_gregorian concat_characters = True, mask_and_scale = True, decode_times = True decode_endianness = True, stack_char_dim = False, use_cftime = None decode_timedelta = True def decode_cf_variable( name: Hashable, var: Variable, concat_characters: bool = True, mask_and_scale: bool = True, decode_times: bool = True, decode_endianness: bool = True, stack_char_dim: bool = True, use_cftime: bool | None = None, decode_timedelta: bool | None = None, ) -> Variable: """ Decodes a variable which may hold CF encoded information. This includes variables that have been masked and scaled, which hold CF style time variables (this is almost always the case if the dataset has been serialized) and which have strings encoded as character arrays. Parameters ---------- name : str Name of the variable. Used for better error messages. var : Variable A variable holding potentially CF encoded information. concat_characters : bool Should character arrays be concatenated to strings, for example: ["h", "e", "l", "l", "o"] -> "hello" mask_and_scale : bool Lazily scale (using scale_factor and add_offset) and mask (using _FillValue). If the _Unsigned attribute is present treat integer arrays as unsigned. decode_times : bool Decode cf times ("hours since 2000-01-01") to np.datetime64. decode_endianness : bool Decode arrays from non-native to native endianness. stack_char_dim : bool Whether to stack characters into bytes along the last dimension of this array. Passed as an argument because we need to look at the full dataset to figure out if this is appropriate. use_cftime : bool, optional Only relevant if encoded dates come from a standard calendar (e.g. "gregorian", "proleptic_gregorian", "standard", or not specified). If None (default), attempt to decode times to ``np.datetime64[ns]`` objects; if this is not possible, decode times to ``cftime.datetime`` objects. If True, always decode times to ``cftime.datetime`` objects, regardless of whether or not they can be represented using ``np.datetime64[ns]`` objects. If False, always decode times to ``np.datetime64[ns]`` objects; if this is not possible raise an error. Returns ------- out : Variable A variable holding the decoded equivalent of var. """ # Ensure datetime-like Variables are passed through unmodified (GH 6453) if _contains_datetime_like_objects(var): return var original_dtype = var.dtype if decode_timedelta is None: decode_timedelta = decode_times if concat_characters: if stack_char_dim: var = strings.CharacterArrayCoder().decode(var, name=name) var = strings.EncodedStringCoder().decode(var) if mask_and_scale: for coder in [ variables.UnsignedIntegerCoder(), variables.CFMaskCoder(), variables.CFScaleOffsetCoder(), ]: var = coder.decode(var, name=name) if decode_timedelta: var = times.CFTimedeltaCoder().decode(var, name=name) if decode_times: > var = times.CFDatetimeCoder(use_cftime=use_cftime).decode(var, name=name) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/conventions.py:397: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = variable = [3 values with dtype=float64] Attributes: units: days since 2000-01-01 00:00:00 calendar: proleptic_gregorian name = 't' def decode(self, variable: Variable, name: T_Name = None) -> Variable: units = variable.attrs.get("units", None) if isinstance(units, str) and "since" in units: dims, data, attrs, encoding = unpack_for_decoding(variable) units = pop_to(attrs, encoding, "units") calendar = pop_to(attrs, encoding, "calendar") > dtype = _decode_cf_datetime_dtype(data, units, calendar, self.use_cftime) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:716: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ data = LazilyIndexedArray(array=, key=BasicIndexer((slice(None, None, None),))) units = 'days since 2000-01-01 00:00:00', calendar = 'proleptic_gregorian' use_cftime = None def _decode_cf_datetime_dtype( data, units: str, calendar: str, use_cftime: bool | None ) -> np.dtype: # Verify that at least the first and last date can be decoded # successfully. Otherwise, tracebacks end up swallowed by # Dataset.__repr__ when users try to view their lazily decoded array. values = indexing.ImplicitToExplicitIndexingAdapter(indexing.as_indexable(data)) example_value = np.concatenate( [first_n_items(values, 1) or [0], last_item(values) or [0]] ) try: result = decode_cf_datetime(example_value, units, calendar, use_cftime) except Exception: calendar_msg = ( "the default calendar" if calendar is None else f"calendar {calendar!r}" ) msg = ( f"unable to decode time units {units!r} with {calendar_msg!r}. Try " "opening your dataset with decode_times=False or installing cftime " "if it is not installed." ) > raise ValueError(msg) E ValueError: unable to decode time units 'days since 2000-01-01 00:00:00' with "calendar 'proleptic_gregorian'". Try opening your dataset with decode_times=False or installing cftime if it is not installed. /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:194: ValueError During handling of the above exception, another exception occurred: self = @arm_xfail def test_roundtrip_numpy_datetime_data(self) -> None: times = pd.to_datetime(["2000-01-01", "2000-01-02", "NaT"]) expected = Dataset({"t": ("t", times), "t0": times[0]}) kwargs = {"encoding": {"t0": {"units": "days since 1950-01-01"}}} > with self.roundtrip(expected, save_kwargs=kwargs) as actual: /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:535: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.11/contextlib.py:137: in __enter__ return next(self.gen) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:311: in roundtrip with self.open(path, **open_kwargs) as ds: /usr/lib64/python3.11/contextlib.py:137: in __enter__ return next(self.gen) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:337: in open with open_dataset(path, engine=self.engine, **kwargs) as ds: /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/backends/api.py:541: in open_dataset backend_ds = backend.open_dataset( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/backends/netCDF4_.py:592: in open_dataset ds = store_entrypoint.open_dataset( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/backends/store.py:35: in open_dataset vars, attrs, coord_names = conventions.decode_cf_variables( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ variables = Frozen({'t': [3 values with dtype=float64] Attributes: _FillValue: nan units: ...e ()> [1 values with dtype=int32] Attributes: units: days since 1950-01-01 calendar: proleptic_gregorian}) attributes = Frozen({}), concat_characters = True, mask_and_scale = True decode_times = True, decode_coords = True, drop_variables = set() use_cftime = None, decode_timedelta = None def decode_cf_variables( variables: T_Variables, attributes: T_Attrs, concat_characters: bool = True, mask_and_scale: bool = True, decode_times: bool = True, decode_coords: bool = True, drop_variables: T_DropVariables = None, use_cftime: bool | None = None, decode_timedelta: bool | None = None, ) -> tuple[T_Variables, T_Attrs, set[Hashable]]: """ Decode several CF encoded variables. See: decode_cf_variable """ dimensions_used_by = defaultdict(list) for v in variables.values(): for d in v.dims: dimensions_used_by[d].append(v) def stackable(dim: Hashable) -> bool: # figure out if a dimension can be concatenated over if dim in variables: return False for v in dimensions_used_by[dim]: if v.dtype.kind != "S" or dim != v.dims[-1]: return False return True coord_names = set() if isinstance(drop_variables, str): drop_variables = [drop_variables] elif drop_variables is None: drop_variables = [] drop_variables = set(drop_variables) # Time bounds coordinates might miss the decoding attributes if decode_times: _update_bounds_attributes(variables) new_vars = {} for k, v in variables.items(): if k in drop_variables: continue stack_char_dim = ( concat_characters and v.dtype == "S1" and v.ndim > 0 and stackable(v.dims[-1]) ) try: new_vars[k] = decode_cf_variable( k, v, concat_characters=concat_characters, mask_and_scale=mask_and_scale, decode_times=decode_times, stack_char_dim=stack_char_dim, use_cftime=use_cftime, decode_timedelta=decode_timedelta, ) except Exception as e: > raise type(e)(f"Failed to decode variable {k!r}: {e}") E ValueError: Failed to decode variable 't': unable to decode time units 'days since 2000-01-01 00:00:00' with "calendar 'proleptic_gregorian'". Try opening your dataset with decode_times=False or installing cftime if it is not installed. /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/conventions.py:562: ValueError ___________ TestGenericNetCDFData.test_roundtrip_numpy_datetime_data ___________ [gw2] linux -- Python 3.11.4 /usr/bin/python3 num_dates = array([ 0., nan]), units = 'days since 2000-01-01 00:00:00' calendar = 'proleptic_gregorian', use_cftime = None def decode_cf_datetime( num_dates, units: str, calendar: str | None = None, use_cftime: bool | None = None ) -> np.ndarray: """Given an array of numeric dates in netCDF format, convert it into a numpy array of date time objects. For standard (Gregorian) calendars, this function uses vectorized operations, which makes it much faster than cftime.num2date. In such a case, the returned array will be of type np.datetime64. Note that time unit in `units` must not be smaller than microseconds and not larger than days. See Also -------- cftime.num2date """ num_dates = np.asarray(num_dates) flat_num_dates = num_dates.ravel() if calendar is None: calendar = "standard" if use_cftime is None: try: > dates = _decode_datetime_with_pandas(flat_num_dates, units, calendar) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:285: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ flat_num_dates = array([ 0., nan]), units = 'days since 2000-01-01 00:00:00' calendar = 'proleptic_gregorian' def _decode_datetime_with_pandas( flat_num_dates: np.ndarray, units: str, calendar: str ) -> np.ndarray: if not _is_standard_calendar(calendar): raise OutOfBoundsDatetime( "Cannot decode times from a non-standard calendar, {!r}, using " "pandas.".format(calendar) ) delta, ref_date = _unpack_netcdf_time_units(units) delta = _netcdf_to_numpy_timeunit(delta) try: ref_date = pd.Timestamp(ref_date) except ValueError: # ValueError is raised by pd.Timestamp for non-ISO timestamp # strings, in which case we fall back to using cftime raise OutOfBoundsDatetime with warnings.catch_warnings(): warnings.filterwarnings("ignore", "invalid value encountered", RuntimeWarning) if flat_num_dates.size > 0: # avoid size 0 datetimes GH1329 pd.to_timedelta(flat_num_dates.min(), delta) + ref_date pd.to_timedelta(flat_num_dates.max(), delta) + ref_date # To avoid integer overflow when converting to nanosecond units for integer # dtypes smaller than np.int64 cast all integer and unsigned integer dtype # arrays to np.int64 (GH 2002, GH 6589). Note this is safe even in the case # of np.uint64 values, because any np.uint64 value that would lead to # overflow when converting to np.int64 would not be representable with a # timedelta64 value, and therefore would raise an error in the lines above. if flat_num_dates.dtype.kind in "iu": flat_num_dates = flat_num_dates.astype(np.int64) # Cast input ordinals to integers of nanoseconds because pd.to_timedelta # works much faster when dealing with integers (GH 1399). flat_num_dates_ns_int = (flat_num_dates * _NS_PER_TIME_DELTA[delta]).astype( np.int64 ) # Use pd.to_timedelta to safely cast integer values to timedeltas, # and add those to a Timestamp to safely produce a DatetimeIndex. This # ensures that we do not encounter integer overflow at any point in the # process without raising OutOfBoundsDatetime. > return (pd.to_timedelta(flat_num_dates_ns_int, "ns") + ref_date).values /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:258: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['0 days 00:00:00', '106751 days 23:47:16.854775807'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00') @wraps(method) def new_method(self, other): if is_cmp and isinstance(self, ABCIndex) and isinstance(other, ABCSeries): # For comparison ops, Index does *not* defer to Series pass else: for cls in [ABCDataFrame, ABCSeries, ABCIndex]: if isinstance(self, cls): break if isinstance(other, cls): return NotImplemented other = item_from_zerodim(other) > return method(self, other) /usr/lib64/python3.11/site-packages/pandas/core/ops/common.py:72: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['0 days 00:00:00', '106751 days 23:47:16.854775807'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00') @unpack_zerodim_and_defer("__add__") def __add__(self, other): > return self._arith_method(other, operator.add) /usr/lib64/python3.11/site-packages/pandas/core/arraylike.py:102: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['0 days 00:00:00', '106751 days 23:47:16.854775807'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00'), op = def _arith_method(self, other, op): if ( isinstance(other, Index) and is_object_dtype(other.dtype) and type(other) is not Index ): # We return NotImplemented for object-dtype index *subclasses* so they have # a chance to implement ops before we unwrap them. # See https://github.com/pandas-dev/pandas/issues/31109 return NotImplemented > return super()._arith_method(other, op) /usr/lib64/python3.11/site-packages/pandas/core/indexes/base.py:7007: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['0 days 00:00:00', '106751 days 23:47:16.854775807'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00'), op = def _arith_method(self, other, op): res_name = ops.get_op_result_name(self, other) lvalues = self._values rvalues = extract_array(other, extract_numpy=True, extract_range=True) rvalues = ops.maybe_prepare_scalar_for_op(rvalues, lvalues.shape) rvalues = ensure_wrapped_if_datetimelike(rvalues) with np.errstate(all="ignore"): > result = ops.arithmetic_op(lvalues, rvalues, op) /usr/lib64/python3.11/site-packages/pandas/core/base.py:1325: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ left = ['0 days 00:00:00', '106751 days 23:47:16.854775807'] Length: 2, dtype: timedelta64[ns] right = Timestamp('2000-01-01 00:00:00'), op = def arithmetic_op(left: ArrayLike, right: Any, op): """ Evaluate an arithmetic operation `+`, `-`, `*`, `/`, `//`, `%`, `**`, ... Note: the caller is responsible for ensuring that numpy warnings are suppressed (with np.errstate(all="ignore")) if needed. Parameters ---------- left : np.ndarray or ExtensionArray right : object Cannot be a DataFrame or Index. Series is *not* excluded. op : {operator.add, operator.sub, ...} Or one of the reversed variants from roperator. Returns ------- ndarray or ExtensionArray Or a 2-tuple of these in the case of divmod or rdivmod. """ # NB: We assume that extract_array and ensure_wrapped_if_datetimelike # have already been called on `left` and `right`, # and `maybe_prepare_scalar_for_op` has already been called on `right` # We need to special-case datetime64/timedelta64 dtypes (e.g. because numpy # casts integer dtypes to timedelta64 when operating with timedelta64 - GH#22390) if ( should_extension_dispatch(left, right) or isinstance(right, (Timedelta, BaseOffset, Timestamp)) or right is NaT ): # Timedelta/Timestamp and other custom scalars are included in the check # because numexpr will fail on it, see GH#31457 > res_values = op(left, right) /usr/lib64/python3.11/site-packages/pandas/core/ops/array_ops.py:218: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = ['0 days 00:00:00', '106751 days 23:47:16.854775807'] Length: 2, dtype: timedelta64[ns] other = Timestamp('2000-01-01 00:00:00') @wraps(method) def new_method(self, other): if is_cmp and isinstance(self, ABCIndex) and isinstance(other, ABCSeries): # For comparison ops, Index does *not* defer to Series pass else: for cls in [ABCDataFrame, ABCSeries, ABCIndex]: if isinstance(self, cls): break if isinstance(other, cls): return NotImplemented other = item_from_zerodim(other) > return method(self, other) /usr/lib64/python3.11/site-packages/pandas/core/ops/common.py:72: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = ['0 days 00:00:00', '106751 days 23:47:16.854775807'] Length: 2, dtype: timedelta64[ns] other = Timestamp('2000-01-01 00:00:00') @unpack_zerodim_and_defer("__add__") def __add__(self, other): other_dtype = getattr(other, "dtype", None) # scalar others if other is NaT: result = self._add_nat() elif isinstance(other, (Tick, timedelta, np.timedelta64)): result = self._add_timedeltalike_scalar(other) elif isinstance(other, BaseOffset): # specifically _not_ a Tick result = self._add_offset(other) elif isinstance(other, (datetime, np.datetime64)): > result = self._add_datetimelike_scalar(other) /usr/lib64/python3.11/site-packages/pandas/core/arrays/datetimelike.py:1441: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = ['0 days 00:00:00', '106751 days 23:47:16.854775807'] Length: 2, dtype: timedelta64[ns] other = Timestamp('2000-01-01 00:00:00') @final def _add_datetimelike_scalar(self, other) -> DatetimeArray: if not is_timedelta64_dtype(self.dtype): raise TypeError( f"cannot add {type(self).__name__} and {type(other).__name__}" ) self = cast("TimedeltaArray", self) from pandas.core.arrays import DatetimeArray from pandas.core.arrays.datetimes import tz_to_dtype assert other is not NaT other = Timestamp(other) if other is NaT: # In this case we specifically interpret NaT as a datetime, not # the timedelta interpretation we would get by returning self + NaT result = self._ndarray + NaT.to_datetime64().astype(f"M8[{self._unit}]") # Preserve our resolution return DatetimeArray._simple_new(result, dtype=result.dtype) if self._reso != other._reso: raise NotImplementedError( "Addition between TimedeltaArray and Timestamp with mis-matched " "resolutions is not yet supported." ) i8 = self.asi8 > result = checked_add_with_arr(i8, other.value, arr_mask=self._isnan) /usr/lib64/python3.11/site-packages/pandas/core/arrays/datetimelike.py:1142: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ arr = array([ 0, 9223372036854775807]), b = 946684800000000000 arr_mask = array([False, False]), b_mask = None def checked_add_with_arr( arr: npt.NDArray[np.int64], b: int | npt.NDArray[np.int64], arr_mask: npt.NDArray[np.bool_] | None = None, b_mask: npt.NDArray[np.bool_] | None = None, ) -> npt.NDArray[np.int64]: """ Perform array addition that checks for underflow and overflow. Performs the addition of an int64 array and an int64 integer (or array) but checks that they do not result in overflow first. For elements that are indicated to be NaN, whether or not there is overflow for that element is automatically ignored. Parameters ---------- arr : np.ndarray[int64] addend. b : array or scalar addend. arr_mask : np.ndarray[bool] or None, default None array indicating which elements to exclude from checking b_mask : np.ndarray[bool] or None, default None array or scalar indicating which element(s) to exclude from checking Returns ------- sum : An array for elements x + b for each element x in arr if b is a scalar or an array for elements x + y for each element pair (x, y) in (arr, b). Raises ------ OverflowError if any x + y exceeds the maximum or minimum int64 value. """ # For performance reasons, we broadcast 'b' to the new array 'b2' # so that it has the same size as 'arr'. b2 = np.broadcast_to(b, arr.shape) if b_mask is not None: # We do the same broadcasting for b_mask as well. b2_mask = np.broadcast_to(b_mask, arr.shape) else: b2_mask = None # For elements that are NaN, regardless of their value, we should # ignore whether they overflow or not when doing the checked add. if arr_mask is not None and b2_mask is not None: not_nan = np.logical_not(arr_mask | b2_mask) elif arr_mask is not None: not_nan = np.logical_not(arr_mask) elif b_mask is not None: # error: Argument 1 to "__call__" of "_UFunc_Nin1_Nout1" has # incompatible type "Optional[ndarray[Any, dtype[bool_]]]"; # expected "Union[_SupportsArray[dtype[Any]], _NestedSequence # [_SupportsArray[dtype[Any]]], bool, int, float, complex, str # , bytes, _NestedSequence[Union[bool, int, float, complex, str # , bytes]]]" not_nan = np.logical_not(b2_mask) # type: ignore[arg-type] else: not_nan = np.empty(arr.shape, dtype=bool) not_nan.fill(True) # gh-14324: For each element in 'arr' and its corresponding element # in 'b2', we check the sign of the element in 'b2'. If it is positive, # we then check whether its sum with the element in 'arr' exceeds # np.iinfo(np.int64).max. If so, we have an overflow error. If it # it is negative, we then check whether its sum with the element in # 'arr' exceeds np.iinfo(np.int64).min. If so, we have an overflow # error as well. i8max = lib.i8max i8min = iNaT mask1 = b2 > 0 mask2 = b2 < 0 if not mask1.any(): to_raise = ((i8min - b2 > arr) & not_nan).any() elif not mask2.any(): to_raise = ((i8max - b2 < arr) & not_nan).any() else: to_raise = ((i8max - b2[mask1] < arr[mask1]) & not_nan[mask1]).any() or ( (i8min - b2[mask2] > arr[mask2]) & not_nan[mask2] ).any() if to_raise: > raise OverflowError("Overflow in int64 addition") E OverflowError: Overflow in int64 addition /usr/lib64/python3.11/site-packages/pandas/core/algorithms.py:1249: OverflowError During handling of the above exception, another exception occurred: times = array([cftime.DatetimeProlepticGregorian(2000, 1, 1, 0, 0, 0, 0, has_year_zero=True), cftime.DatetimeProlepticGregorian(294277, 1, 9, 4, 0, 54, 775807, has_year_zero=True)], dtype=object) raise_on_invalid = True def cftime_to_nptime(times, raise_on_invalid: bool = True) -> np.ndarray: """Given an array of cftime.datetime objects, return an array of numpy.datetime64 objects of the same size If raise_on_invalid is True (default), invalid dates trigger a ValueError. Otherwise, the invalid element is replaced by np.NaT.""" times = np.asarray(times) new = np.empty(times.shape, dtype="M8[ns]") for i, t in np.ndenumerate(times): try: # Use pandas.Timestamp in place of datetime.datetime, because # NumPy casts it safely it np.datetime64[ns] for dates outside # 1678 to 2262 (this is not currently the case for # datetime.datetime). > dt = pd.Timestamp( t.year, t.month, t.day, t.hour, t.minute, t.second, t.microsecond ) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:448: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > ??? E ValueError: year 294277 is out of range pandas/_libs/tslibs/timestamps.pyx:1673: ValueError During handling of the above exception, another exception occurred: data = LazilyIndexedArray(array=, key=BasicIndexer((slice(None, None, None),))) units = 'days since 2000-01-01 00:00:00', calendar = 'proleptic_gregorian' use_cftime = None def _decode_cf_datetime_dtype( data, units: str, calendar: str, use_cftime: bool | None ) -> np.dtype: # Verify that at least the first and last date can be decoded # successfully. Otherwise, tracebacks end up swallowed by # Dataset.__repr__ when users try to view their lazily decoded array. values = indexing.ImplicitToExplicitIndexingAdapter(indexing.as_indexable(data)) example_value = np.concatenate( [first_n_items(values, 1) or [0], last_item(values) or [0]] ) try: > result = decode_cf_datetime(example_value, units, calendar, use_cftime) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:184: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ num_dates = array([ 0., nan]), units = 'days since 2000-01-01 00:00:00' calendar = 'proleptic_gregorian', use_cftime = None def decode_cf_datetime( num_dates, units: str, calendar: str | None = None, use_cftime: bool | None = None ) -> np.ndarray: """Given an array of numeric dates in netCDF format, convert it into a numpy array of date time objects. For standard (Gregorian) calendars, this function uses vectorized operations, which makes it much faster than cftime.num2date. In such a case, the returned array will be of type np.datetime64. Note that time unit in `units` must not be smaller than microseconds and not larger than days. See Also -------- cftime.num2date """ num_dates = np.asarray(num_dates) flat_num_dates = num_dates.ravel() if calendar is None: calendar = "standard" if use_cftime is None: try: dates = _decode_datetime_with_pandas(flat_num_dates, units, calendar) except (KeyError, OutOfBoundsDatetime, OutOfBoundsTimedelta, OverflowError): dates = _decode_datetime_with_cftime( flat_num_dates.astype(float), units, calendar ) if ( dates[np.nanargmin(num_dates)].year < 1678 or dates[np.nanargmax(num_dates)].year >= 2262 ): if _is_standard_calendar(calendar): warnings.warn( "Unable to decode time axis into full " "numpy.datetime64 objects, continuing using " "cftime.datetime objects instead, reason: dates out " "of range", SerializationWarning, stacklevel=3, ) else: if _is_standard_calendar(calendar): > dates = cftime_to_nptime(dates) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:306: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ times = array([cftime.DatetimeProlepticGregorian(2000, 1, 1, 0, 0, 0, 0, has_year_zero=True), cftime.DatetimeProlepticGregorian(294277, 1, 9, 4, 0, 54, 775807, has_year_zero=True)], dtype=object) raise_on_invalid = True def cftime_to_nptime(times, raise_on_invalid: bool = True) -> np.ndarray: """Given an array of cftime.datetime objects, return an array of numpy.datetime64 objects of the same size If raise_on_invalid is True (default), invalid dates trigger a ValueError. Otherwise, the invalid element is replaced by np.NaT.""" times = np.asarray(times) new = np.empty(times.shape, dtype="M8[ns]") for i, t in np.ndenumerate(times): try: # Use pandas.Timestamp in place of datetime.datetime, because # NumPy casts it safely it np.datetime64[ns] for dates outside # 1678 to 2262 (this is not currently the case for # datetime.datetime). dt = pd.Timestamp( t.year, t.month, t.day, t.hour, t.minute, t.second, t.microsecond ) except ValueError as e: if raise_on_invalid: > raise ValueError( "Cannot convert date {} to a date in the " "standard calendar. Reason: {}.".format(t, e) ) E ValueError: Cannot convert date 294277-01-09 04:00:54 to a date in the standard calendar. Reason: year 294277 is out of range. /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:453: ValueError During handling of the above exception, another exception occurred: variables = Frozen({'t': [3 values with dtype=float64] Attributes: _FillValue: nan units: ...e ()> [1 values with dtype=int32] Attributes: units: days since 1950-01-01 calendar: proleptic_gregorian}) attributes = Frozen({}), concat_characters = True, mask_and_scale = True decode_times = True, decode_coords = True, drop_variables = set() use_cftime = None, decode_timedelta = None def decode_cf_variables( variables: T_Variables, attributes: T_Attrs, concat_characters: bool = True, mask_and_scale: bool = True, decode_times: bool = True, decode_coords: bool = True, drop_variables: T_DropVariables = None, use_cftime: bool | None = None, decode_timedelta: bool | None = None, ) -> tuple[T_Variables, T_Attrs, set[Hashable]]: """ Decode several CF encoded variables. See: decode_cf_variable """ dimensions_used_by = defaultdict(list) for v in variables.values(): for d in v.dims: dimensions_used_by[d].append(v) def stackable(dim: Hashable) -> bool: # figure out if a dimension can be concatenated over if dim in variables: return False for v in dimensions_used_by[dim]: if v.dtype.kind != "S" or dim != v.dims[-1]: return False return True coord_names = set() if isinstance(drop_variables, str): drop_variables = [drop_variables] elif drop_variables is None: drop_variables = [] drop_variables = set(drop_variables) # Time bounds coordinates might miss the decoding attributes if decode_times: _update_bounds_attributes(variables) new_vars = {} for k, v in variables.items(): if k in drop_variables: continue stack_char_dim = ( concat_characters and v.dtype == "S1" and v.ndim > 0 and stackable(v.dims[-1]) ) try: > new_vars[k] = decode_cf_variable( k, v, concat_characters=concat_characters, mask_and_scale=mask_and_scale, decode_times=decode_times, stack_char_dim=stack_char_dim, use_cftime=use_cftime, decode_timedelta=decode_timedelta, ) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/conventions.py:551: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ name = 't' var = [3 values with dtype=float64] Attributes: units: days since 2000-01-01 00:00:00 calendar: proleptic_gregorian concat_characters = True, mask_and_scale = True, decode_times = True decode_endianness = True, stack_char_dim = False, use_cftime = None decode_timedelta = True def decode_cf_variable( name: Hashable, var: Variable, concat_characters: bool = True, mask_and_scale: bool = True, decode_times: bool = True, decode_endianness: bool = True, stack_char_dim: bool = True, use_cftime: bool | None = None, decode_timedelta: bool | None = None, ) -> Variable: """ Decodes a variable which may hold CF encoded information. This includes variables that have been masked and scaled, which hold CF style time variables (this is almost always the case if the dataset has been serialized) and which have strings encoded as character arrays. Parameters ---------- name : str Name of the variable. Used for better error messages. var : Variable A variable holding potentially CF encoded information. concat_characters : bool Should character arrays be concatenated to strings, for example: ["h", "e", "l", "l", "o"] -> "hello" mask_and_scale : bool Lazily scale (using scale_factor and add_offset) and mask (using _FillValue). If the _Unsigned attribute is present treat integer arrays as unsigned. decode_times : bool Decode cf times ("hours since 2000-01-01") to np.datetime64. decode_endianness : bool Decode arrays from non-native to native endianness. stack_char_dim : bool Whether to stack characters into bytes along the last dimension of this array. Passed as an argument because we need to look at the full dataset to figure out if this is appropriate. use_cftime : bool, optional Only relevant if encoded dates come from a standard calendar (e.g. "gregorian", "proleptic_gregorian", "standard", or not specified). If None (default), attempt to decode times to ``np.datetime64[ns]`` objects; if this is not possible, decode times to ``cftime.datetime`` objects. If True, always decode times to ``cftime.datetime`` objects, regardless of whether or not they can be represented using ``np.datetime64[ns]`` objects. If False, always decode times to ``np.datetime64[ns]`` objects; if this is not possible raise an error. Returns ------- out : Variable A variable holding the decoded equivalent of var. """ # Ensure datetime-like Variables are passed through unmodified (GH 6453) if _contains_datetime_like_objects(var): return var original_dtype = var.dtype if decode_timedelta is None: decode_timedelta = decode_times if concat_characters: if stack_char_dim: var = strings.CharacterArrayCoder().decode(var, name=name) var = strings.EncodedStringCoder().decode(var) if mask_and_scale: for coder in [ variables.UnsignedIntegerCoder(), variables.CFMaskCoder(), variables.CFScaleOffsetCoder(), ]: var = coder.decode(var, name=name) if decode_timedelta: var = times.CFTimedeltaCoder().decode(var, name=name) if decode_times: > var = times.CFDatetimeCoder(use_cftime=use_cftime).decode(var, name=name) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/conventions.py:397: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = variable = [3 values with dtype=float64] Attributes: units: days since 2000-01-01 00:00:00 calendar: proleptic_gregorian name = 't' def decode(self, variable: Variable, name: T_Name = None) -> Variable: units = variable.attrs.get("units", None) if isinstance(units, str) and "since" in units: dims, data, attrs, encoding = unpack_for_decoding(variable) units = pop_to(attrs, encoding, "units") calendar = pop_to(attrs, encoding, "calendar") > dtype = _decode_cf_datetime_dtype(data, units, calendar, self.use_cftime) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:716: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ data = LazilyIndexedArray(array=, key=BasicIndexer((slice(None, None, None),))) units = 'days since 2000-01-01 00:00:00', calendar = 'proleptic_gregorian' use_cftime = None def _decode_cf_datetime_dtype( data, units: str, calendar: str, use_cftime: bool | None ) -> np.dtype: # Verify that at least the first and last date can be decoded # successfully. Otherwise, tracebacks end up swallowed by # Dataset.__repr__ when users try to view their lazily decoded array. values = indexing.ImplicitToExplicitIndexingAdapter(indexing.as_indexable(data)) example_value = np.concatenate( [first_n_items(values, 1) or [0], last_item(values) or [0]] ) try: result = decode_cf_datetime(example_value, units, calendar, use_cftime) except Exception: calendar_msg = ( "the default calendar" if calendar is None else f"calendar {calendar!r}" ) msg = ( f"unable to decode time units {units!r} with {calendar_msg!r}. Try " "opening your dataset with decode_times=False or installing cftime " "if it is not installed." ) > raise ValueError(msg) E ValueError: unable to decode time units 'days since 2000-01-01 00:00:00' with "calendar 'proleptic_gregorian'". Try opening your dataset with decode_times=False or installing cftime if it is not installed. /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:194: ValueError During handling of the above exception, another exception occurred: self = @arm_xfail def test_roundtrip_numpy_datetime_data(self) -> None: times = pd.to_datetime(["2000-01-01", "2000-01-02", "NaT"]) expected = Dataset({"t": ("t", times), "t0": times[0]}) kwargs = {"encoding": {"t0": {"units": "days since 1950-01-01"}}} > with self.roundtrip(expected, save_kwargs=kwargs) as actual: /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:535: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.11/contextlib.py:137: in __enter__ return next(self.gen) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:311: in roundtrip with self.open(path, **open_kwargs) as ds: /usr/lib64/python3.11/contextlib.py:137: in __enter__ return next(self.gen) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:337: in open with open_dataset(path, engine=self.engine, **kwargs) as ds: /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/backends/api.py:541: in open_dataset backend_ds = backend.open_dataset( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/backends/netCDF4_.py:592: in open_dataset ds = store_entrypoint.open_dataset( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/backends/store.py:35: in open_dataset vars, attrs, coord_names = conventions.decode_cf_variables( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ variables = Frozen({'t': [3 values with dtype=float64] Attributes: _FillValue: nan units: ...e ()> [1 values with dtype=int32] Attributes: units: days since 1950-01-01 calendar: proleptic_gregorian}) attributes = Frozen({}), concat_characters = True, mask_and_scale = True decode_times = True, decode_coords = True, drop_variables = set() use_cftime = None, decode_timedelta = None def decode_cf_variables( variables: T_Variables, attributes: T_Attrs, concat_characters: bool = True, mask_and_scale: bool = True, decode_times: bool = True, decode_coords: bool = True, drop_variables: T_DropVariables = None, use_cftime: bool | None = None, decode_timedelta: bool | None = None, ) -> tuple[T_Variables, T_Attrs, set[Hashable]]: """ Decode several CF encoded variables. See: decode_cf_variable """ dimensions_used_by = defaultdict(list) for v in variables.values(): for d in v.dims: dimensions_used_by[d].append(v) def stackable(dim: Hashable) -> bool: # figure out if a dimension can be concatenated over if dim in variables: return False for v in dimensions_used_by[dim]: if v.dtype.kind != "S" or dim != v.dims[-1]: return False return True coord_names = set() if isinstance(drop_variables, str): drop_variables = [drop_variables] elif drop_variables is None: drop_variables = [] drop_variables = set(drop_variables) # Time bounds coordinates might miss the decoding attributes if decode_times: _update_bounds_attributes(variables) new_vars = {} for k, v in variables.items(): if k in drop_variables: continue stack_char_dim = ( concat_characters and v.dtype == "S1" and v.ndim > 0 and stackable(v.dims[-1]) ) try: new_vars[k] = decode_cf_variable( k, v, concat_characters=concat_characters, mask_and_scale=mask_and_scale, decode_times=decode_times, stack_char_dim=stack_char_dim, use_cftime=use_cftime, decode_timedelta=decode_timedelta, ) except Exception as e: > raise type(e)(f"Failed to decode variable {k!r}: {e}") E ValueError: Failed to decode variable 't': unable to decode time units 'days since 2000-01-01 00:00:00' with "calendar 'proleptic_gregorian'". Try opening your dataset with decode_times=False or installing cftime if it is not installed. /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/conventions.py:562: ValueError ____ test_cf_datetime_nan[num_dates0-days since 2000-01-01-expected_list0] _____ [gw5] linux -- Python 3.11.4 /usr/bin/python3 num_dates = array([nan]), units = 'days since 2000-01-01', calendar = 'standard' use_cftime = None def decode_cf_datetime( num_dates, units: str, calendar: str | None = None, use_cftime: bool | None = None ) -> np.ndarray: """Given an array of numeric dates in netCDF format, convert it into a numpy array of date time objects. For standard (Gregorian) calendars, this function uses vectorized operations, which makes it much faster than cftime.num2date. In such a case, the returned array will be of type np.datetime64. Note that time unit in `units` must not be smaller than microseconds and not larger than days. See Also -------- cftime.num2date """ num_dates = np.asarray(num_dates) flat_num_dates = num_dates.ravel() if calendar is None: calendar = "standard" if use_cftime is None: try: > dates = _decode_datetime_with_pandas(flat_num_dates, units, calendar) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:285: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ flat_num_dates = array([nan]), units = 'days since 2000-01-01' calendar = 'standard' def _decode_datetime_with_pandas( flat_num_dates: np.ndarray, units: str, calendar: str ) -> np.ndarray: if not _is_standard_calendar(calendar): raise OutOfBoundsDatetime( "Cannot decode times from a non-standard calendar, {!r}, using " "pandas.".format(calendar) ) delta, ref_date = _unpack_netcdf_time_units(units) delta = _netcdf_to_numpy_timeunit(delta) try: ref_date = pd.Timestamp(ref_date) except ValueError: # ValueError is raised by pd.Timestamp for non-ISO timestamp # strings, in which case we fall back to using cftime raise OutOfBoundsDatetime with warnings.catch_warnings(): warnings.filterwarnings("ignore", "invalid value encountered", RuntimeWarning) if flat_num_dates.size > 0: # avoid size 0 datetimes GH1329 pd.to_timedelta(flat_num_dates.min(), delta) + ref_date pd.to_timedelta(flat_num_dates.max(), delta) + ref_date # To avoid integer overflow when converting to nanosecond units for integer # dtypes smaller than np.int64 cast all integer and unsigned integer dtype # arrays to np.int64 (GH 2002, GH 6589). Note this is safe even in the case # of np.uint64 values, because any np.uint64 value that would lead to # overflow when converting to np.int64 would not be representable with a # timedelta64 value, and therefore would raise an error in the lines above. if flat_num_dates.dtype.kind in "iu": flat_num_dates = flat_num_dates.astype(np.int64) # Cast input ordinals to integers of nanoseconds because pd.to_timedelta # works much faster when dealing with integers (GH 1399). flat_num_dates_ns_int = (flat_num_dates * _NS_PER_TIME_DELTA[delta]).astype( np.int64 ) # Use pd.to_timedelta to safely cast integer values to timedeltas, # and add those to a Timestamp to safely produce a DatetimeIndex. This # ensures that we do not encounter integer overflow at any point in the # process without raising OutOfBoundsDatetime. > return (pd.to_timedelta(flat_num_dates_ns_int, "ns") + ref_date).values /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:258: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['106751 days 23:47:16.854775807'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00') @wraps(method) def new_method(self, other): if is_cmp and isinstance(self, ABCIndex) and isinstance(other, ABCSeries): # For comparison ops, Index does *not* defer to Series pass else: for cls in [ABCDataFrame, ABCSeries, ABCIndex]: if isinstance(self, cls): break if isinstance(other, cls): return NotImplemented other = item_from_zerodim(other) > return method(self, other) /usr/lib64/python3.11/site-packages/pandas/core/ops/common.py:72: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['106751 days 23:47:16.854775807'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00') @unpack_zerodim_and_defer("__add__") def __add__(self, other): > return self._arith_method(other, operator.add) /usr/lib64/python3.11/site-packages/pandas/core/arraylike.py:102: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['106751 days 23:47:16.854775807'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00'), op = def _arith_method(self, other, op): if ( isinstance(other, Index) and is_object_dtype(other.dtype) and type(other) is not Index ): # We return NotImplemented for object-dtype index *subclasses* so they have # a chance to implement ops before we unwrap them. # See https://github.com/pandas-dev/pandas/issues/31109 return NotImplemented > return super()._arith_method(other, op) /usr/lib64/python3.11/site-packages/pandas/core/indexes/base.py:7007: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['106751 days 23:47:16.854775807'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00'), op = def _arith_method(self, other, op): res_name = ops.get_op_result_name(self, other) lvalues = self._values rvalues = extract_array(other, extract_numpy=True, extract_range=True) rvalues = ops.maybe_prepare_scalar_for_op(rvalues, lvalues.shape) rvalues = ensure_wrapped_if_datetimelike(rvalues) with np.errstate(all="ignore"): > result = ops.arithmetic_op(lvalues, rvalues, op) /usr/lib64/python3.11/site-packages/pandas/core/base.py:1325: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ left = ['106751 days 23:47:16.854775807'] Length: 1, dtype: timedelta64[ns] right = Timestamp('2000-01-01 00:00:00'), op = def arithmetic_op(left: ArrayLike, right: Any, op): """ Evaluate an arithmetic operation `+`, `-`, `*`, `/`, `//`, `%`, `**`, ... Note: the caller is responsible for ensuring that numpy warnings are suppressed (with np.errstate(all="ignore")) if needed. Parameters ---------- left : np.ndarray or ExtensionArray right : object Cannot be a DataFrame or Index. Series is *not* excluded. op : {operator.add, operator.sub, ...} Or one of the reversed variants from roperator. Returns ------- ndarray or ExtensionArray Or a 2-tuple of these in the case of divmod or rdivmod. """ # NB: We assume that extract_array and ensure_wrapped_if_datetimelike # have already been called on `left` and `right`, # and `maybe_prepare_scalar_for_op` has already been called on `right` # We need to special-case datetime64/timedelta64 dtypes (e.g. because numpy # casts integer dtypes to timedelta64 when operating with timedelta64 - GH#22390) if ( should_extension_dispatch(left, right) or isinstance(right, (Timedelta, BaseOffset, Timestamp)) or right is NaT ): # Timedelta/Timestamp and other custom scalars are included in the check # because numexpr will fail on it, see GH#31457 > res_values = op(left, right) /usr/lib64/python3.11/site-packages/pandas/core/ops/array_ops.py:218: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = ['106751 days 23:47:16.854775807'] Length: 1, dtype: timedelta64[ns] other = Timestamp('2000-01-01 00:00:00') @wraps(method) def new_method(self, other): if is_cmp and isinstance(self, ABCIndex) and isinstance(other, ABCSeries): # For comparison ops, Index does *not* defer to Series pass else: for cls in [ABCDataFrame, ABCSeries, ABCIndex]: if isinstance(self, cls): break if isinstance(other, cls): return NotImplemented other = item_from_zerodim(other) > return method(self, other) /usr/lib64/python3.11/site-packages/pandas/core/ops/common.py:72: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = ['106751 days 23:47:16.854775807'] Length: 1, dtype: timedelta64[ns] other = Timestamp('2000-01-01 00:00:00') @unpack_zerodim_and_defer("__add__") def __add__(self, other): other_dtype = getattr(other, "dtype", None) # scalar others if other is NaT: result = self._add_nat() elif isinstance(other, (Tick, timedelta, np.timedelta64)): result = self._add_timedeltalike_scalar(other) elif isinstance(other, BaseOffset): # specifically _not_ a Tick result = self._add_offset(other) elif isinstance(other, (datetime, np.datetime64)): > result = self._add_datetimelike_scalar(other) /usr/lib64/python3.11/site-packages/pandas/core/arrays/datetimelike.py:1441: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = ['106751 days 23:47:16.854775807'] Length: 1, dtype: timedelta64[ns] other = Timestamp('2000-01-01 00:00:00') @final def _add_datetimelike_scalar(self, other) -> DatetimeArray: if not is_timedelta64_dtype(self.dtype): raise TypeError( f"cannot add {type(self).__name__} and {type(other).__name__}" ) self = cast("TimedeltaArray", self) from pandas.core.arrays import DatetimeArray from pandas.core.arrays.datetimes import tz_to_dtype assert other is not NaT other = Timestamp(other) if other is NaT: # In this case we specifically interpret NaT as a datetime, not # the timedelta interpretation we would get by returning self + NaT result = self._ndarray + NaT.to_datetime64().astype(f"M8[{self._unit}]") # Preserve our resolution return DatetimeArray._simple_new(result, dtype=result.dtype) if self._reso != other._reso: raise NotImplementedError( "Addition between TimedeltaArray and Timestamp with mis-matched " "resolutions is not yet supported." ) i8 = self.asi8 > result = checked_add_with_arr(i8, other.value, arr_mask=self._isnan) /usr/lib64/python3.11/site-packages/pandas/core/arrays/datetimelike.py:1142: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ arr = array([9223372036854775807]), b = 946684800000000000 arr_mask = array([False]), b_mask = None def checked_add_with_arr( arr: npt.NDArray[np.int64], b: int | npt.NDArray[np.int64], arr_mask: npt.NDArray[np.bool_] | None = None, b_mask: npt.NDArray[np.bool_] | None = None, ) -> npt.NDArray[np.int64]: """ Perform array addition that checks for underflow and overflow. Performs the addition of an int64 array and an int64 integer (or array) but checks that they do not result in overflow first. For elements that are indicated to be NaN, whether or not there is overflow for that element is automatically ignored. Parameters ---------- arr : np.ndarray[int64] addend. b : array or scalar addend. arr_mask : np.ndarray[bool] or None, default None array indicating which elements to exclude from checking b_mask : np.ndarray[bool] or None, default None array or scalar indicating which element(s) to exclude from checking Returns ------- sum : An array for elements x + b for each element x in arr if b is a scalar or an array for elements x + y for each element pair (x, y) in (arr, b). Raises ------ OverflowError if any x + y exceeds the maximum or minimum int64 value. """ # For performance reasons, we broadcast 'b' to the new array 'b2' # so that it has the same size as 'arr'. b2 = np.broadcast_to(b, arr.shape) if b_mask is not None: # We do the same broadcasting for b_mask as well. b2_mask = np.broadcast_to(b_mask, arr.shape) else: b2_mask = None # For elements that are NaN, regardless of their value, we should # ignore whether they overflow or not when doing the checked add. if arr_mask is not None and b2_mask is not None: not_nan = np.logical_not(arr_mask | b2_mask) elif arr_mask is not None: not_nan = np.logical_not(arr_mask) elif b_mask is not None: # error: Argument 1 to "__call__" of "_UFunc_Nin1_Nout1" has # incompatible type "Optional[ndarray[Any, dtype[bool_]]]"; # expected "Union[_SupportsArray[dtype[Any]], _NestedSequence # [_SupportsArray[dtype[Any]]], bool, int, float, complex, str # , bytes, _NestedSequence[Union[bool, int, float, complex, str # , bytes]]]" not_nan = np.logical_not(b2_mask) # type: ignore[arg-type] else: not_nan = np.empty(arr.shape, dtype=bool) not_nan.fill(True) # gh-14324: For each element in 'arr' and its corresponding element # in 'b2', we check the sign of the element in 'b2'. If it is positive, # we then check whether its sum with the element in 'arr' exceeds # np.iinfo(np.int64).max. If so, we have an overflow error. If it # it is negative, we then check whether its sum with the element in # 'arr' exceeds np.iinfo(np.int64).min. If so, we have an overflow # error as well. i8max = lib.i8max i8min = iNaT mask1 = b2 > 0 mask2 = b2 < 0 if not mask1.any(): to_raise = ((i8min - b2 > arr) & not_nan).any() elif not mask2.any(): to_raise = ((i8max - b2 < arr) & not_nan).any() else: to_raise = ((i8max - b2[mask1] < arr[mask1]) & not_nan[mask1]).any() or ( (i8min - b2[mask2] > arr[mask2]) & not_nan[mask2] ).any() if to_raise: > raise OverflowError("Overflow in int64 addition") E OverflowError: Overflow in int64 addition /usr/lib64/python3.11/site-packages/pandas/core/algorithms.py:1249: OverflowError During handling of the above exception, another exception occurred: num_dates = [nan], units = 'days since 2000-01-01', expected_list = ['NaT'] @arm_xfail @requires_cftime @pytest.mark.parametrize( ["num_dates", "units", "expected_list"], [ ([np.nan], "days since 2000-01-01", ["NaT"]), ([np.nan, 0], "days since 2000-01-01", ["NaT", "2000-01-01T00:00:00Z"]), ( [np.nan, 0, 1], "days since 2000-01-01", ["NaT", "2000-01-01T00:00:00Z", "2000-01-02T00:00:00Z"], ), ], ) def test_cf_datetime_nan(num_dates, units, expected_list) -> None: with warnings.catch_warnings(): warnings.filterwarnings("ignore", "All-NaN") > actual = coding.times.decode_cf_datetime(num_dates, units) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_coding_times.py:494: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:292: in decode_cf_datetime dates[np.nanargmin(num_dates)].year < 1678 <__array_function__ internals>:200: in nanargmin ??? _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ a = array([inf]), axis = None, out = None @array_function_dispatch(_nanargmin_dispatcher) def nanargmin(a, axis=None, out=None, *, keepdims=np._NoValue): """ Return the indices of the minimum values in the specified axis ignoring NaNs. For all-NaN slices ``ValueError`` is raised. Warning: the results cannot be trusted if a slice contains only NaNs and Infs. Parameters ---------- a : array_like Input data. axis : int, optional Axis along which to operate. By default flattened input is used. out : array, optional If provided, the result will be inserted into this array. It should be of the appropriate shape and dtype. .. versionadded:: 1.22.0 keepdims : bool, optional If this is set to True, the axes which are reduced are left in the result as dimensions with size one. With this option, the result will broadcast correctly against the array. .. versionadded:: 1.22.0 Returns ------- index_array : ndarray An array of indices or a single index value. See Also -------- argmin, nanargmax Examples -------- >>> a = np.array([[np.nan, 4], [2, 3]]) >>> np.argmin(a) 0 >>> np.nanargmin(a) 2 >>> np.nanargmin(a, axis=0) array([1, 1]) >>> np.nanargmin(a, axis=1) array([1, 0]) """ a, mask = _replace_nan(a, np.inf) if mask is not None: mask = np.all(mask, axis=axis) if np.any(mask): > raise ValueError("All-NaN slice encountered") E ValueError: All-NaN slice encountered /usr/lib64/python3.11/site-packages/numpy/lib/nanfunctions.py:552: ValueError __________ TestZarrDirectoryStore.test_roundtrip_numpy_datetime_data ___________ [gw1] linux -- Python 3.11.4 /usr/bin/python3 num_dates = array([ 0., nan]), units = 'days since 2000-01-01 00:00:00' calendar = 'proleptic_gregorian', use_cftime = None def decode_cf_datetime( num_dates, units: str, calendar: str | None = None, use_cftime: bool | None = None ) -> np.ndarray: """Given an array of numeric dates in netCDF format, convert it into a numpy array of date time objects. For standard (Gregorian) calendars, this function uses vectorized operations, which makes it much faster than cftime.num2date. In such a case, the returned array will be of type np.datetime64. Note that time unit in `units` must not be smaller than microseconds and not larger than days. See Also -------- cftime.num2date """ num_dates = np.asarray(num_dates) flat_num_dates = num_dates.ravel() if calendar is None: calendar = "standard" if use_cftime is None: try: > dates = _decode_datetime_with_pandas(flat_num_dates, units, calendar) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:285: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ flat_num_dates = array([ 0., nan]), units = 'days since 2000-01-01 00:00:00' calendar = 'proleptic_gregorian' def _decode_datetime_with_pandas( flat_num_dates: np.ndarray, units: str, calendar: str ) -> np.ndarray: if not _is_standard_calendar(calendar): raise OutOfBoundsDatetime( "Cannot decode times from a non-standard calendar, {!r}, using " "pandas.".format(calendar) ) delta, ref_date = _unpack_netcdf_time_units(units) delta = _netcdf_to_numpy_timeunit(delta) try: ref_date = pd.Timestamp(ref_date) except ValueError: # ValueError is raised by pd.Timestamp for non-ISO timestamp # strings, in which case we fall back to using cftime raise OutOfBoundsDatetime with warnings.catch_warnings(): warnings.filterwarnings("ignore", "invalid value encountered", RuntimeWarning) if flat_num_dates.size > 0: # avoid size 0 datetimes GH1329 pd.to_timedelta(flat_num_dates.min(), delta) + ref_date pd.to_timedelta(flat_num_dates.max(), delta) + ref_date # To avoid integer overflow when converting to nanosecond units for integer # dtypes smaller than np.int64 cast all integer and unsigned integer dtype # arrays to np.int64 (GH 2002, GH 6589). Note this is safe even in the case # of np.uint64 values, because any np.uint64 value that would lead to # overflow when converting to np.int64 would not be representable with a # timedelta64 value, and therefore would raise an error in the lines above. if flat_num_dates.dtype.kind in "iu": flat_num_dates = flat_num_dates.astype(np.int64) # Cast input ordinals to integers of nanoseconds because pd.to_timedelta # works much faster when dealing with integers (GH 1399). flat_num_dates_ns_int = (flat_num_dates * _NS_PER_TIME_DELTA[delta]).astype( np.int64 ) # Use pd.to_timedelta to safely cast integer values to timedeltas, # and add those to a Timestamp to safely produce a DatetimeIndex. This # ensures that we do not encounter integer overflow at any point in the # process without raising OutOfBoundsDatetime. > return (pd.to_timedelta(flat_num_dates_ns_int, "ns") + ref_date).values /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:258: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['0 days 00:00:00', '106751 days 23:47:16.854775807'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00') @wraps(method) def new_method(self, other): if is_cmp and isinstance(self, ABCIndex) and isinstance(other, ABCSeries): # For comparison ops, Index does *not* defer to Series pass else: for cls in [ABCDataFrame, ABCSeries, ABCIndex]: if isinstance(self, cls): break if isinstance(other, cls): return NotImplemented other = item_from_zerodim(other) > return method(self, other) /usr/lib64/python3.11/site-packages/pandas/core/ops/common.py:72: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['0 days 00:00:00', '106751 days 23:47:16.854775807'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00') @unpack_zerodim_and_defer("__add__") def __add__(self, other): > return self._arith_method(other, operator.add) /usr/lib64/python3.11/site-packages/pandas/core/arraylike.py:102: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['0 days 00:00:00', '106751 days 23:47:16.854775807'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00'), op = def _arith_method(self, other, op): if ( isinstance(other, Index) and is_object_dtype(other.dtype) and type(other) is not Index ): # We return NotImplemented for object-dtype index *subclasses* so they have # a chance to implement ops before we unwrap them. # See https://github.com/pandas-dev/pandas/issues/31109 return NotImplemented > return super()._arith_method(other, op) /usr/lib64/python3.11/site-packages/pandas/core/indexes/base.py:7007: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['0 days 00:00:00', '106751 days 23:47:16.854775807'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00'), op = def _arith_method(self, other, op): res_name = ops.get_op_result_name(self, other) lvalues = self._values rvalues = extract_array(other, extract_numpy=True, extract_range=True) rvalues = ops.maybe_prepare_scalar_for_op(rvalues, lvalues.shape) rvalues = ensure_wrapped_if_datetimelike(rvalues) with np.errstate(all="ignore"): > result = ops.arithmetic_op(lvalues, rvalues, op) /usr/lib64/python3.11/site-packages/pandas/core/base.py:1325: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ left = ['0 days 00:00:00', '106751 days 23:47:16.854775807'] Length: 2, dtype: timedelta64[ns] right = Timestamp('2000-01-01 00:00:00'), op = def arithmetic_op(left: ArrayLike, right: Any, op): """ Evaluate an arithmetic operation `+`, `-`, `*`, `/`, `//`, `%`, `**`, ... Note: the caller is responsible for ensuring that numpy warnings are suppressed (with np.errstate(all="ignore")) if needed. Parameters ---------- left : np.ndarray or ExtensionArray right : object Cannot be a DataFrame or Index. Series is *not* excluded. op : {operator.add, operator.sub, ...} Or one of the reversed variants from roperator. Returns ------- ndarray or ExtensionArray Or a 2-tuple of these in the case of divmod or rdivmod. """ # NB: We assume that extract_array and ensure_wrapped_if_datetimelike # have already been called on `left` and `right`, # and `maybe_prepare_scalar_for_op` has already been called on `right` # We need to special-case datetime64/timedelta64 dtypes (e.g. because numpy # casts integer dtypes to timedelta64 when operating with timedelta64 - GH#22390) if ( should_extension_dispatch(left, right) or isinstance(right, (Timedelta, BaseOffset, Timestamp)) or right is NaT ): # Timedelta/Timestamp and other custom scalars are included in the check # because numexpr will fail on it, see GH#31457 > res_values = op(left, right) /usr/lib64/python3.11/site-packages/pandas/core/ops/array_ops.py:218: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = ['0 days 00:00:00', '106751 days 23:47:16.854775807'] Length: 2, dtype: timedelta64[ns] other = Timestamp('2000-01-01 00:00:00') @wraps(method) def new_method(self, other): if is_cmp and isinstance(self, ABCIndex) and isinstance(other, ABCSeries): # For comparison ops, Index does *not* defer to Series pass else: for cls in [ABCDataFrame, ABCSeries, ABCIndex]: if isinstance(self, cls): break if isinstance(other, cls): return NotImplemented other = item_from_zerodim(other) > return method(self, other) /usr/lib64/python3.11/site-packages/pandas/core/ops/common.py:72: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = ['0 days 00:00:00', '106751 days 23:47:16.854775807'] Length: 2, dtype: timedelta64[ns] other = Timestamp('2000-01-01 00:00:00') @unpack_zerodim_and_defer("__add__") def __add__(self, other): other_dtype = getattr(other, "dtype", None) # scalar others if other is NaT: result = self._add_nat() elif isinstance(other, (Tick, timedelta, np.timedelta64)): result = self._add_timedeltalike_scalar(other) elif isinstance(other, BaseOffset): # specifically _not_ a Tick result = self._add_offset(other) elif isinstance(other, (datetime, np.datetime64)): > result = self._add_datetimelike_scalar(other) /usr/lib64/python3.11/site-packages/pandas/core/arrays/datetimelike.py:1441: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = ['0 days 00:00:00', '106751 days 23:47:16.854775807'] Length: 2, dtype: timedelta64[ns] other = Timestamp('2000-01-01 00:00:00') @final def _add_datetimelike_scalar(self, other) -> DatetimeArray: if not is_timedelta64_dtype(self.dtype): raise TypeError( f"cannot add {type(self).__name__} and {type(other).__name__}" ) self = cast("TimedeltaArray", self) from pandas.core.arrays import DatetimeArray from pandas.core.arrays.datetimes import tz_to_dtype assert other is not NaT other = Timestamp(other) if other is NaT: # In this case we specifically interpret NaT as a datetime, not # the timedelta interpretation we would get by returning self + NaT result = self._ndarray + NaT.to_datetime64().astype(f"M8[{self._unit}]") # Preserve our resolution return DatetimeArray._simple_new(result, dtype=result.dtype) if self._reso != other._reso: raise NotImplementedError( "Addition between TimedeltaArray and Timestamp with mis-matched " "resolutions is not yet supported." ) i8 = self.asi8 > result = checked_add_with_arr(i8, other.value, arr_mask=self._isnan) /usr/lib64/python3.11/site-packages/pandas/core/arrays/datetimelike.py:1142: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ arr = array([ 0, 9223372036854775807]), b = 946684800000000000 arr_mask = array([False, False]), b_mask = None def checked_add_with_arr( arr: npt.NDArray[np.int64], b: int | npt.NDArray[np.int64], arr_mask: npt.NDArray[np.bool_] | None = None, b_mask: npt.NDArray[np.bool_] | None = None, ) -> npt.NDArray[np.int64]: """ Perform array addition that checks for underflow and overflow. Performs the addition of an int64 array and an int64 integer (or array) but checks that they do not result in overflow first. For elements that are indicated to be NaN, whether or not there is overflow for that element is automatically ignored. Parameters ---------- arr : np.ndarray[int64] addend. b : array or scalar addend. arr_mask : np.ndarray[bool] or None, default None array indicating which elements to exclude from checking b_mask : np.ndarray[bool] or None, default None array or scalar indicating which element(s) to exclude from checking Returns ------- sum : An array for elements x + b for each element x in arr if b is a scalar or an array for elements x + y for each element pair (x, y) in (arr, b). Raises ------ OverflowError if any x + y exceeds the maximum or minimum int64 value. """ # For performance reasons, we broadcast 'b' to the new array 'b2' # so that it has the same size as 'arr'. b2 = np.broadcast_to(b, arr.shape) if b_mask is not None: # We do the same broadcasting for b_mask as well. b2_mask = np.broadcast_to(b_mask, arr.shape) else: b2_mask = None # For elements that are NaN, regardless of their value, we should # ignore whether they overflow or not when doing the checked add. if arr_mask is not None and b2_mask is not None: not_nan = np.logical_not(arr_mask | b2_mask) elif arr_mask is not None: not_nan = np.logical_not(arr_mask) elif b_mask is not None: # error: Argument 1 to "__call__" of "_UFunc_Nin1_Nout1" has # incompatible type "Optional[ndarray[Any, dtype[bool_]]]"; # expected "Union[_SupportsArray[dtype[Any]], _NestedSequence # [_SupportsArray[dtype[Any]]], bool, int, float, complex, str # , bytes, _NestedSequence[Union[bool, int, float, complex, str # , bytes]]]" not_nan = np.logical_not(b2_mask) # type: ignore[arg-type] else: not_nan = np.empty(arr.shape, dtype=bool) not_nan.fill(True) # gh-14324: For each element in 'arr' and its corresponding element # in 'b2', we check the sign of the element in 'b2'. If it is positive, # we then check whether its sum with the element in 'arr' exceeds # np.iinfo(np.int64).max. If so, we have an overflow error. If it # it is negative, we then check whether its sum with the element in # 'arr' exceeds np.iinfo(np.int64).min. If so, we have an overflow # error as well. i8max = lib.i8max i8min = iNaT mask1 = b2 > 0 mask2 = b2 < 0 if not mask1.any(): to_raise = ((i8min - b2 > arr) & not_nan).any() elif not mask2.any(): to_raise = ((i8max - b2 < arr) & not_nan).any() else: to_raise = ((i8max - b2[mask1] < arr[mask1]) & not_nan[mask1]).any() or ( (i8min - b2[mask2] > arr[mask2]) & not_nan[mask2] ).any() if to_raise: > raise OverflowError("Overflow in int64 addition") E OverflowError: Overflow in int64 addition /usr/lib64/python3.11/site-packages/pandas/core/algorithms.py:1249: OverflowError During handling of the above exception, another exception occurred: times = array([cftime.DatetimeProlepticGregorian(2000, 1, 1, 0, 0, 0, 0, has_year_zero=True), cftime.DatetimeProlepticGregorian(294277, 1, 9, 4, 0, 54, 775807, has_year_zero=True)], dtype=object) raise_on_invalid = True def cftime_to_nptime(times, raise_on_invalid: bool = True) -> np.ndarray: """Given an array of cftime.datetime objects, return an array of numpy.datetime64 objects of the same size If raise_on_invalid is True (default), invalid dates trigger a ValueError. Otherwise, the invalid element is replaced by np.NaT.""" times = np.asarray(times) new = np.empty(times.shape, dtype="M8[ns]") for i, t in np.ndenumerate(times): try: # Use pandas.Timestamp in place of datetime.datetime, because # NumPy casts it safely it np.datetime64[ns] for dates outside # 1678 to 2262 (this is not currently the case for # datetime.datetime). > dt = pd.Timestamp( t.year, t.month, t.day, t.hour, t.minute, t.second, t.microsecond ) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:448: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > ??? E ValueError: year 294277 is out of range pandas/_libs/tslibs/timestamps.pyx:1673: ValueError During handling of the above exception, another exception occurred: data = LazilyIndexedArray(array=, key=BasicIndexer((slice(None, None, None),))) units = 'days since 2000-01-01 00:00:00', calendar = 'proleptic_gregorian' use_cftime = None def _decode_cf_datetime_dtype( data, units: str, calendar: str, use_cftime: bool | None ) -> np.dtype: # Verify that at least the first and last date can be decoded # successfully. Otherwise, tracebacks end up swallowed by # Dataset.__repr__ when users try to view their lazily decoded array. values = indexing.ImplicitToExplicitIndexingAdapter(indexing.as_indexable(data)) example_value = np.concatenate( [first_n_items(values, 1) or [0], last_item(values) or [0]] ) try: > result = decode_cf_datetime(example_value, units, calendar, use_cftime) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:184: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ num_dates = array([ 0., nan]), units = 'days since 2000-01-01 00:00:00' calendar = 'proleptic_gregorian', use_cftime = None def decode_cf_datetime( num_dates, units: str, calendar: str | None = None, use_cftime: bool | None = None ) -> np.ndarray: """Given an array of numeric dates in netCDF format, convert it into a numpy array of date time objects. For standard (Gregorian) calendars, this function uses vectorized operations, which makes it much faster than cftime.num2date. In such a case, the returned array will be of type np.datetime64. Note that time unit in `units` must not be smaller than microseconds and not larger than days. See Also -------- cftime.num2date """ num_dates = np.asarray(num_dates) flat_num_dates = num_dates.ravel() if calendar is None: calendar = "standard" if use_cftime is None: try: dates = _decode_datetime_with_pandas(flat_num_dates, units, calendar) except (KeyError, OutOfBoundsDatetime, OutOfBoundsTimedelta, OverflowError): dates = _decode_datetime_with_cftime( flat_num_dates.astype(float), units, calendar ) if ( dates[np.nanargmin(num_dates)].year < 1678 or dates[np.nanargmax(num_dates)].year >= 2262 ): if _is_standard_calendar(calendar): warnings.warn( "Unable to decode time axis into full " "numpy.datetime64 objects, continuing using " "cftime.datetime objects instead, reason: dates out " "of range", SerializationWarning, stacklevel=3, ) else: if _is_standard_calendar(calendar): > dates = cftime_to_nptime(dates) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:306: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ times = array([cftime.DatetimeProlepticGregorian(2000, 1, 1, 0, 0, 0, 0, has_year_zero=True), cftime.DatetimeProlepticGregorian(294277, 1, 9, 4, 0, 54, 775807, has_year_zero=True)], dtype=object) raise_on_invalid = True def cftime_to_nptime(times, raise_on_invalid: bool = True) -> np.ndarray: """Given an array of cftime.datetime objects, return an array of numpy.datetime64 objects of the same size If raise_on_invalid is True (default), invalid dates trigger a ValueError. Otherwise, the invalid element is replaced by np.NaT.""" times = np.asarray(times) new = np.empty(times.shape, dtype="M8[ns]") for i, t in np.ndenumerate(times): try: # Use pandas.Timestamp in place of datetime.datetime, because # NumPy casts it safely it np.datetime64[ns] for dates outside # 1678 to 2262 (this is not currently the case for # datetime.datetime). dt = pd.Timestamp( t.year, t.month, t.day, t.hour, t.minute, t.second, t.microsecond ) except ValueError as e: if raise_on_invalid: > raise ValueError( "Cannot convert date {} to a date in the " "standard calendar. Reason: {}.".format(t, e) ) E ValueError: Cannot convert date 294277-01-09 04:00:54 to a date in the standard calendar. Reason: year 294277 is out of range. /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:453: ValueError During handling of the above exception, another exception occurred: variables = Frozen({'t': [3 values with dtype=float64] Attributes: calendar: proleptic_gregorian ...e ()> [1 values with dtype=int64] Attributes: calendar: proleptic_gregorian units: days since 1950-01-01}) attributes = Frozen({}), concat_characters = True, mask_and_scale = True decode_times = True, decode_coords = True, drop_variables = set() use_cftime = None, decode_timedelta = None def decode_cf_variables( variables: T_Variables, attributes: T_Attrs, concat_characters: bool = True, mask_and_scale: bool = True, decode_times: bool = True, decode_coords: bool = True, drop_variables: T_DropVariables = None, use_cftime: bool | None = None, decode_timedelta: bool | None = None, ) -> tuple[T_Variables, T_Attrs, set[Hashable]]: """ Decode several CF encoded variables. See: decode_cf_variable """ dimensions_used_by = defaultdict(list) for v in variables.values(): for d in v.dims: dimensions_used_by[d].append(v) def stackable(dim: Hashable) -> bool: # figure out if a dimension can be concatenated over if dim in variables: return False for v in dimensions_used_by[dim]: if v.dtype.kind != "S" or dim != v.dims[-1]: return False return True coord_names = set() if isinstance(drop_variables, str): drop_variables = [drop_variables] elif drop_variables is None: drop_variables = [] drop_variables = set(drop_variables) # Time bounds coordinates might miss the decoding attributes if decode_times: _update_bounds_attributes(variables) new_vars = {} for k, v in variables.items(): if k in drop_variables: continue stack_char_dim = ( concat_characters and v.dtype == "S1" and v.ndim > 0 and stackable(v.dims[-1]) ) try: > new_vars[k] = decode_cf_variable( k, v, concat_characters=concat_characters, mask_and_scale=mask_and_scale, decode_times=decode_times, stack_char_dim=stack_char_dim, use_cftime=use_cftime, decode_timedelta=decode_timedelta, ) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/conventions.py:551: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ name = 't' var = [3 values with dtype=float64] Attributes: calendar: proleptic_gregorian units: days since 2000-01-01 00:00:00 concat_characters = True, mask_and_scale = True, decode_times = True decode_endianness = True, stack_char_dim = False, use_cftime = None decode_timedelta = True def decode_cf_variable( name: Hashable, var: Variable, concat_characters: bool = True, mask_and_scale: bool = True, decode_times: bool = True, decode_endianness: bool = True, stack_char_dim: bool = True, use_cftime: bool | None = None, decode_timedelta: bool | None = None, ) -> Variable: """ Decodes a variable which may hold CF encoded information. This includes variables that have been masked and scaled, which hold CF style time variables (this is almost always the case if the dataset has been serialized) and which have strings encoded as character arrays. Parameters ---------- name : str Name of the variable. Used for better error messages. var : Variable A variable holding potentially CF encoded information. concat_characters : bool Should character arrays be concatenated to strings, for example: ["h", "e", "l", "l", "o"] -> "hello" mask_and_scale : bool Lazily scale (using scale_factor and add_offset) and mask (using _FillValue). If the _Unsigned attribute is present treat integer arrays as unsigned. decode_times : bool Decode cf times ("hours since 2000-01-01") to np.datetime64. decode_endianness : bool Decode arrays from non-native to native endianness. stack_char_dim : bool Whether to stack characters into bytes along the last dimension of this array. Passed as an argument because we need to look at the full dataset to figure out if this is appropriate. use_cftime : bool, optional Only relevant if encoded dates come from a standard calendar (e.g. "gregorian", "proleptic_gregorian", "standard", or not specified). If None (default), attempt to decode times to ``np.datetime64[ns]`` objects; if this is not possible, decode times to ``cftime.datetime`` objects. If True, always decode times to ``cftime.datetime`` objects, regardless of whether or not they can be represented using ``np.datetime64[ns]`` objects. If False, always decode times to ``np.datetime64[ns]`` objects; if this is not possible raise an error. Returns ------- out : Variable A variable holding the decoded equivalent of var. """ # Ensure datetime-like Variables are passed through unmodified (GH 6453) if _contains_datetime_like_objects(var): return var original_dtype = var.dtype if decode_timedelta is None: decode_timedelta = decode_times if concat_characters: if stack_char_dim: var = strings.CharacterArrayCoder().decode(var, name=name) var = strings.EncodedStringCoder().decode(var) if mask_and_scale: for coder in [ variables.UnsignedIntegerCoder(), variables.CFMaskCoder(), variables.CFScaleOffsetCoder(), ]: var = coder.decode(var, name=name) if decode_timedelta: var = times.CFTimedeltaCoder().decode(var, name=name) if decode_times: > var = times.CFDatetimeCoder(use_cftime=use_cftime).decode(var, name=name) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/conventions.py:397: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = variable = [3 values with dtype=float64] Attributes: calendar: proleptic_gregorian units: days since 2000-01-01 00:00:00 name = 't' def decode(self, variable: Variable, name: T_Name = None) -> Variable: units = variable.attrs.get("units", None) if isinstance(units, str) and "since" in units: dims, data, attrs, encoding = unpack_for_decoding(variable) units = pop_to(attrs, encoding, "units") calendar = pop_to(attrs, encoding, "calendar") > dtype = _decode_cf_datetime_dtype(data, units, calendar, self.use_cftime) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:716: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ data = LazilyIndexedArray(array=, key=BasicIndexer((slice(None, None, None),))) units = 'days since 2000-01-01 00:00:00', calendar = 'proleptic_gregorian' use_cftime = None def _decode_cf_datetime_dtype( data, units: str, calendar: str, use_cftime: bool | None ) -> np.dtype: # Verify that at least the first and last date can be decoded # successfully. Otherwise, tracebacks end up swallowed by # Dataset.__repr__ when users try to view their lazily decoded array. values = indexing.ImplicitToExplicitIndexingAdapter(indexing.as_indexable(data)) example_value = np.concatenate( [first_n_items(values, 1) or [0], last_item(values) or [0]] ) try: result = decode_cf_datetime(example_value, units, calendar, use_cftime) except Exception: calendar_msg = ( "the default calendar" if calendar is None else f"calendar {calendar!r}" ) msg = ( f"unable to decode time units {units!r} with {calendar_msg!r}. Try " "opening your dataset with decode_times=False or installing cftime " "if it is not installed." ) > raise ValueError(msg) E ValueError: unable to decode time units 'days since 2000-01-01 00:00:00' with "calendar 'proleptic_gregorian'". Try opening your dataset with decode_times=False or installing cftime if it is not installed. /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:194: ValueError During handling of the above exception, another exception occurred: self = @arm_xfail def test_roundtrip_numpy_datetime_data(self) -> None: times = pd.to_datetime(["2000-01-01", "2000-01-02", "NaT"]) expected = Dataset({"t": ("t", times), "t0": times[0]}) kwargs = {"encoding": {"t0": {"units": "days since 1950-01-01"}}} > with self.roundtrip(expected, save_kwargs=kwargs) as actual: /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:535: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.11/contextlib.py:137: in __enter__ return next(self.gen) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1788: in roundtrip with self.open(store_target, **open_kwargs) as ds: /usr/lib64/python3.11/contextlib.py:137: in __enter__ return next(self.gen) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1773: in open with xr.open_dataset( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/backends/api.py:541: in open_dataset backend_ds = backend.open_dataset( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/backends/zarr.py:902: in open_dataset ds = store_entrypoint.open_dataset( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/backends/store.py:35: in open_dataset vars, attrs, coord_names = conventions.decode_cf_variables( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ variables = Frozen({'t': [3 values with dtype=float64] Attributes: calendar: proleptic_gregorian ...e ()> [1 values with dtype=int64] Attributes: calendar: proleptic_gregorian units: days since 1950-01-01}) attributes = Frozen({}), concat_characters = True, mask_and_scale = True decode_times = True, decode_coords = True, drop_variables = set() use_cftime = None, decode_timedelta = None def decode_cf_variables( variables: T_Variables, attributes: T_Attrs, concat_characters: bool = True, mask_and_scale: bool = True, decode_times: bool = True, decode_coords: bool = True, drop_variables: T_DropVariables = None, use_cftime: bool | None = None, decode_timedelta: bool | None = None, ) -> tuple[T_Variables, T_Attrs, set[Hashable]]: """ Decode several CF encoded variables. See: decode_cf_variable """ dimensions_used_by = defaultdict(list) for v in variables.values(): for d in v.dims: dimensions_used_by[d].append(v) def stackable(dim: Hashable) -> bool: # figure out if a dimension can be concatenated over if dim in variables: return False for v in dimensions_used_by[dim]: if v.dtype.kind != "S" or dim != v.dims[-1]: return False return True coord_names = set() if isinstance(drop_variables, str): drop_variables = [drop_variables] elif drop_variables is None: drop_variables = [] drop_variables = set(drop_variables) # Time bounds coordinates might miss the decoding attributes if decode_times: _update_bounds_attributes(variables) new_vars = {} for k, v in variables.items(): if k in drop_variables: continue stack_char_dim = ( concat_characters and v.dtype == "S1" and v.ndim > 0 and stackable(v.dims[-1]) ) try: new_vars[k] = decode_cf_variable( k, v, concat_characters=concat_characters, mask_and_scale=mask_and_scale, decode_times=decode_times, stack_char_dim=stack_char_dim, use_cftime=use_cftime, decode_timedelta=decode_timedelta, ) except Exception as e: > raise type(e)(f"Failed to decode variable {k!r}: {e}") E ValueError: Failed to decode variable 't': unable to decode time units 'days since 2000-01-01 00:00:00' with "calendar 'proleptic_gregorian'". Try opening your dataset with decode_times=False or installing cftime if it is not installed. /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/conventions.py:562: ValueError ____ test_cf_datetime_nan[num_dates1-days since 2000-01-01-expected_list1] _____ [gw5] linux -- Python 3.11.4 /usr/bin/python3 num_dates = array([nan, 0.]), units = 'days since 2000-01-01' calendar = 'standard', use_cftime = None def decode_cf_datetime( num_dates, units: str, calendar: str | None = None, use_cftime: bool | None = None ) -> np.ndarray: """Given an array of numeric dates in netCDF format, convert it into a numpy array of date time objects. For standard (Gregorian) calendars, this function uses vectorized operations, which makes it much faster than cftime.num2date. In such a case, the returned array will be of type np.datetime64. Note that time unit in `units` must not be smaller than microseconds and not larger than days. See Also -------- cftime.num2date """ num_dates = np.asarray(num_dates) flat_num_dates = num_dates.ravel() if calendar is None: calendar = "standard" if use_cftime is None: try: > dates = _decode_datetime_with_pandas(flat_num_dates, units, calendar) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:285: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ flat_num_dates = array([nan, 0.]), units = 'days since 2000-01-01' calendar = 'standard' def _decode_datetime_with_pandas( flat_num_dates: np.ndarray, units: str, calendar: str ) -> np.ndarray: if not _is_standard_calendar(calendar): raise OutOfBoundsDatetime( "Cannot decode times from a non-standard calendar, {!r}, using " "pandas.".format(calendar) ) delta, ref_date = _unpack_netcdf_time_units(units) delta = _netcdf_to_numpy_timeunit(delta) try: ref_date = pd.Timestamp(ref_date) except ValueError: # ValueError is raised by pd.Timestamp for non-ISO timestamp # strings, in which case we fall back to using cftime raise OutOfBoundsDatetime with warnings.catch_warnings(): warnings.filterwarnings("ignore", "invalid value encountered", RuntimeWarning) if flat_num_dates.size > 0: # avoid size 0 datetimes GH1329 pd.to_timedelta(flat_num_dates.min(), delta) + ref_date pd.to_timedelta(flat_num_dates.max(), delta) + ref_date # To avoid integer overflow when converting to nanosecond units for integer # dtypes smaller than np.int64 cast all integer and unsigned integer dtype # arrays to np.int64 (GH 2002, GH 6589). Note this is safe even in the case # of np.uint64 values, because any np.uint64 value that would lead to # overflow when converting to np.int64 would not be representable with a # timedelta64 value, and therefore would raise an error in the lines above. if flat_num_dates.dtype.kind in "iu": flat_num_dates = flat_num_dates.astype(np.int64) # Cast input ordinals to integers of nanoseconds because pd.to_timedelta # works much faster when dealing with integers (GH 1399). flat_num_dates_ns_int = (flat_num_dates * _NS_PER_TIME_DELTA[delta]).astype( np.int64 ) # Use pd.to_timedelta to safely cast integer values to timedeltas, # and add those to a Timestamp to safely produce a DatetimeIndex. This # ensures that we do not encounter integer overflow at any point in the # process without raising OutOfBoundsDatetime. > return (pd.to_timedelta(flat_num_dates_ns_int, "ns") + ref_date).values /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:258: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['106751 days 23:47:16.854775807', '0 days 00:00:00'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00') @wraps(method) def new_method(self, other): if is_cmp and isinstance(self, ABCIndex) and isinstance(other, ABCSeries): # For comparison ops, Index does *not* defer to Series pass else: for cls in [ABCDataFrame, ABCSeries, ABCIndex]: if isinstance(self, cls): break if isinstance(other, cls): return NotImplemented other = item_from_zerodim(other) > return method(self, other) /usr/lib64/python3.11/site-packages/pandas/core/ops/common.py:72: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['106751 days 23:47:16.854775807', '0 days 00:00:00'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00') @unpack_zerodim_and_defer("__add__") def __add__(self, other): > return self._arith_method(other, operator.add) /usr/lib64/python3.11/site-packages/pandas/core/arraylike.py:102: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['106751 days 23:47:16.854775807', '0 days 00:00:00'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00'), op = def _arith_method(self, other, op): if ( isinstance(other, Index) and is_object_dtype(other.dtype) and type(other) is not Index ): # We return NotImplemented for object-dtype index *subclasses* so they have # a chance to implement ops before we unwrap them. # See https://github.com/pandas-dev/pandas/issues/31109 return NotImplemented > return super()._arith_method(other, op) /usr/lib64/python3.11/site-packages/pandas/core/indexes/base.py:7007: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['106751 days 23:47:16.854775807', '0 days 00:00:00'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00'), op = def _arith_method(self, other, op): res_name = ops.get_op_result_name(self, other) lvalues = self._values rvalues = extract_array(other, extract_numpy=True, extract_range=True) rvalues = ops.maybe_prepare_scalar_for_op(rvalues, lvalues.shape) rvalues = ensure_wrapped_if_datetimelike(rvalues) with np.errstate(all="ignore"): > result = ops.arithmetic_op(lvalues, rvalues, op) /usr/lib64/python3.11/site-packages/pandas/core/base.py:1325: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ left = ['106751 days 23:47:16.854775807', '0 days 00:00:00'] Length: 2, dtype: timedelta64[ns] right = Timestamp('2000-01-01 00:00:00'), op = def arithmetic_op(left: ArrayLike, right: Any, op): """ Evaluate an arithmetic operation `+`, `-`, `*`, `/`, `//`, `%`, `**`, ... Note: the caller is responsible for ensuring that numpy warnings are suppressed (with np.errstate(all="ignore")) if needed. Parameters ---------- left : np.ndarray or ExtensionArray right : object Cannot be a DataFrame or Index. Series is *not* excluded. op : {operator.add, operator.sub, ...} Or one of the reversed variants from roperator. Returns ------- ndarray or ExtensionArray Or a 2-tuple of these in the case of divmod or rdivmod. """ # NB: We assume that extract_array and ensure_wrapped_if_datetimelike # have already been called on `left` and `right`, # and `maybe_prepare_scalar_for_op` has already been called on `right` # We need to special-case datetime64/timedelta64 dtypes (e.g. because numpy # casts integer dtypes to timedelta64 when operating with timedelta64 - GH#22390) if ( should_extension_dispatch(left, right) or isinstance(right, (Timedelta, BaseOffset, Timestamp)) or right is NaT ): # Timedelta/Timestamp and other custom scalars are included in the check # because numexpr will fail on it, see GH#31457 > res_values = op(left, right) /usr/lib64/python3.11/site-packages/pandas/core/ops/array_ops.py:218: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = ['106751 days 23:47:16.854775807', '0 days 00:00:00'] Length: 2, dtype: timedelta64[ns] other = Timestamp('2000-01-01 00:00:00') @wraps(method) def new_method(self, other): if is_cmp and isinstance(self, ABCIndex) and isinstance(other, ABCSeries): # For comparison ops, Index does *not* defer to Series pass else: for cls in [ABCDataFrame, ABCSeries, ABCIndex]: if isinstance(self, cls): break if isinstance(other, cls): return NotImplemented other = item_from_zerodim(other) > return method(self, other) /usr/lib64/python3.11/site-packages/pandas/core/ops/common.py:72: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = ['106751 days 23:47:16.854775807', '0 days 00:00:00'] Length: 2, dtype: timedelta64[ns] other = Timestamp('2000-01-01 00:00:00') @unpack_zerodim_and_defer("__add__") def __add__(self, other): other_dtype = getattr(other, "dtype", None) # scalar others if other is NaT: result = self._add_nat() elif isinstance(other, (Tick, timedelta, np.timedelta64)): result = self._add_timedeltalike_scalar(other) elif isinstance(other, BaseOffset): # specifically _not_ a Tick result = self._add_offset(other) elif isinstance(other, (datetime, np.datetime64)): > result = self._add_datetimelike_scalar(other) /usr/lib64/python3.11/site-packages/pandas/core/arrays/datetimelike.py:1441: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = ['106751 days 23:47:16.854775807', '0 days 00:00:00'] Length: 2, dtype: timedelta64[ns] other = Timestamp('2000-01-01 00:00:00') @final def _add_datetimelike_scalar(self, other) -> DatetimeArray: if not is_timedelta64_dtype(self.dtype): raise TypeError( f"cannot add {type(self).__name__} and {type(other).__name__}" ) self = cast("TimedeltaArray", self) from pandas.core.arrays import DatetimeArray from pandas.core.arrays.datetimes import tz_to_dtype assert other is not NaT other = Timestamp(other) if other is NaT: # In this case we specifically interpret NaT as a datetime, not # the timedelta interpretation we would get by returning self + NaT result = self._ndarray + NaT.to_datetime64().astype(f"M8[{self._unit}]") # Preserve our resolution return DatetimeArray._simple_new(result, dtype=result.dtype) if self._reso != other._reso: raise NotImplementedError( "Addition between TimedeltaArray and Timestamp with mis-matched " "resolutions is not yet supported." ) i8 = self.asi8 > result = checked_add_with_arr(i8, other.value, arr_mask=self._isnan) /usr/lib64/python3.11/site-packages/pandas/core/arrays/datetimelike.py:1142: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ arr = array([9223372036854775807, 0]), b = 946684800000000000 arr_mask = array([False, False]), b_mask = None def checked_add_with_arr( arr: npt.NDArray[np.int64], b: int | npt.NDArray[np.int64], arr_mask: npt.NDArray[np.bool_] | None = None, b_mask: npt.NDArray[np.bool_] | None = None, ) -> npt.NDArray[np.int64]: """ Perform array addition that checks for underflow and overflow. Performs the addition of an int64 array and an int64 integer (or array) but checks that they do not result in overflow first. For elements that are indicated to be NaN, whether or not there is overflow for that element is automatically ignored. Parameters ---------- arr : np.ndarray[int64] addend. b : array or scalar addend. arr_mask : np.ndarray[bool] or None, default None array indicating which elements to exclude from checking b_mask : np.ndarray[bool] or None, default None array or scalar indicating which element(s) to exclude from checking Returns ------- sum : An array for elements x + b for each element x in arr if b is a scalar or an array for elements x + y for each element pair (x, y) in (arr, b). Raises ------ OverflowError if any x + y exceeds the maximum or minimum int64 value. """ # For performance reasons, we broadcast 'b' to the new array 'b2' # so that it has the same size as 'arr'. b2 = np.broadcast_to(b, arr.shape) if b_mask is not None: # We do the same broadcasting for b_mask as well. b2_mask = np.broadcast_to(b_mask, arr.shape) else: b2_mask = None # For elements that are NaN, regardless of their value, we should # ignore whether they overflow or not when doing the checked add. if arr_mask is not None and b2_mask is not None: not_nan = np.logical_not(arr_mask | b2_mask) elif arr_mask is not None: not_nan = np.logical_not(arr_mask) elif b_mask is not None: # error: Argument 1 to "__call__" of "_UFunc_Nin1_Nout1" has # incompatible type "Optional[ndarray[Any, dtype[bool_]]]"; # expected "Union[_SupportsArray[dtype[Any]], _NestedSequence # [_SupportsArray[dtype[Any]]], bool, int, float, complex, str # , bytes, _NestedSequence[Union[bool, int, float, complex, str # , bytes]]]" not_nan = np.logical_not(b2_mask) # type: ignore[arg-type] else: not_nan = np.empty(arr.shape, dtype=bool) not_nan.fill(True) # gh-14324: For each element in 'arr' and its corresponding element # in 'b2', we check the sign of the element in 'b2'. If it is positive, # we then check whether its sum with the element in 'arr' exceeds # np.iinfo(np.int64).max. If so, we have an overflow error. If it # it is negative, we then check whether its sum with the element in # 'arr' exceeds np.iinfo(np.int64).min. If so, we have an overflow # error as well. i8max = lib.i8max i8min = iNaT mask1 = b2 > 0 mask2 = b2 < 0 if not mask1.any(): to_raise = ((i8min - b2 > arr) & not_nan).any() elif not mask2.any(): to_raise = ((i8max - b2 < arr) & not_nan).any() else: to_raise = ((i8max - b2[mask1] < arr[mask1]) & not_nan[mask1]).any() or ( (i8min - b2[mask2] > arr[mask2]) & not_nan[mask2] ).any() if to_raise: > raise OverflowError("Overflow in int64 addition") E OverflowError: Overflow in int64 addition /usr/lib64/python3.11/site-packages/pandas/core/algorithms.py:1249: OverflowError During handling of the above exception, another exception occurred: times = array([cftime.DatetimeGregorian(294277, 1, 9, 4, 0, 54, 775807, has_year_zero=False), cftime.DatetimeGregorian(2000, 1, 1, 0, 0, 0, 0, has_year_zero=False)], dtype=object) raise_on_invalid = True def cftime_to_nptime(times, raise_on_invalid: bool = True) -> np.ndarray: """Given an array of cftime.datetime objects, return an array of numpy.datetime64 objects of the same size If raise_on_invalid is True (default), invalid dates trigger a ValueError. Otherwise, the invalid element is replaced by np.NaT.""" times = np.asarray(times) new = np.empty(times.shape, dtype="M8[ns]") for i, t in np.ndenumerate(times): try: # Use pandas.Timestamp in place of datetime.datetime, because # NumPy casts it safely it np.datetime64[ns] for dates outside # 1678 to 2262 (this is not currently the case for # datetime.datetime). > dt = pd.Timestamp( t.year, t.month, t.day, t.hour, t.minute, t.second, t.microsecond ) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:448: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > ??? E ValueError: year 294277 is out of range pandas/_libs/tslibs/timestamps.pyx:1673: ValueError During handling of the above exception, another exception occurred: num_dates = [nan, 0], units = 'days since 2000-01-01' expected_list = ['NaT', '2000-01-01T00:00:00Z'] @arm_xfail @requires_cftime @pytest.mark.parametrize( ["num_dates", "units", "expected_list"], [ ([np.nan], "days since 2000-01-01", ["NaT"]), ([np.nan, 0], "days since 2000-01-01", ["NaT", "2000-01-01T00:00:00Z"]), ( [np.nan, 0, 1], "days since 2000-01-01", ["NaT", "2000-01-01T00:00:00Z", "2000-01-02T00:00:00Z"], ), ], ) def test_cf_datetime_nan(num_dates, units, expected_list) -> None: with warnings.catch_warnings(): warnings.filterwarnings("ignore", "All-NaN") > actual = coding.times.decode_cf_datetime(num_dates, units) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_coding_times.py:494: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:306: in decode_cf_datetime dates = cftime_to_nptime(dates) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ times = array([cftime.DatetimeGregorian(294277, 1, 9, 4, 0, 54, 775807, has_year_zero=False), cftime.DatetimeGregorian(2000, 1, 1, 0, 0, 0, 0, has_year_zero=False)], dtype=object) raise_on_invalid = True def cftime_to_nptime(times, raise_on_invalid: bool = True) -> np.ndarray: """Given an array of cftime.datetime objects, return an array of numpy.datetime64 objects of the same size If raise_on_invalid is True (default), invalid dates trigger a ValueError. Otherwise, the invalid element is replaced by np.NaT.""" times = np.asarray(times) new = np.empty(times.shape, dtype="M8[ns]") for i, t in np.ndenumerate(times): try: # Use pandas.Timestamp in place of datetime.datetime, because # NumPy casts it safely it np.datetime64[ns] for dates outside # 1678 to 2262 (this is not currently the case for # datetime.datetime). dt = pd.Timestamp( t.year, t.month, t.day, t.hour, t.minute, t.second, t.microsecond ) except ValueError as e: if raise_on_invalid: > raise ValueError( "Cannot convert date {} to a date in the " "standard calendar. Reason: {}.".format(t, e) ) E ValueError: Cannot convert date 294277-01-09 04:00:54 to a date in the standard calendar. Reason: year 294277 is out of range. /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:453: ValueError ____ test_cf_datetime_nan[num_dates2-days since 2000-01-01-expected_list2] _____ [gw5] linux -- Python 3.11.4 /usr/bin/python3 num_dates = array([nan, 0., 1.]), units = 'days since 2000-01-01' calendar = 'standard', use_cftime = None def decode_cf_datetime( num_dates, units: str, calendar: str | None = None, use_cftime: bool | None = None ) -> np.ndarray: """Given an array of numeric dates in netCDF format, convert it into a numpy array of date time objects. For standard (Gregorian) calendars, this function uses vectorized operations, which makes it much faster than cftime.num2date. In such a case, the returned array will be of type np.datetime64. Note that time unit in `units` must not be smaller than microseconds and not larger than days. See Also -------- cftime.num2date """ num_dates = np.asarray(num_dates) flat_num_dates = num_dates.ravel() if calendar is None: calendar = "standard" if use_cftime is None: try: > dates = _decode_datetime_with_pandas(flat_num_dates, units, calendar) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:285: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ flat_num_dates = array([nan, 0., 1.]), units = 'days since 2000-01-01' calendar = 'standard' def _decode_datetime_with_pandas( flat_num_dates: np.ndarray, units: str, calendar: str ) -> np.ndarray: if not _is_standard_calendar(calendar): raise OutOfBoundsDatetime( "Cannot decode times from a non-standard calendar, {!r}, using " "pandas.".format(calendar) ) delta, ref_date = _unpack_netcdf_time_units(units) delta = _netcdf_to_numpy_timeunit(delta) try: ref_date = pd.Timestamp(ref_date) except ValueError: # ValueError is raised by pd.Timestamp for non-ISO timestamp # strings, in which case we fall back to using cftime raise OutOfBoundsDatetime with warnings.catch_warnings(): warnings.filterwarnings("ignore", "invalid value encountered", RuntimeWarning) if flat_num_dates.size > 0: # avoid size 0 datetimes GH1329 pd.to_timedelta(flat_num_dates.min(), delta) + ref_date pd.to_timedelta(flat_num_dates.max(), delta) + ref_date # To avoid integer overflow when converting to nanosecond units for integer # dtypes smaller than np.int64 cast all integer and unsigned integer dtype # arrays to np.int64 (GH 2002, GH 6589). Note this is safe even in the case # of np.uint64 values, because any np.uint64 value that would lead to # overflow when converting to np.int64 would not be representable with a # timedelta64 value, and therefore would raise an error in the lines above. if flat_num_dates.dtype.kind in "iu": flat_num_dates = flat_num_dates.astype(np.int64) # Cast input ordinals to integers of nanoseconds because pd.to_timedelta # works much faster when dealing with integers (GH 1399). flat_num_dates_ns_int = (flat_num_dates * _NS_PER_TIME_DELTA[delta]).astype( np.int64 ) # Use pd.to_timedelta to safely cast integer values to timedeltas, # and add those to a Timestamp to safely produce a DatetimeIndex. This # ensures that we do not encounter integer overflow at any point in the # process without raising OutOfBoundsDatetime. > return (pd.to_timedelta(flat_num_dates_ns_int, "ns") + ref_date).values /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:258: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['106751 days 23:47:16.854775807', '0 days 00:00:00', '1 days 00:00:00'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00') @wraps(method) def new_method(self, other): if is_cmp and isinstance(self, ABCIndex) and isinstance(other, ABCSeries): # For comparison ops, Index does *not* defer to Series pass else: for cls in [ABCDataFrame, ABCSeries, ABCIndex]: if isinstance(self, cls): break if isinstance(other, cls): return NotImplemented other = item_from_zerodim(other) > return method(self, other) /usr/lib64/python3.11/site-packages/pandas/core/ops/common.py:72: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['106751 days 23:47:16.854775807', '0 days 00:00:00', '1 days 00:00:00'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00') @unpack_zerodim_and_defer("__add__") def __add__(self, other): > return self._arith_method(other, operator.add) /usr/lib64/python3.11/site-packages/pandas/core/arraylike.py:102: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['106751 days 23:47:16.854775807', '0 days 00:00:00', '1 days 00:00:00'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00'), op = def _arith_method(self, other, op): if ( isinstance(other, Index) and is_object_dtype(other.dtype) and type(other) is not Index ): # We return NotImplemented for object-dtype index *subclasses* so they have # a chance to implement ops before we unwrap them. # See https://github.com/pandas-dev/pandas/issues/31109 return NotImplemented > return super()._arith_method(other, op) /usr/lib64/python3.11/site-packages/pandas/core/indexes/base.py:7007: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = TimedeltaIndex(['106751 days 23:47:16.854775807', '0 days 00:00:00', '1 days 00:00:00'], dtype='timedelta64[ns]', freq=None) other = Timestamp('2000-01-01 00:00:00'), op = def _arith_method(self, other, op): res_name = ops.get_op_result_name(self, other) lvalues = self._values rvalues = extract_array(other, extract_numpy=True, extract_range=True) rvalues = ops.maybe_prepare_scalar_for_op(rvalues, lvalues.shape) rvalues = ensure_wrapped_if_datetimelike(rvalues) with np.errstate(all="ignore"): > result = ops.arithmetic_op(lvalues, rvalues, op) /usr/lib64/python3.11/site-packages/pandas/core/base.py:1325: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ left = ['106751 days 23:47:16.854775807', '0 days 00:00:00', '1 days 00:00:00'] Length: 3, dtype: timedelta64[ns] right = Timestamp('2000-01-01 00:00:00'), op = def arithmetic_op(left: ArrayLike, right: Any, op): """ Evaluate an arithmetic operation `+`, `-`, `*`, `/`, `//`, `%`, `**`, ... Note: the caller is responsible for ensuring that numpy warnings are suppressed (with np.errstate(all="ignore")) if needed. Parameters ---------- left : np.ndarray or ExtensionArray right : object Cannot be a DataFrame or Index. Series is *not* excluded. op : {operator.add, operator.sub, ...} Or one of the reversed variants from roperator. Returns ------- ndarray or ExtensionArray Or a 2-tuple of these in the case of divmod or rdivmod. """ # NB: We assume that extract_array and ensure_wrapped_if_datetimelike # have already been called on `left` and `right`, # and `maybe_prepare_scalar_for_op` has already been called on `right` # We need to special-case datetime64/timedelta64 dtypes (e.g. because numpy # casts integer dtypes to timedelta64 when operating with timedelta64 - GH#22390) if ( should_extension_dispatch(left, right) or isinstance(right, (Timedelta, BaseOffset, Timestamp)) or right is NaT ): # Timedelta/Timestamp and other custom scalars are included in the check # because numexpr will fail on it, see GH#31457 > res_values = op(left, right) /usr/lib64/python3.11/site-packages/pandas/core/ops/array_ops.py:218: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = ['106751 days 23:47:16.854775807', '0 days 00:00:00', '1 days 00:00:00'] Length: 3, dtype: timedelta64[ns] other = Timestamp('2000-01-01 00:00:00') @wraps(method) def new_method(self, other): if is_cmp and isinstance(self, ABCIndex) and isinstance(other, ABCSeries): # For comparison ops, Index does *not* defer to Series pass else: for cls in [ABCDataFrame, ABCSeries, ABCIndex]: if isinstance(self, cls): break if isinstance(other, cls): return NotImplemented other = item_from_zerodim(other) > return method(self, other) /usr/lib64/python3.11/site-packages/pandas/core/ops/common.py:72: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = ['106751 days 23:47:16.854775807', '0 days 00:00:00', '1 days 00:00:00'] Length: 3, dtype: timedelta64[ns] other = Timestamp('2000-01-01 00:00:00') @unpack_zerodim_and_defer("__add__") def __add__(self, other): other_dtype = getattr(other, "dtype", None) # scalar others if other is NaT: result = self._add_nat() elif isinstance(other, (Tick, timedelta, np.timedelta64)): result = self._add_timedeltalike_scalar(other) elif isinstance(other, BaseOffset): # specifically _not_ a Tick result = self._add_offset(other) elif isinstance(other, (datetime, np.datetime64)): > result = self._add_datetimelike_scalar(other) /usr/lib64/python3.11/site-packages/pandas/core/arrays/datetimelike.py:1441: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = ['106751 days 23:47:16.854775807', '0 days 00:00:00', '1 days 00:00:00'] Length: 3, dtype: timedelta64[ns] other = Timestamp('2000-01-01 00:00:00') @final def _add_datetimelike_scalar(self, other) -> DatetimeArray: if not is_timedelta64_dtype(self.dtype): raise TypeError( f"cannot add {type(self).__name__} and {type(other).__name__}" ) self = cast("TimedeltaArray", self) from pandas.core.arrays import DatetimeArray from pandas.core.arrays.datetimes import tz_to_dtype assert other is not NaT other = Timestamp(other) if other is NaT: # In this case we specifically interpret NaT as a datetime, not # the timedelta interpretation we would get by returning self + NaT result = self._ndarray + NaT.to_datetime64().astype(f"M8[{self._unit}]") # Preserve our resolution return DatetimeArray._simple_new(result, dtype=result.dtype) if self._reso != other._reso: raise NotImplementedError( "Addition between TimedeltaArray and Timestamp with mis-matched " "resolutions is not yet supported." ) i8 = self.asi8 > result = checked_add_with_arr(i8, other.value, arr_mask=self._isnan) /usr/lib64/python3.11/site-packages/pandas/core/arrays/datetimelike.py:1142: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ arr = array([9223372036854775807, 0, 86400000000000]) b = 946684800000000000, arr_mask = array([False, False, False]), b_mask = None def checked_add_with_arr( arr: npt.NDArray[np.int64], b: int | npt.NDArray[np.int64], arr_mask: npt.NDArray[np.bool_] | None = None, b_mask: npt.NDArray[np.bool_] | None = None, ) -> npt.NDArray[np.int64]: """ Perform array addition that checks for underflow and overflow. Performs the addition of an int64 array and an int64 integer (or array) but checks that they do not result in overflow first. For elements that are indicated to be NaN, whether or not there is overflow for that element is automatically ignored. Parameters ---------- arr : np.ndarray[int64] addend. b : array or scalar addend. arr_mask : np.ndarray[bool] or None, default None array indicating which elements to exclude from checking b_mask : np.ndarray[bool] or None, default None array or scalar indicating which element(s) to exclude from checking Returns ------- sum : An array for elements x + b for each element x in arr if b is a scalar or an array for elements x + y for each element pair (x, y) in (arr, b). Raises ------ OverflowError if any x + y exceeds the maximum or minimum int64 value. """ # For performance reasons, we broadcast 'b' to the new array 'b2' # so that it has the same size as 'arr'. b2 = np.broadcast_to(b, arr.shape) if b_mask is not None: # We do the same broadcasting for b_mask as well. b2_mask = np.broadcast_to(b_mask, arr.shape) else: b2_mask = None # For elements that are NaN, regardless of their value, we should # ignore whether they overflow or not when doing the checked add. if arr_mask is not None and b2_mask is not None: not_nan = np.logical_not(arr_mask | b2_mask) elif arr_mask is not None: not_nan = np.logical_not(arr_mask) elif b_mask is not None: # error: Argument 1 to "__call__" of "_UFunc_Nin1_Nout1" has # incompatible type "Optional[ndarray[Any, dtype[bool_]]]"; # expected "Union[_SupportsArray[dtype[Any]], _NestedSequence # [_SupportsArray[dtype[Any]]], bool, int, float, complex, str # , bytes, _NestedSequence[Union[bool, int, float, complex, str # , bytes]]]" not_nan = np.logical_not(b2_mask) # type: ignore[arg-type] else: not_nan = np.empty(arr.shape, dtype=bool) not_nan.fill(True) # gh-14324: For each element in 'arr' and its corresponding element # in 'b2', we check the sign of the element in 'b2'. If it is positive, # we then check whether its sum with the element in 'arr' exceeds # np.iinfo(np.int64).max. If so, we have an overflow error. If it # it is negative, we then check whether its sum with the element in # 'arr' exceeds np.iinfo(np.int64).min. If so, we have an overflow # error as well. i8max = lib.i8max i8min = iNaT mask1 = b2 > 0 mask2 = b2 < 0 if not mask1.any(): to_raise = ((i8min - b2 > arr) & not_nan).any() elif not mask2.any(): to_raise = ((i8max - b2 < arr) & not_nan).any() else: to_raise = ((i8max - b2[mask1] < arr[mask1]) & not_nan[mask1]).any() or ( (i8min - b2[mask2] > arr[mask2]) & not_nan[mask2] ).any() if to_raise: > raise OverflowError("Overflow in int64 addition") E OverflowError: Overflow in int64 addition /usr/lib64/python3.11/site-packages/pandas/core/algorithms.py:1249: OverflowError During handling of the above exception, another exception occurred: times = array([cftime.DatetimeGregorian(294277, 1, 9, 4, 0, 54, 775807, has_year_zero=False), cftime.DatetimeGregorian(...as_year_zero=False), cftime.DatetimeGregorian(2000, 1, 2, 0, 0, 0, 0, has_year_zero=False)], dtype=object) raise_on_invalid = True def cftime_to_nptime(times, raise_on_invalid: bool = True) -> np.ndarray: """Given an array of cftime.datetime objects, return an array of numpy.datetime64 objects of the same size If raise_on_invalid is True (default), invalid dates trigger a ValueError. Otherwise, the invalid element is replaced by np.NaT.""" times = np.asarray(times) new = np.empty(times.shape, dtype="M8[ns]") for i, t in np.ndenumerate(times): try: # Use pandas.Timestamp in place of datetime.datetime, because # NumPy casts it safely it np.datetime64[ns] for dates outside # 1678 to 2262 (this is not currently the case for # datetime.datetime). > dt = pd.Timestamp( t.year, t.month, t.day, t.hour, t.minute, t.second, t.microsecond ) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:448: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > ??? E ValueError: year 294277 is out of range pandas/_libs/tslibs/timestamps.pyx:1673: ValueError During handling of the above exception, another exception occurred: num_dates = [nan, 0, 1], units = 'days since 2000-01-01' expected_list = ['NaT', '2000-01-01T00:00:00Z', '2000-01-02T00:00:00Z'] @arm_xfail @requires_cftime @pytest.mark.parametrize( ["num_dates", "units", "expected_list"], [ ([np.nan], "days since 2000-01-01", ["NaT"]), ([np.nan, 0], "days since 2000-01-01", ["NaT", "2000-01-01T00:00:00Z"]), ( [np.nan, 0, 1], "days since 2000-01-01", ["NaT", "2000-01-01T00:00:00Z", "2000-01-02T00:00:00Z"], ), ], ) def test_cf_datetime_nan(num_dates, units, expected_list) -> None: with warnings.catch_warnings(): warnings.filterwarnings("ignore", "All-NaN") > actual = coding.times.decode_cf_datetime(num_dates, units) /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_coding_times.py:494: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:306: in decode_cf_datetime dates = cftime_to_nptime(dates) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ times = array([cftime.DatetimeGregorian(294277, 1, 9, 4, 0, 54, 775807, has_year_zero=False), cftime.DatetimeGregorian(...as_year_zero=False), cftime.DatetimeGregorian(2000, 1, 2, 0, 0, 0, 0, has_year_zero=False)], dtype=object) raise_on_invalid = True def cftime_to_nptime(times, raise_on_invalid: bool = True) -> np.ndarray: """Given an array of cftime.datetime objects, return an array of numpy.datetime64 objects of the same size If raise_on_invalid is True (default), invalid dates trigger a ValueError. Otherwise, the invalid element is replaced by np.NaT.""" times = np.asarray(times) new = np.empty(times.shape, dtype="M8[ns]") for i, t in np.ndenumerate(times): try: # Use pandas.Timestamp in place of datetime.datetime, because # NumPy casts it safely it np.datetime64[ns] for dates outside # 1678 to 2262 (this is not currently the case for # datetime.datetime). dt = pd.Timestamp( t.year, t.month, t.day, t.hour, t.minute, t.second, t.microsecond ) except ValueError as e: if raise_on_invalid: > raise ValueError( "Cannot convert date {} to a date in the " "standard calendar. Reason: {}.".format(t, e) ) E ValueError: Cannot convert date 294277-01-09 04:00:54 to a date in the standard calendar. Reason: year 294277 is out of range. /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:453: ValueError _____ TestDataArrayRolling.test_rolling_reduce_nonnumeric[sum-1-None-True] _____ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = True, min_periods = None, window = 1, name = 'sum' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:24: in move_sum return move_func(np.nansum, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ____ TestDataArrayRolling.test_rolling_reduce_nonnumeric[sum-1-None-False] _____ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = False, min_periods = None, window = 1, name = 'sum' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:24: in move_sum return move_func(np.nansum, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ______ TestDataArrayRolling.test_rolling_reduce_nonnumeric[sum-1-1-True] _______ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = True, min_periods = 1, window = 1, name = 'sum' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:24: in move_sum return move_func(np.nansum, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ______ TestDataArrayRolling.test_rolling_reduce_nonnumeric[sum-1-1-False] ______ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = False, min_periods = 1, window = 1, name = 'sum' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:24: in move_sum return move_func(np.nansum, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ______ TestDataArrayRolling.test_rolling_reduce_nonnumeric[sum-1-2-True] _______ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = True, min_periods = 1, window = 1, name = 'sum' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:24: in move_sum return move_func(np.nansum, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ______ TestDataArrayRolling.test_rolling_reduce_nonnumeric[sum-1-2-False] ______ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = False, min_periods = 1, window = 1, name = 'sum' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:24: in move_sum return move_func(np.nansum, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ______ TestDataArrayRolling.test_rolling_reduce_nonnumeric[sum-1-3-True] _______ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = True, min_periods = 1, window = 1, name = 'sum' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:24: in move_sum return move_func(np.nansum, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ______ TestDataArrayRolling.test_rolling_reduce_nonnumeric[sum-1-3-False] ______ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = False, min_periods = 1, window = 1, name = 'sum' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:24: in move_sum return move_func(np.nansum, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError _____ TestDataArrayRolling.test_rolling_reduce_nonnumeric[sum-2-None-True] _____ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = True, min_periods = None, window = 2, name = 'sum' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:24: in move_sum return move_func(np.nansum, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ____ TestDataArrayRolling.test_rolling_reduce_nonnumeric[sum-2-None-False] _____ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = False, min_periods = None, window = 2, name = 'sum' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:24: in move_sum return move_func(np.nansum, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ______ TestDataArrayRolling.test_rolling_reduce_nonnumeric[sum-2-1-True] _______ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = True, min_periods = 1, window = 2, name = 'sum' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:24: in move_sum return move_func(np.nansum, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ______ TestDataArrayRolling.test_rolling_reduce_nonnumeric[sum-2-1-False] ______ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = False, min_periods = 1, window = 2, name = 'sum' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:24: in move_sum return move_func(np.nansum, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ______ TestDataArrayRolling.test_rolling_reduce_nonnumeric[sum-2-2-True] _______ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = True, min_periods = 2, window = 2, name = 'sum' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:24: in move_sum return move_func(np.nansum, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ______ TestDataArrayRolling.test_rolling_reduce_nonnumeric[sum-2-2-False] ______ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = False, min_periods = 2, window = 2, name = 'sum' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:24: in move_sum return move_func(np.nansum, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ______ TestDataArrayRolling.test_rolling_reduce_nonnumeric[sum-2-3-True] _______ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = True, min_periods = 2, window = 2, name = 'sum' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:24: in move_sum return move_func(np.nansum, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ______ TestDataArrayRolling.test_rolling_reduce_nonnumeric[sum-2-3-False] ______ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = False, min_periods = 2, window = 2, name = 'sum' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:24: in move_sum return move_func(np.nansum, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError _____ TestDataArrayRolling.test_rolling_reduce_nonnumeric[sum-3-None-True] _____ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = True, min_periods = None, window = 3, name = 'sum' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:24: in move_sum return move_func(np.nansum, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ____ TestDataArrayRolling.test_rolling_reduce_nonnumeric[sum-3-None-False] _____ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = False, min_periods = None, window = 3, name = 'sum' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:24: in move_sum return move_func(np.nansum, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ______ TestDataArrayRolling.test_rolling_reduce_nonnumeric[sum-3-1-True] _______ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = True, min_periods = 1, window = 3, name = 'sum' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:24: in move_sum return move_func(np.nansum, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ______ TestDataArrayRolling.test_rolling_reduce_nonnumeric[sum-3-1-False] ______ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = False, min_periods = 1, window = 3, name = 'sum' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:24: in move_sum return move_func(np.nansum, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ______ TestDataArrayRolling.test_rolling_reduce_nonnumeric[sum-3-2-True] _______ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = True, min_periods = 2, window = 3, name = 'sum' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:24: in move_sum return move_func(np.nansum, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ______ TestDataArrayRolling.test_rolling_reduce_nonnumeric[sum-3-2-False] ______ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = False, min_periods = 2, window = 3, name = 'sum' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:24: in move_sum return move_func(np.nansum, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ______ TestDataArrayRolling.test_rolling_reduce_nonnumeric[sum-3-3-True] _______ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = True, min_periods = 3, window = 3, name = 'sum' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:24: in move_sum return move_func(np.nansum, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ______ TestDataArrayRolling.test_rolling_reduce_nonnumeric[sum-3-3-False] ______ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = False, min_periods = 3, window = 3, name = 'sum' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:24: in move_sum return move_func(np.nansum, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError _____ TestDataArrayRolling.test_rolling_reduce_nonnumeric[sum-4-None-True] _____ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = True, min_periods = None, window = 4, name = 'sum' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:24: in move_sum return move_func(np.nansum, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ____ TestDataArrayRolling.test_rolling_reduce_nonnumeric[sum-4-None-False] _____ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = False, min_periods = None, window = 4, name = 'sum' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:24: in move_sum return move_func(np.nansum, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ______ TestDataArrayRolling.test_rolling_reduce_nonnumeric[sum-4-1-True] _______ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = True, min_periods = 1, window = 4, name = 'sum' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:24: in move_sum return move_func(np.nansum, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ______ TestDataArrayRolling.test_rolling_reduce_nonnumeric[sum-4-1-False] ______ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = False, min_periods = 1, window = 4, name = 'sum' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:24: in move_sum return move_func(np.nansum, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ______ TestDataArrayRolling.test_rolling_reduce_nonnumeric[sum-4-2-True] _______ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = True, min_periods = 2, window = 4, name = 'sum' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:24: in move_sum return move_func(np.nansum, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ______ TestDataArrayRolling.test_rolling_reduce_nonnumeric[sum-4-2-False] ______ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = False, min_periods = 2, window = 4, name = 'sum' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:24: in move_sum return move_func(np.nansum, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ______ TestDataArrayRolling.test_rolling_reduce_nonnumeric[sum-4-3-True] _______ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = True, min_periods = 3, window = 4, name = 'sum' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:24: in move_sum return move_func(np.nansum, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ______ TestDataArrayRolling.test_rolling_reduce_nonnumeric[sum-4-3-False] ______ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = False, min_periods = 3, window = 4, name = 'sum' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:24: in move_sum return move_func(np.nansum, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError _____ TestDataArrayRolling.test_rolling_reduce_nonnumeric[max-1-None-True] _____ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = True, min_periods = None, window = 1, name = 'max' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:49: in move_max return move_func(np.nanmax, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ____ TestDataArrayRolling.test_rolling_reduce_nonnumeric[max-1-None-False] _____ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = False, min_periods = None, window = 1, name = 'max' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:49: in move_max return move_func(np.nanmax, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ______ TestDataArrayRolling.test_rolling_reduce_nonnumeric[max-1-1-True] _______ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = True, min_periods = 1, window = 1, name = 'max' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:49: in move_max return move_func(np.nanmax, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ______ TestDataArrayRolling.test_rolling_reduce_nonnumeric[max-1-1-False] ______ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = False, min_periods = 1, window = 1, name = 'max' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:49: in move_max return move_func(np.nanmax, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ______ TestDataArrayRolling.test_rolling_reduce_nonnumeric[max-1-2-True] _______ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = True, min_periods = 1, window = 1, name = 'max' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:49: in move_max return move_func(np.nanmax, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ______ TestDataArrayRolling.test_rolling_reduce_nonnumeric[max-1-2-False] ______ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = False, min_periods = 1, window = 1, name = 'max' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:49: in move_max return move_func(np.nanmax, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ______ TestDataArrayRolling.test_rolling_reduce_nonnumeric[max-1-3-True] _______ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = True, min_periods = 1, window = 1, name = 'max' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:49: in move_max return move_func(np.nanmax, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ______ TestDataArrayRolling.test_rolling_reduce_nonnumeric[max-1-3-False] ______ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = False, min_periods = 1, window = 1, name = 'max' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:49: in move_max return move_func(np.nanmax, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError _____ TestDataArrayRolling.test_rolling_reduce_nonnumeric[max-2-None-True] _____ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = True, min_periods = None, window = 2, name = 'max' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:49: in move_max return move_func(np.nanmax, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ____ TestDataArrayRolling.test_rolling_reduce_nonnumeric[max-2-None-False] _____ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = False, min_periods = None, window = 2, name = 'max' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:49: in move_max return move_func(np.nanmax, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ______ TestDataArrayRolling.test_rolling_reduce_nonnumeric[max-2-1-True] _______ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = True, min_periods = 1, window = 2, name = 'max' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:49: in move_max return move_func(np.nanmax, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ______ TestDataArrayRolling.test_rolling_reduce_nonnumeric[max-2-1-False] ______ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = False, min_periods = 1, window = 2, name = 'max' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:49: in move_max return move_func(np.nanmax, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ______ TestDataArrayRolling.test_rolling_reduce_nonnumeric[max-2-2-True] _______ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = True, min_periods = 2, window = 2, name = 'max' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:49: in move_max return move_func(np.nanmax, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ______ TestDataArrayRolling.test_rolling_reduce_nonnumeric[max-2-2-False] ______ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = False, min_periods = 2, window = 2, name = 'max' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:49: in move_max return move_func(np.nanmax, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ______ TestDataArrayRolling.test_rolling_reduce_nonnumeric[max-2-3-True] _______ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = True, min_periods = 2, window = 2, name = 'max' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:49: in move_max return move_func(np.nanmax, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ______ TestDataArrayRolling.test_rolling_reduce_nonnumeric[max-2-3-False] ______ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = False, min_periods = 2, window = 2, name = 'max' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:49: in move_max return move_func(np.nanmax, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError _____ TestDataArrayRolling.test_rolling_reduce_nonnumeric[max-3-None-True] _____ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = True, min_periods = None, window = 3, name = 'max' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:49: in move_max return move_func(np.nanmax, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ____ TestDataArrayRolling.test_rolling_reduce_nonnumeric[max-3-None-False] _____ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = False, min_periods = None, window = 3, name = 'max' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:49: in move_max return move_func(np.nanmax, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ______ TestDataArrayRolling.test_rolling_reduce_nonnumeric[max-3-1-True] _______ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = True, min_periods = 1, window = 3, name = 'max' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:49: in move_max return move_func(np.nanmax, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ______ TestDataArrayRolling.test_rolling_reduce_nonnumeric[max-3-1-False] ______ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = False, min_periods = 1, window = 3, name = 'max' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:49: in move_max return move_func(np.nanmax, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ______ TestDataArrayRolling.test_rolling_reduce_nonnumeric[max-3-2-True] _______ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = True, min_periods = 2, window = 3, name = 'max' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:49: in move_max return move_func(np.nanmax, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ______ TestDataArrayRolling.test_rolling_reduce_nonnumeric[max-3-2-False] ______ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = False, min_periods = 2, window = 3, name = 'max' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:49: in move_max return move_func(np.nanmax, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ______ TestDataArrayRolling.test_rolling_reduce_nonnumeric[max-3-3-True] _______ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = True, min_periods = 3, window = 3, name = 'max' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:49: in move_max return move_func(np.nanmax, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ______ TestDataArrayRolling.test_rolling_reduce_nonnumeric[max-3-3-False] ______ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = False, min_periods = 3, window = 3, name = 'max' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:49: in move_max return move_func(np.nanmax, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError _____ TestDataArrayRolling.test_rolling_reduce_nonnumeric[max-4-None-True] _____ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = True, min_periods = None, window = 4, name = 'max' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:49: in move_max return move_func(np.nanmax, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ____ TestDataArrayRolling.test_rolling_reduce_nonnumeric[max-4-None-False] _____ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = False, min_periods = None, window = 4, name = 'max' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:49: in move_max return move_func(np.nanmax, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ______ TestDataArrayRolling.test_rolling_reduce_nonnumeric[max-4-1-True] _______ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = True, min_periods = 1, window = 4, name = 'max' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:49: in move_max return move_func(np.nanmax, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ______ TestDataArrayRolling.test_rolling_reduce_nonnumeric[max-4-1-False] ______ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = False, min_periods = 1, window = 4, name = 'max' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:49: in move_max return move_func(np.nanmax, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ______ TestDataArrayRolling.test_rolling_reduce_nonnumeric[max-4-2-True] _______ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = True, min_periods = 2, window = 4, name = 'max' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:49: in move_max return move_func(np.nanmax, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ______ TestDataArrayRolling.test_rolling_reduce_nonnumeric[max-4-2-False] ______ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = False, min_periods = 2, window = 4, name = 'max' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:49: in move_max return move_func(np.nanmax, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ______ TestDataArrayRolling.test_rolling_reduce_nonnumeric[max-4-3-True] _______ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = True, min_periods = 3, window = 4, name = 'max' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:49: in move_max return move_func(np.nanmax, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError ______ TestDataArrayRolling.test_rolling_reduce_nonnumeric[max-4-3-False] ______ [gw0] linux -- Python 3.11.4 /usr/bin/python3 self = center = False, min_periods = 3, window = 4, name = 'max' @pytest.mark.parametrize("center", (True, False)) @pytest.mark.parametrize("min_periods", (None, 1, 2, 3)) @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "max")) def test_rolling_reduce_nonnumeric(self, center, min_periods, window, name) -> None: da = DataArray( [0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time" ).isnull() if min_periods is not None and window < min_periods: min_periods = window rolling_obj = da.rolling(time=window, center=center, min_periods=min_periods) # add nan prefix to numpy methods to get similar behavior as bottleneck actual = rolling_obj.reduce(getattr(np, "nan%s" % name)) > expected = getattr(rolling_obj, name)() /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:155: in method return self._numpy_or_bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:578: in _numpy_or_bottleneck_reduce return self._bottleneck_reduce( /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/rolling.py:539: in _bottleneck_reduce values = func( /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:49: in move_max return move_func(np.nanmax, a, window, min_count, axis=axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:150: in move_func idx = _mask(a, window, mc, axis) /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: in _mask idx = np.empty(a.shape, dtype=np.bool) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attr = 'bool' def __getattr__(attr): # Warn for expired attributes, and return a dummy function # that always raises an exception. import warnings try: msg = __expired_functions__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) def _expired(*args, **kwds): raise RuntimeError(msg) return _expired # Emit warnings for deprecated attributes try: val, msg = __deprecated_attrs__[attr] except KeyError: pass else: warnings.warn(msg, DeprecationWarning, stacklevel=2) return val if attr in __future_scalars__: # And future warnings for those that will change, but also give # the AttributeError warnings.warn( f"In the future `np.{attr}` will be defined as the " "corresponding NumPy scalar.", FutureWarning, stacklevel=2) if attr in __former_attrs__: > raise AttributeError(__former_attrs__[attr]) E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations /usr/lib64/python3.11/site-packages/numpy/__init__.py:305: AttributeError =============================== warnings summary =============================== ../../../../usr/lib/python3.11/site-packages/seaborn/rcmod.py:82 ../../../../usr/lib/python3.11/site-packages/seaborn/rcmod.py:82 ../../../../usr/lib/python3.11/site-packages/seaborn/rcmod.py:82 ../../../../usr/lib/python3.11/site-packages/seaborn/rcmod.py:82 ../../../../usr/lib/python3.11/site-packages/seaborn/rcmod.py:82 ../../../../usr/lib/python3.11/site-packages/seaborn/rcmod.py:82 ../../../../usr/lib/python3.11/site-packages/seaborn/rcmod.py:82 ../../../../usr/lib/python3.11/site-packages/seaborn/rcmod.py:82 /usr/lib/python3.11/site-packages/seaborn/rcmod.py:82: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. if LooseVersion(mpl.__version__) >= "3.0": ../../../../usr/lib/python3.11/site-packages/setuptools/_distutils/version.py:346 ../../../../usr/lib/python3.11/site-packages/setuptools/_distutils/version.py:346 ../../../../usr/lib/python3.11/site-packages/setuptools/_distutils/version.py:346 ../../../../usr/lib/python3.11/site-packages/setuptools/_distutils/version.py:346 ../../../../usr/lib/python3.11/site-packages/setuptools/_distutils/version.py:346 ../../../../usr/lib/python3.11/site-packages/setuptools/_distutils/version.py:346 ../../../../usr/lib/python3.11/site-packages/setuptools/_distutils/version.py:346 ../../../../usr/lib/python3.11/site-packages/setuptools/_distutils/version.py:346 /usr/lib/python3.11/site-packages/setuptools/_distutils/version.py:346: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. other = LooseVersion(other) ../../../../usr/lib/python3.11/site-packages/seaborn/cm.py:1582: 48 warnings /usr/lib/python3.11/site-packages/seaborn/cm.py:1582: MatplotlibDeprecationWarning: The register_cmap function was deprecated in Matplotlib 3.7 and will be removed two minor releases later. Use ``matplotlib.colormaps.register(name)`` instead. mpl_cm.register_cmap(_name, _cmap) ../../../../usr/lib/python3.11/site-packages/seaborn/cm.py:1583: 48 warnings /usr/lib/python3.11/site-packages/seaborn/cm.py:1583: MatplotlibDeprecationWarning: The register_cmap function was deprecated in Matplotlib 3.7 and will be removed two minor releases later. Use ``matplotlib.colormaps.register(name)`` instead. mpl_cm.register_cmap(_name + "_r", _cmap_r) ../../../../usr/lib/python3.11/site-packages/pint/registry.py:539: 32 warnings tests/test_dask.py: 4 warnings tests/test_dataarray.py: 2 warnings tests/test_dataset.py: 2 warnings tests/test_units.py: 2 warnings tests/test_variable.py: 4 warnings /usr/lib/python3.11/site-packages/pint/registry.py:539: DeprecationWarning: read_binary is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice. rbytes = importlib_resources.read_binary(__package__, file) tests/test_backends.py: 30 warnings tests/test_conventions.py: 3 warnings /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/variables.py:172: DeprecationWarning: NumPy will stop allowing conversion of out-of-bound Python integers to integer arrays. The conversion of 255 to int8 will fail in the future. For the old behavior, usually: np.array(value).astype(dtype)` will give the desired result (the cast overflows). encoding["_FillValue"] = dtype.type(fv) tests/test_backends.py: 20 warnings tests/test_conventions.py: 2 warnings tests/test_coding_times.py: 3 warnings /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:613: RuntimeWarning: invalid value encountered in cast int_num = np.asarray(num, dtype=np.int64) tests/test_backends.py: 10 warnings tests/test_conventions.py: 1 warning tests/test_coding_times.py: 3 warnings /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:250: RuntimeWarning: invalid value encountered in cast flat_num_dates_ns_int = (flat_num_dates * _NS_PER_TIME_DELTA[delta]).astype( tests/test_backends.py: 10 warnings tests/test_conventions.py: 1 warning tests/test_coding_times.py: 3 warnings /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/times.py:208: RuntimeWarning: invalid value encountered in cast cftime.num2date(num_dates, units, calendar, only_use_cftime_datetimes=True) tests/test_backends.py: 10 warnings tests/test_conventions.py: 1 warning tests/test_coding_times.py: 10 warnings /usr/lib64/python3.11/site-packages/pandas/core/arrays/timedeltas.py:908: RuntimeWarning: invalid value encountered in cast base = data.astype(np.int64) tests/test_backends.py: 10 warnings tests/test_conventions.py: 1 warning tests/test_coding_times.py: 10 warnings /usr/lib64/python3.11/site-packages/pandas/core/arrays/timedeltas.py:912: RuntimeWarning: invalid value encountered in cast data = (base * m + (frac * m).astype(np.int64)).view("timedelta64[ns]") tests/test_cftime_offsets.py: 12 warnings tests/test_calendar_ops.py: 14 warnings tests/test_computation.py: 4 warnings /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/cftime_offsets.py:1134: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`. return pd.date_range( tests/test_backends.py::test_pickle_open_mfdataset_dataset /usr/lib/python3.11/site-packages/_pytest/python.py:195: RuntimeWarning: deallocating CachingFileManager(, '/builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/data/bears.nc', mode='r', kwargs={'clobber': True, 'diskless': False, 'persist': False, 'format': 'NETCDF4'}, manager_id='84a3c0b2-c91d-4fc3-8c79-60d2614f2840'), but file is not already closed. This may indicate a bug. result = testfunction(**testargs) tests/test_array_api.py::test_astype tests/test_dataset.py::TestDataset::test_unary_ops /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/duck_array_ops.py:187: RuntimeWarning: invalid value encountered in cast return data.astype(dtype, **kwargs) tests/test_array_api.py::test_astype /usr/lib64/python3.11/site-packages/numpy/array_api/_data_type_functions.py:20: RuntimeWarning: invalid value encountered in cast return Array._new(x._array.astype(dtype=dtype, copy=copy)) tests/test_conventions.py::TestCFEncodedDataStore::test_roundtrip_mask_and_scale[create_unsigned_masked_scaled_data-create_encoded_unsigned_masked_scaled_data] /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/coding/variables.py:330: DeprecationWarning: NumPy will stop allowing conversion of out-of-bound Python integers to integer arrays. The conversion of -1 to uint8 will fail in the future. For the old behavior, usually: np.array(value).astype(dtype)` will give the desired result (the cast overflows). new_fill = unsigned_dtype.type(attrs["_FillValue"]) tests/test_backends.py::TestDask::test_inline_array /usr/lib/python3.11/site-packages/_pytest/python.py:195: RuntimeWarning: deallocating CachingFileManager(, '/tmp/tmp7t_knu0f/temp-692.nc', mode='r', kwargs={'clobber': True, 'diskless': False, 'persist': False, 'format': 'NETCDF4'}, manager_id='edecc2f9-9207-4873-aa88-7a31332d4f11'), but file is not already closed. This may indicate a bug. result = testfunction(**testargs) tests/test_backends.py::TestDask::test_inline_array /usr/lib/python3.11/site-packages/_pytest/python.py:195: RuntimeWarning: deallocating CachingFileManager(, '/tmp/tmp7t_knu0f/temp-692.nc', mode='r', kwargs={'clobber': True, 'diskless': False, 'persist': False, 'format': 'NETCDF4'}, manager_id='7e88b05f-2bcd-430f-b6db-c38ef256835e'), but file is not already closed. This may indicate a bug. result = testfunction(**testargs) tests/test_backends.py::TestDask::test_inline_array /usr/lib/python3.11/site-packages/_pytest/python.py:195: RuntimeWarning: deallocating CachingFileManager(, '/tmp/tmp7t_knu0f/temp-692.nc', mode='r', kwargs={'clobber': True, 'diskless': False, 'persist': False, 'format': 'NETCDF4'}, manager_id='ff108960-d29b-4316-a749-bae0c550701b'), but file is not already closed. This may indicate a bug. result = testfunction(**testargs) tests/test_backends.py::TestDask::test_inline_array /usr/lib/python3.11/site-packages/_pytest/python.py:195: RuntimeWarning: deallocating CachingFileManager(, '/tmp/tmp7t_knu0f/temp-692.nc', mode='r', kwargs={'clobber': True, 'diskless': False, 'persist': False, 'format': 'NETCDF4'}, manager_id='5161ab8c-be45-4cc9-8840-cc5e5d0dc29b'), but file is not already closed. This may indicate a bug. result = testfunction(**testargs) tests/test_dask.py: 12 warnings tests/test_dataset.py: 7 warnings tests/test_dataarray.py: 5 warnings tests/test_groupby.py: 2 warnings tests/test_units.py: 12 warnings <__array_function__ internals>:200: RuntimeWarning: invalid value encountered in cast tests/test_dataset.py::TestDataset::test_assign_coords_existing_multiindex /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/common.py:615: FutureWarning: Updating MultiIndexed coordinate 'x' would corrupt indices for other variables: ['level_1', 'level_2']. This will raise an error in the future. Use `.drop_vars({'x', 'level_2', 'level_1'})` before assigning new coordinate values. data.coords.update(results) tests/test_formatting.py::test_lazy_array_wont_compute tests/test_formatting.py::test_lazy_array_wont_compute tests/test_options.py::TestAttrRetention::test_display_style_html tests/test_options.py::TestAttrRetention::test_display_style_html /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/core/formatting_html.py:26: DeprecationWarning: read_binary is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice. read_binary(package, resource).decode("utf-8") tests/test_groupby.py::TestDataArrayResample::test_resample_base /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_groupby.py:1818: FutureWarning: 'base' in .resample() and in Grouper() is deprecated. The new arguments that you should use are 'offset' or 'origin'. >>> df.resample(freq="3s", base=2) becomes: >>> df.resample(freq="3s", offset="2s") expected = DataArray(array.to_series().resample("24H", base=base).mean()) tests/test_rolling.py::TestDataArrayRolling::test_rolling_wrapped_dask_nochunk[True] tests/test_rolling.py::TestDataArrayRolling::test_rolling_wrapped_dask_nochunk[None] /usr/lib/python3.11/site-packages/dask/array/chunk.py:276: RuntimeWarning: invalid value encountered in cast return x.astype(astype_dtype, **kwargs) tests/test_rolling.py: 64 warnings /usr/lib64/python3.11/site-packages/bottleneck/slow/move.py:168: FutureWarning: In the future `np.bool` will be defined as the corresponding NumPy scalar. idx = np.empty(a.shape, dtype=np.bool) tests/test_plot.py::TestContour::test_colors /usr/lib/python3.11/site-packages/seaborn/palettes.py:443: MatplotlibDeprecationWarning: The get_cmap function was deprecated in Matplotlib 3.7 and will be removed two minor releases later. Use ``matplotlib.colormaps[name]`` or ``matplotlib.colormaps.get_cmap(obj)`` instead. cmap = mpl.cm.get_cmap(name) tests/test_units.py::TestDataArray::test_missing_value_filling[int64-method_ffill] tests/test_units.py::TestDataArray::test_missing_value_filling[int64-method_bfill] /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:2770: RuntimeWarning: invalid value encountered in cast np.array([1.4, np.nan, 2.3, np.nan, np.nan, 9.1]).astype(dtype) tests/test_units.py: 15 warnings /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:2807: RuntimeWarning: invalid value encountered in cast np.array([1.4, np.nan, 2.3, np.nan, np.nan, 9.1]).astype(dtype) tests/test_units.py::TestDataset::test_dropna[int64] /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:4329: RuntimeWarning: invalid value encountered in cast np.array([1.4, np.nan, 2.3, np.nan, np.nan, 9.1]).astype(dtype) tests/test_units.py::TestDataset::test_dropna[int64] /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:4333: RuntimeWarning: invalid value encountered in cast np.array([4.3, 9.8, 7.5, np.nan, 8.2, np.nan]).astype(dtype) tests/test_units.py::TestDataArray::test_dropna[int64] /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:2835: RuntimeWarning: invalid value encountered in cast np.array([1.4, np.nan, 2.3, np.nan, np.nan, 9.1]).astype(dtype) tests/test_units.py::TestDataset::test_isin[int64-no_unit] tests/test_units.py::TestDataset::test_isin[int64-dimensionless] tests/test_units.py::TestDataset::test_isin[int64-incompatible_unit] tests/test_units.py::TestDataset::test_isin[int64-compatible_unit] tests/test_units.py::TestDataset::test_isin[int64-same_unit] /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:4357: RuntimeWarning: invalid value encountered in cast np.array([1.4, np.nan, 2.3, np.nan, np.nan, 9.1]).astype(dtype) tests/test_units.py::TestDataset::test_isin[int64-no_unit] tests/test_units.py::TestDataset::test_isin[int64-dimensionless] tests/test_units.py::TestDataset::test_isin[int64-incompatible_unit] tests/test_units.py::TestDataset::test_isin[int64-compatible_unit] tests/test_units.py::TestDataset::test_isin[int64-same_unit] /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:4361: RuntimeWarning: invalid value encountered in cast np.array([4.3, 9.8, 7.5, np.nan, 8.2, np.nan]).astype(dtype) tests/test_units.py::TestDataset::test_isin[int64-no_unit] tests/test_units.py::TestDataset::test_isin[int64-dimensionless] tests/test_units.py::TestDataset::test_isin[int64-incompatible_unit] tests/test_units.py::TestDataset::test_isin[int64-compatible_unit] tests/test_units.py::TestDataset::test_isin[int64-same_unit] /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:4366: RuntimeWarning: invalid value encountered in cast raw_values = np.array([1.4, np.nan, 2.3]).astype(dtype) tests/test_units.py::TestDataArray::test_isin[int64-no_unit] tests/test_units.py::TestDataArray::test_isin[int64-dimensionless] tests/test_units.py::TestDataArray::test_isin[int64-incompatible_unit] tests/test_units.py::TestDataArray::test_isin[int64-compatible_unit] tests/test_units.py::TestDataArray::test_isin[int64-identical_unit] /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:2860: RuntimeWarning: invalid value encountered in cast np.array([1.4, np.nan, 2.3, np.nan, np.nan, 9.1]).astype(dtype) tests/test_units.py::TestDataArray::test_isin[int64-no_unit] tests/test_units.py::TestDataArray::test_isin[int64-dimensionless] tests/test_units.py::TestDataArray::test_isin[int64-incompatible_unit] tests/test_units.py::TestDataArray::test_isin[int64-compatible_unit] tests/test_units.py::TestDataArray::test_isin[int64-identical_unit] /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:2865: RuntimeWarning: invalid value encountered in cast raw_values = np.array([1.4, np.nan, 2.3]).astype(dtype) tests/test_units.py::TestDataset::test_missing_value_filling[int64-method_ffill] tests/test_units.py::TestDataset::test_missing_value_filling[int64-method_bfill] /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:4256: RuntimeWarning: invalid value encountered in cast np.array([1.4, np.nan, 2.3, np.nan, np.nan, 9.1]).astype(dtype) tests/test_units.py::TestDataset::test_missing_value_filling[int64-method_ffill] tests/test_units.py::TestDataset::test_missing_value_filling[int64-method_bfill] /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:4260: RuntimeWarning: invalid value encountered in cast np.array([4.3, 9.8, 7.5, np.nan, 8.2, np.nan]).astype(dtype) tests/test_units.py::TestDataset::test_interpolate_na[int64] /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:4442: RuntimeWarning: invalid value encountered in cast np.array([1.4, np.nan, 2.3, np.nan, np.nan, 9.1]).astype(dtype) tests/test_units.py::TestDataset::test_interpolate_na[int64] /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:4446: RuntimeWarning: invalid value encountered in cast np.array([4.3, 9.8, 7.5, np.nan, 8.2, np.nan]).astype(dtype) tests/test_units.py: 15 warnings /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:4299: RuntimeWarning: invalid value encountered in cast np.array([1.4, np.nan, 2.3, np.nan, np.nan, 9.1]).astype(dtype) tests/test_units.py: 15 warnings /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:4303: RuntimeWarning: invalid value encountered in cast np.array([4.3, 9.8, 7.5, np.nan, 8.2, np.nan]).astype(dtype) tests/test_units.py::TestDataset::test_combine_first[int64-data-no_unit] tests/test_units.py::TestDataset::test_combine_first[int64-data-dimensionless] tests/test_units.py::TestDataset::test_combine_first[int64-data-incompatible_unit] tests/test_units.py::TestDataset::test_combine_first[int64-data-compatible_unit] tests/test_units.py::TestDataset::test_combine_first[int64-data-same_unit] /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:4491: RuntimeWarning: invalid value encountered in cast np.array([1.4, np.nan, 2.3, np.nan, np.nan, 9.1]).astype(dtype) * data_unit tests/test_units.py::TestDataset::test_combine_first[int64-data-no_unit] tests/test_units.py::TestDataset::test_combine_first[int64-data-dimensionless] tests/test_units.py::TestDataset::test_combine_first[int64-data-incompatible_unit] tests/test_units.py::TestDataset::test_combine_first[int64-data-compatible_unit] tests/test_units.py::TestDataset::test_combine_first[int64-data-same_unit] /builddir/build/BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:4494: RuntimeWarning: invalid value encountered in cast np.array([4.3, 9.8, 7.5, np.nan, 8.2, np.nan]).astype(dtype) * data_unit tests/test_print_versions.py::test_show_versions /usr/lib/python3.11/site-packages/_distutils_hack/__init__.py:33: UserWarning: Setuptools is replacing distutils. warnings.warn("Setuptools is replacing distutils.") -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html =========================== short test summary info ============================ SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_cupy.py:9: could not import 'cupy': No module named 'cupy' SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_distributed.py:17: could not import 'distributed': No module named 'distributed' SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_sparse.py:21: could not import 'sparse': No module named 'sparse' SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:630: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:637: requires zarr version 3 SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1123: requires Nio SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:651: requires zarr version 3 SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1132: requires Nio SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:715: requires zarr version 3 SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1155: requires Nio SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1161: requires Nio SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:757: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:785: requires zarr version 3 SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1168: requires Nio SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:800: requires zarr version 3 SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1174: requires Nio SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:818: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:827: requires zarr version 3 SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1181: requires Nio SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1190: requires Nio SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:839: requires zarr version 3 SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1196: requires Nio SKIPPED [12] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:850: requires zarr version 3 SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1207: requires Nio SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1218: requires Nio SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:4194: requires Nio SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:4203: requires Nio SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:953: requires zarr version 3 SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:4212: requires Nio SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:963: requires zarr version 3 SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:4226: requires cfgrib SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:978: requires zarr version 3 SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:4239: requires cfgrib SKIPPED [18] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1002: requires iris SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:4255: requires cfgrib SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1013: requires zarr version 3 SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:4288: requires PseudoNetCDF SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1054: requires zarr version 3 SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:4376: requires PseudoNetCDF SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1077: requires zarr version 3 SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:4386: requires PseudoNetCDF SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1090: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1115: requires zarr version 3 SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:4417: requires PseudoNetCDF SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1132: requires zarr version 3 SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:4453: requires PseudoNetCDF SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1155: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1161: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1168: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1174: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1181: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1196: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1218: requires zarr version 3 SKIPPED [9] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1791: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1804: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1819: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1823: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1832: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1850: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1894: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1916: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1935: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1944: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1960: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:2043: requires zarr version 3 SKIPPED [6] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:2067: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:2118: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:2130: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:2138: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:2144: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:2148: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:2151: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:2160: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:2170: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:2181: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:2191: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:2198: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:2207: requires zarr version 3 SKIPPED [6] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:2219: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:2229: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:2253: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:2270: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:2290: requires zarr version 3 SKIPPED [6] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:2327: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:2337: requires zarr version 3 SKIPPED [36] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:2344: requires zarr version 3 SKIPPED [9] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:2386: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:2399: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:2443: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:2519: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:2535: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:2546: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:2555: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:2565: requires zarr version 3 SKIPPED [6] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:2579: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:2627: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:340: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:348: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:376: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:382: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:415: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:434: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:445: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:472: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:478: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:513: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:518: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:530: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:539: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:570: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:576: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:581: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:590: requires zarr version 3 SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:606: requires zarr version 3 SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:2666: could not import 'aiobotocore': No module named 'aiobotocore' SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:340: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:348: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:376: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:382: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:415: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:434: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:445: requires h5netcdf SKIPPED [2] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:458: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:472: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:478: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:513: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:518: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:530: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:539: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:570: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:576: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:581: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:590: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:606: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:623: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:630: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:637: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:651: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:715: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:757: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:785: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:800: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:818: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:827: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:839: requires h5netcdf SKIPPED [12] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:850: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:953: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:963: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:978: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1013: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1054: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1077: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1090: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1115: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1123: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1132: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1155: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1161: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1168: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1174: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1181: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1190: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1196: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1207: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1218: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1230: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1296: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1321: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1343: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1354: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1363: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1381: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1399: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1405: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1432: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1439: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1458: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1478: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1501: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1512: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1527: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1552: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1564: requires h5netcdf SKIPPED [9] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:2884: requires h5netcdf SKIPPED [6] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:2919: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:2933: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:2942: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:2956: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:2964: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:2974: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:3017: requires h5netcdf SKIPPED [3] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:3068: requires h5netcdf SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:3086: requires h5netcdf SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:3113: requires h5netcdf SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:3140: requires h5netcdf SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:3158: requires h5netcdf SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:3168: requires h5netcdf SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:3219: requires h5netcdf SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:3223: requires h5netcdf SKIPPED [2] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1648: https://github.com/Unidata/netcdf4-python/issues/1195 SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:5525: requires h5netcdf SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:5673: requires h5netcdf SKIPPED [16] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:3278: could not import 'h5netcdf': No module named 'h5netcdf' SKIPPED [16] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:3276: could not import 'Nio': No module named 'Nio' SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:2719: cannot pickle file objects SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:2723: cannot pickle file objects SKIPPED [13] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_coding_times.py:1034: Nanosecond frequency is not valid for cftime dates. SKIPPED [4] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_dataarray.py:4215: requires numexpr SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_conventions.py:429: cannot roundtrip coordinates yet for CFEncodedInMemoryStore SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_dask.py:142: Requires dask < 2021.04.1 SKIPPED [8] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_coarsen.py:241: These parameters lead to all-NaN slices SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:3657: could not import 'aiobotocore': No module named 'aiobotocore' SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:4115: requires pydap.client SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:4148: requires pydap.client SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:4157: requires pydap.client SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:273: requires Nio SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:340: requires Nio SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:376: requires Nio SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:382: requires Nio SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:415: requires Nio SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:434: requires Nio SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:445: requires Nio SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:458: requires Nio SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:472: requires Nio SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:478: requires Nio SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:513: requires Nio SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:518: requires Nio SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:530: requires Nio SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:539: requires Nio SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:570: requires Nio SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:576: requires Nio SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:581: requires Nio SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:590: requires Nio SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:606: requires Nio SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:623: requires Nio SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:630: requires Nio SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:637: requires Nio SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:651: requires Nio SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:715: requires Nio SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:757: requires Nio SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:785: requires Nio SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:800: requires Nio SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:818: requires Nio SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:827: requires Nio SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:839: requires Nio SKIPPED [4] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:850: requires Nio SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:953: requires Nio SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:963: requires Nio SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:978: requires Nio SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1013: requires Nio SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1054: requires Nio SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1077: requires Nio SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1090: requires Nio SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_backends.py:1115: requires Nio SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_computation.py:1313: dask/dask#7669: can no longer pass output_dtypes and meta SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_dataarray.py:6193: requires iris SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_dataarray.py:6263: requires iris SKIPPED [4] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_dataarray.py:6345: requires iris SKIPPED [4] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_dataarray.py:6377: requires iris SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_dataarray.py:6414: requires iris SKIPPED [2] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_dataarray.py:6432: requires iris SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_dataarray.py:6671: requires sparse SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_dataarray.py:6687: requires cupy SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_dataset.py:3572: requires sparse SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_dataset.py:6833: requires sparse SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_dataset.py:6848: requires cupy SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_dataset.py:4429: requires sparse SKIPPED [16] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_duck_array_ops.py:439: dask does not compute object-typed array SKIPPED [16] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_duck_array_ops.py:433: numpy does not support this SKIPPED [4] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_dataset.py:6161: requires numexpr SKIPPED [36] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_duck_array_ops.py:530: numpy's nanargmin raises ValueError for all nan axis SKIPPED [80] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_duck_array_ops.py:521: dim not in this test SKIPPED [60] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_duck_array_ops.py:528: numpy's argmin (not nanargmin) does not handle object-dtype SKIPPED [2] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_groupby.py:977: requires flox SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_dataarray.py:3250: requires sparse SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_dataarray.py:3263: requires sparse SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_dataarray.py:3462: could not import 'cdms2': No module named 'cdms2' SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_dataarray.py:3504: could not import 'cdms2': No module named 'cdms2' SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_dataarray.py:3530: could not import 'cdms2': No module named 'cdms2' SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_plot.py:1257: Skipped SKIPPED [32] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:664: std with window == 1 is unstable in bottleneck SKIPPED [10] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:716: indexes don't support units SKIPPED [10] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:793: indexes don't support units SKIPPED [10] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:899: indexes don't support units SKIPPED [10] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:967: indexes don't support units SKIPPED [10] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:1033: indexes don't support units SKIPPED [10] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:1137: indexes don't support units SKIPPED [4] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:1227: indexes don't support units SKIPPED [4] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:1263: indexes don't support units SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_plot.py:2001: does not make sense for surface plots SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_plot.py:2005: does not make sense for surface plots SKIPPED [2] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:1308: indexes don't support units SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:762: requires numbagg SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:768: requires numbagg SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_plot.py:2012: does not make sense for surface plots SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_plot.py:2016: does not make sense for surface plots SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_plot.py:2020: does not make sense for surface plots SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_plot.py:2024: does not make sense for surface plots SKIPPED [16] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:387: requires numbagg SKIPPED [8] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:409: requires numbagg SKIPPED [2] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_rolling.py:431: requires numbagg SKIPPED [2] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:375: indexes don't support units SKIPPED [2] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:1351: indexes don't support units SKIPPED [2] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:408: indexes don't support units SKIPPED [20] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:450: indexes don't support units SKIPPED [20] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:1751: behavior of identical is undecided SKIPPED [2] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:2011: rank not implemented for non-ndarray SKIPPED [4] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:2310: indexes don't support units SKIPPED [2] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:2342: calling np.argmax as a function on xarray objects is not supported SKIPPED [2] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:2342: calling np.argmin as a function on xarray objects is not supported SKIPPED [2] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:2342: median does not work with dataarrays yet SKIPPED [10] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:2996: indexes don't support units SKIPPED [30] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:2996: the behavior of identical is undecided SKIPPED [10] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:3073: indexes don't support units SKIPPED [28] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:3173: indexes don't support units SKIPPED [20] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:554: indexes don't support units SKIPPED [2] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:2276: indexes don't support units SKIPPED [20] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:3502: indexes don't support units SKIPPED [30] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:3288: indexes don't support units SKIPPED [30] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:3378: indexes don't support units SKIPPED [20] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:3578: indexes don't support units SKIPPED [2] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:3649: indexes don't support units SKIPPED [2] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:3673: rank not implemented for non-ndarray SKIPPED [6] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:3712: indexes don't support units SKIPPED [8] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:3771: indexes don't support units SKIPPED [30] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:3333: indexes don't support units SKIPPED [10] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:3957: indexes don't support units SKIPPED [4] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:4032: indexes don't support units SKIPPED [12] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:3823: indexes don't support units SKIPPED [8] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:3898: indexes don't support units SKIPPED [6] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:4716: indexes don't support units SKIPPED [30] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:4963: indexes don't support units SKIPPED [6] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:5016: indexes don't support units SKIPPED [10] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:4526: indexes don't support units SKIPPED [2] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:4789: rank not implemented for non-ndarray SKIPPED [30] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:4526: behaviour of identical is unclear SKIPPED [10] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:4461: indexes don't support units SKIPPED [10] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:4619: indexes don't support units SKIPPED [30] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:4857: indexes don't support units SKIPPED [30] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:4910: indexes don't support units SKIPPED [12] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:5259: indexes don't support units SKIPPED [32] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:5469: indexes don't support units SKIPPED [20] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:5144: indexes don't support units SKIPPED [10] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:5413: indexes don't support units SKIPPED [12] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:5311: indexes don't support units SKIPPED [10] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:5556: indexes don't support units SKIPPED [20] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:5219: indexes don't support units SKIPPED [2] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_units.py:5371: indexes don't support units SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_variable.py:2425: unconditional skip SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_variable.py:2429: unconditional skip SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_variable.py:2433: unconditional skip SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_variable.py:2437: unconditional skip SKIPPED [45] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_variable.py:2441: unconditional skip SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_variable.py:2460: unconditional skip SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_variable.py:2464: unconditional skip SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_variable.py:2468: unconditional skip SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_variable.py:2472: unconditional skip SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_variable.py:2476: unconditional skip SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_variable.py:2480: unconditional skip SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_variable.py:2314: requires sparse SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_variable.py:2553: requires pandas 2.0.0 SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_variable.py:2884: requires pandas 2.0.0 SKIPPED [2] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_variable.py:2800: requires sparse SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_variable.py:2941: requires pandas 2.0.0 SKIPPED [2] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_variable.py:2814: requires cupy SKIPPED [72] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_weighted.py:306: `method` argument is not currently exposed SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_plot.py:2844: nc_time_axis is not installed SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_plot.py:2847: nc_time_axis is not installed SKIPPED [1] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_plot.py:2850: nc_time_axis is not installed SKIPPED [4] ../../BUILDROOT/python-xarray-2023.1.0-1.fc38.noarch/usr/lib/python3.11/site-packages/xarray/tests/test_plot.py:3072: requires cartopy XFAIL tests/test_backends.py::TestGenericNetCDFData::test_roundtrip_mask_and_scale[create_bad_unsigned_masked_scaled_data-create_bad_encoded_unsigned_masked_scaled_data] - Bad _Unsigned attribute. XFAIL tests/test_backends.py::TestRasterio::test_rasterio_vrt - rasterio 1.1.1 is broken. GH3573 XFAIL tests/test_backends.py::TestNetCDF4Data::test_roundtrip_mask_and_scale[create_bad_unsigned_masked_scaled_data-create_bad_encoded_unsigned_masked_scaled_data] - Bad _Unsigned attribute. XFAIL tests/test_backends.py::TestScipyInMemoryData::test_roundtrip_mask_and_scale[create_bad_unsigned_masked_scaled_data-create_bad_encoded_unsigned_masked_scaled_data] - Bad _Unsigned attribute. XFAIL tests/test_backends.py::TestScipyFileObject::test_roundtrip_mask_and_scale[create_bad_unsigned_masked_scaled_data-create_bad_encoded_unsigned_masked_scaled_data] - Bad _Unsigned attribute. XFAIL tests/test_backends.py::TestNetCDF4ViaDaskData::test_roundtrip_mask_and_scale[create_bad_unsigned_masked_scaled_data-create_bad_encoded_unsigned_masked_scaled_data] - Bad _Unsigned attribute. XFAIL tests/test_backends.py::TestScipyFilePath::test_roundtrip_mask_and_scale[create_bad_unsigned_masked_scaled_data-create_bad_encoded_unsigned_masked_scaled_data] - Bad _Unsigned attribute. XFAIL tests/test_conventions.py::TestCFEncodedDataStore::test_roundtrip_mask_and_scale[create_bad_unsigned_masked_scaled_data-create_bad_encoded_unsigned_masked_scaled_data] - Bad _Unsigned attribute. XFAIL tests/test_backends.py::TestNetCDF3ViaNetCDF4Data::test_roundtrip_mask_and_scale[create_bad_unsigned_masked_scaled_data-create_bad_encoded_unsigned_masked_scaled_data] - Bad _Unsigned attribute. XFAIL tests/test_dataarray.py::TestReduce1D::test_idxmin[True-datetime] - reason: dask operation 'argmin' breaks when dtype is datetime64 (M) XFAIL tests/test_backends.py::TestZarrDictStore::test_roundtrip_mask_and_scale[create_bad_unsigned_masked_scaled_data-create_bad_encoded_unsigned_masked_scaled_data] - Bad _Unsigned attribute. XFAIL tests/test_combine.py::TestNestedCombine::test_nested_concat_too_many_dims_at_once XFAIL tests/test_dataarray.py::TestReduce1D::test_idxmax[True-datetime] - reason: dask operation 'argmax' breaks when dtype is datetime64 (M) XFAIL tests/test_backends.py::TestNetCDF4ClassicViaNetCDF4Data::test_roundtrip_mask_and_scale[create_bad_unsigned_masked_scaled_data-create_bad_encoded_unsigned_masked_scaled_data] - Bad _Unsigned attribute. XFAIL tests/test_dask.py::TestToDaskDataFrame::test_to_dask_dataframe_2D_set_index XFAIL tests/test_dataarray.py::TestReduce2D::test_idxmin[dask-datetime] - reason: dask operation 'argmin' breaks when dtype is datetime64 (M) XFAIL tests/test_dataarray.py::TestReduce2D::test_idxmax[dask-datetime] - reason: dask operation 'argmax' breaks when dtype is datetime64 (M) XFAIL tests/test_backends.py::TestZarrDirectoryStore::test_roundtrip_mask_and_scale[create_bad_unsigned_masked_scaled_data-create_bad_encoded_unsigned_masked_scaled_data] - Bad _Unsigned attribute. XFAIL tests/test_dataset.py::TestDataset::test_copy_coords[True-expected_orig0] XFAIL tests/test_interp.py::test_datetime[2000-01-01T12:00-0.5] XFAIL tests/test_dataarray.py::TestDataArray::test_astype_subok - reason: DataArray cannot be backed yet by a subclasses of np.ndarray XFAIL tests/test_missing.py::test_interpolate_na_2d[None] XFAIL tests/test_dataarray.py::TestDataArray::test_copy_coords[True-expected_orig0] XFAIL tests/test_units.py::test_replication_full_like_dataarray[float64-coords] - can't copy quantity into non-quantity XFAIL tests/test_units.py::test_replication_full_like_dataarray[int64-coords] - can't copy quantity into non-quantity XFAIL tests/test_units.py::test_replication_full_like_dataset[float64-coords] - can't copy quantity into non-quantity XFAIL tests/test_units.py::test_align_dataarray[float64-10-coords-no_unit] - reason: fill_value is used for both data variables and coords. See https://github.com/pydata/xarray/issues/4165 XFAIL tests/test_units.py::test_align_dataarray[float64-10-coords-dimensionless] - reason: fill_value is used for both data variables and coords. See https://github.com/pydata/xarray/issues/4165 XFAIL tests/test_units.py::test_replication_full_like_dataset[int64-coords] - can't copy quantity into non-quantity XFAIL tests/test_units.py::test_align_dataarray[float64-10-coords-incompatible_unit] - reason: fill_value is used for both data variables and coords. See https://github.com/pydata/xarray/issues/4165 XFAIL tests/test_units.py::test_align_dataarray[float64-10-coords-compatible_unit] - reason: fill_value is used for both data variables and coords. See https://github.com/pydata/xarray/issues/4165 XFAIL tests/test_units.py::test_align_dataarray[float64-10-coords-identical_unit] - reason: fill_value is used for both data variables and coords. See https://github.com/pydata/xarray/issues/4165 XFAIL tests/test_units.py::TestVariable::test_computation[float64-method_rolling_window] - converts to ndarray XFAIL tests/test_units.py::test_align_dataarray[float64-value1-coords-dimensionless] - reason: fill_value is used for both data variables and coords. See https://github.com/pydata/xarray/issues/4165 XFAIL tests/test_units.py::test_align_dataarray[float64-value1-coords-incompatible_unit] - reason: fill_value is used for both data variables and coords. See https://github.com/pydata/xarray/issues/4165 XFAIL tests/test_units.py::TestVariable::test_computation[int64-method_rolling_window] - converts to ndarray XFAIL tests/test_units.py::test_align_dataarray[float64-value1-coords-compatible_unit] - reason: fill_value is used for both data variables and coords. See https://github.com/pydata/xarray/issues/4165 XFAIL tests/test_units.py::test_align_dataarray[float64-value1-coords-identical_unit] - reason: fill_value is used for both data variables and coords. See https://github.com/pydata/xarray/issues/4165 XFAIL tests/test_units.py::TestVariable::test_aggregation[float64-method_prod] - reason: nanprod is not by older `pint` versions XFAIL tests/test_units.py::test_align_dataarray[int64-10-coords-no_unit] - reason: fill_value is used for both data variables and coords. See https://github.com/pydata/xarray/issues/4165 XFAIL tests/test_units.py::TestDataArray::test_aggregation[float64-function_prod] - reason: nanprod is not by older `pint` versions XFAIL tests/test_units.py::test_align_dataarray[int64-10-coords-dimensionless] - reason: fill_value is used for both data variables and coords. See https://github.com/pydata/xarray/issues/4165 XFAIL tests/test_units.py::test_align_dataarray[int64-10-coords-incompatible_unit] - reason: fill_value is used for both data variables and coords. See https://github.com/pydata/xarray/issues/4165 XFAIL tests/test_units.py::TestDataArray::test_aggregation[float64-method_prod] - reason: nanprod is not by older `pint` versions XFAIL tests/test_units.py::test_align_dataarray[int64-10-coords-compatible_unit] - reason: fill_value is used for both data variables and coords. See https://github.com/pydata/xarray/issues/4165 XFAIL tests/test_units.py::test_align_dataarray[int64-10-coords-identical_unit] - reason: fill_value is used for both data variables and coords. See https://github.com/pydata/xarray/issues/4165 XFAIL tests/test_units.py::test_align_dataarray[int64-value1-coords-dimensionless] - reason: fill_value is used for both data variables and coords. See https://github.com/pydata/xarray/issues/4165 XFAIL tests/test_units.py::TestDataArray::test_numpy_methods_with_args[float64-incompatible_unit-function_clip] - xarray does not implement __array_function__ XFAIL tests/test_units.py::test_align_dataarray[int64-value1-coords-incompatible_unit] - reason: fill_value is used for both data variables and coords. See https://github.com/pydata/xarray/issues/4165 XFAIL tests/test_units.py::test_align_dataarray[int64-value1-coords-compatible_unit] - reason: fill_value is used for both data variables and coords. See https://github.com/pydata/xarray/issues/4165 XFAIL tests/test_units.py::test_align_dataarray[int64-value1-coords-identical_unit] - reason: fill_value is used for both data variables and coords. See https://github.com/pydata/xarray/issues/4165 XFAIL tests/test_units.py::TestDataArray::test_numpy_methods_with_args[float64-compatible_unit-function_clip] - xarray does not implement __array_function__ XFAIL tests/test_units.py::test_align_dataset[float64-10-coords-no_unit] - reason: fill_value is used for both data variables and coords. See https://github.com/pydata/xarray/issues/4165 XFAIL tests/test_units.py::test_align_dataset[float64-10-coords-dimensionless] - reason: fill_value is used for both data variables and coords. See https://github.com/pydata/xarray/issues/4165 XFAIL tests/test_units.py::test_align_dataset[float64-10-coords-incompatible_unit] - reason: fill_value is used for both data variables and coords. See https://github.com/pydata/xarray/issues/4165 XFAIL tests/test_units.py::TestDataArray::test_numpy_methods_with_args[float64-identical_unit-function_clip] - xarray does not implement __array_function__ XFAIL tests/test_units.py::TestDataArray::test_bivariate_ufunc[float64-compatible_unit] - needs the type register system for __array_ufunc__ XFAIL tests/test_units.py::test_align_dataset[float64-10-coords-compatible_unit] - reason: fill_value is used for both data variables and coords. See https://github.com/pydata/xarray/issues/4165 XFAIL tests/test_units.py::TestDataArray::test_bivariate_ufunc[int64-compatible_unit] - needs the type register system for __array_ufunc__ XFAIL tests/test_units.py::test_align_dataset[float64-10-coords-identical_unit] - reason: fill_value is used for both data variables and coords. See https://github.com/pydata/xarray/issues/4165 XFAIL tests/test_units.py::TestDataArray::test_numpy_methods_with_args[int64-no_unit-function_clip] - xarray does not implement __array_function__ XFAIL tests/test_units.py::TestDataArray::test_interp_reindex_like[float64-method_interp_like-data] - uses scipy XFAIL tests/test_units.py::test_align_dataset[float64-value1-coords-dimensionless] - reason: fill_value is used for both data variables and coords. See https://github.com/pydata/xarray/issues/4165 XFAIL tests/test_units.py::test_align_dataset[float64-value1-coords-incompatible_unit] - reason: fill_value is used for both data variables and coords. See https://github.com/pydata/xarray/issues/4165 XFAIL tests/test_units.py::TestDataArray::test_numpy_methods_with_args[int64-dimensionless-function_clip] - xarray does not implement __array_function__ XFAIL tests/test_units.py::test_align_dataset[float64-value1-coords-compatible_unit] - reason: fill_value is used for both data variables and coords. See https://github.com/pydata/xarray/issues/4165 XFAIL tests/test_units.py::test_align_dataset[float64-value1-coords-identical_unit] - reason: fill_value is used for both data variables and coords. See https://github.com/pydata/xarray/issues/4165 XFAIL tests/test_units.py::TestDataArray::test_interp_reindex_like[float64-method_interp_like-coords] - uses scipy XFAIL tests/test_units.py::TestDataArray::test_searchsorted[float64-function_searchsorted-no_unit] - xarray does not implement __array_function__ XFAIL tests/test_units.py::TestDataArray::test_numpy_methods_with_args[int64-incompatible_unit-function_clip] - xarray does not implement __array_function__ XFAIL tests/test_units.py::test_align_dataset[int64-10-coords-no_unit] - reason: fill_value is used for both data variables and coords. See https://github.com/pydata/xarray/issues/4165 XFAIL tests/test_units.py::TestDataArray::test_searchsorted[float64-function_searchsorted-dimensionless] - xarray does not implement __array_function__ XFAIL tests/test_units.py::test_align_dataset[int64-10-coords-dimensionless] - reason: fill_value is used for both data variables and coords. See https://github.com/pydata/xarray/issues/4165 XFAIL tests/test_units.py::test_align_dataset[int64-10-coords-incompatible_unit] - reason: fill_value is used for both data variables and coords. See https://github.com/pydata/xarray/issues/4165 XFAIL tests/test_units.py::TestDataArray::test_interp_reindex_like[int64-method_interp_like-data] - uses scipy XFAIL tests/test_units.py::TestDataArray::test_numpy_methods_with_args[int64-compatible_unit-function_clip] - xarray does not implement __array_function__ XFAIL tests/test_units.py::test_align_dataset[int64-10-coords-compatible_unit] - reason: fill_value is used for both data variables and coords. See https://github.com/pydata/xarray/issues/4165 XFAIL tests/test_units.py::TestDataArray::test_searchsorted[float64-function_searchsorted-incompatible_unit] - xarray does not implement __array_function__ XFAIL tests/test_units.py::test_align_dataset[int64-10-coords-identical_unit] - reason: fill_value is used for both data variables and coords. See https://github.com/pydata/xarray/issues/4165 XFAIL tests/test_units.py::TestDataArray::test_interp_reindex_like[int64-method_interp_like-coords] - uses scipy XFAIL tests/test_units.py::test_align_dataset[int64-value1-coords-dimensionless] - reason: fill_value is used for both data variables and coords. See https://github.com/pydata/xarray/issues/4165 XFAIL tests/test_units.py::TestDataArray::test_searchsorted[float64-function_searchsorted-compatible_unit] - xarray does not implement __array_function__ XFAIL tests/test_units.py::TestDataArray::test_numpy_methods_with_args[int64-identical_unit-function_clip] - xarray does not implement __array_function__ XFAIL tests/test_units.py::test_align_dataset[int64-value1-coords-incompatible_unit] - reason: fill_value is used for both data variables and coords. See https://github.com/pydata/xarray/issues/4165 XFAIL tests/test_units.py::TestDataArray::test_interp_reindex[float64-method_interp-data] - uses scipy XFAIL tests/test_units.py::test_align_dataset[int64-value1-coords-compatible_unit] - reason: fill_value is used for both data variables and coords. See https://github.com/pydata/xarray/issues/4165 XFAIL tests/test_units.py::TestDataArray::test_searchsorted[float64-function_searchsorted-identical_unit] - xarray does not implement __array_function__ XFAIL tests/test_units.py::test_align_dataset[int64-value1-coords-identical_unit] - reason: fill_value is used for both data variables and coords. See https://github.com/pydata/xarray/issues/4165 XFAIL tests/test_units.py::TestDataArray::test_missing_value_filling[float64-method_ffill] - ffill and bfill lose units in data XFAIL tests/test_units.py::TestDataArray::test_interp_reindex[float64-method_interp-coords] - uses scipy XFAIL tests/test_units.py::TestDataArray::test_missing_value_filling[float64-method_bfill] - ffill and bfill lose units in data XFAIL tests/test_units.py::TestDataArray::test_searchsorted[int64-function_searchsorted-no_unit] - xarray does not implement __array_function__ XFAIL tests/test_units.py::TestDataArray::test_missing_value_filling[int64-method_ffill] - ffill and bfill lose units in data XFAIL tests/test_units.py::TestDataArray::test_searchsorted[int64-function_searchsorted-dimensionless] - xarray does not implement __array_function__ XFAIL tests/test_units.py::TestDataArray::test_interp_reindex[int64-method_interp-data] - uses scipy XFAIL tests/test_units.py::TestDataset::test_aggregation[float64-method_prod] - reason: nanprod is not by older `pint` versions XFAIL tests/test_units.py::TestDataArray::test_computation_objects[float64-method_rolling-data] - numpy.lib.stride_tricks.as_strided converts to ndarray XFAIL tests/test_units.py::TestDataArray::test_missing_value_filling[int64-method_bfill] - ffill and bfill lose units in data XFAIL tests/test_units.py::TestDataArray::test_searchsorted[int64-function_searchsorted-incompatible_unit] - xarray does not implement __array_function__ XFAIL tests/test_units.py::TestDataArray::test_computation_objects[float64-method_rolling_exp-data] - numbagg functions are not supported by pint XFAIL tests/test_units.py::TestDataArray::test_interp_reindex[int64-method_interp-coords] - uses scipy XFAIL tests/test_units.py::TestDataArray::test_computation_objects[float64-method_rolling_exp-coords] - numbagg functions are not supported by pint XFAIL tests/test_units.py::TestDataArray::test_searchsorted[int64-function_searchsorted-compatible_unit] - xarray does not implement __array_function__ XFAIL tests/test_units.py::TestDataArray::test_computation_objects[int64-method_rolling-data] - numpy.lib.stride_tricks.as_strided converts to ndarray XFAIL tests/test_units.py::TestDataArray::test_searchsorted[int64-function_searchsorted-identical_unit] - xarray does not implement __array_function__ XFAIL tests/test_units.py::TestDataset::test_missing_value_filling[float64-method_ffill] - ffill and bfill lose the unit XFAIL tests/test_units.py::TestDataArray::test_computation_objects[int64-method_rolling_exp-data] - numbagg functions are not supported by pint XFAIL tests/test_units.py::TestDataArray::test_numpy_methods_with_args[float64-no_unit-function_clip] - xarray does not implement __array_function__ XFAIL tests/test_units.py::TestDataArray::test_computation_objects[int64-method_rolling_exp-coords] - numbagg functions are not supported by pint XFAIL tests/test_units.py::TestDataset::test_missing_value_filling[float64-method_bfill] - ffill and bfill lose the unit XFAIL tests/test_units.py::TestDataArray::test_interpolate_na - uses numpy.vectorize XFAIL tests/test_units.py::TestDataArray::test_numpy_methods_with_args[float64-dimensionless-function_clip] - xarray does not implement __array_function__ XFAIL tests/test_units.py::TestDataset::test_missing_value_filling[int64-method_ffill] - ffill and bfill lose the unit XFAIL tests/test_units.py::TestDataset::test_interpolate_na[float64] - interpolate_na uses numpy.vectorize XFAIL tests/test_units.py::TestDataset::test_to_stacked_array[float64] - stacked dimension's labels have to be hashable, but is a numpy.array XFAIL tests/test_units.py::TestDataset::test_missing_value_filling[int64-method_bfill] - ffill and bfill lose the unit XFAIL tests/test_units.py::TestDataset::test_to_stacked_array[int64] - stacked dimension's labels have to be hashable, but is a numpy.array XFAIL tests/test_units.py::TestDataset::test_interpolate_na[int64] - interpolate_na uses numpy.vectorize XFAIL tests/test_units.py::TestDataset::test_interp_reindex[float64-method_interp-data] - uses scipy XFAIL tests/test_units.py::TestDataset::test_interp_reindex_like[float64-method_interp_like-data] - uses scipy XFAIL tests/test_units.py::TestDataset::test_computation_objects[float64-data-method_rolling] - strips units XFAIL tests/test_units.py::TestDataset::test_interp_reindex[float64-method_interp-coords] - uses scipy XFAIL tests/test_units.py::TestDataset::test_computation_objects[float64-data-method_rolling_exp] - numbagg functions are not supported by pint XFAIL tests/test_units.py::TestDataset::test_interp_reindex_like[float64-method_interp_like-coords] - uses scipy XFAIL tests/test_units.py::TestDataset::test_interp_reindex[int64-method_interp-data] - uses scipy XFAIL tests/test_units.py::TestDataset::test_computation_objects[float64-coords-method_rolling_exp] - numbagg functions are not supported by pint XFAIL tests/test_units.py::TestDataset::test_interp_reindex_like[int64-method_interp_like-data] - uses scipy XFAIL tests/test_units.py::TestDataset::test_interp_reindex[int64-method_interp-coords] - uses scipy XFAIL tests/test_units.py::TestDataset::test_computation_objects[int64-data-method_rolling] - strips units XFAIL tests/test_units.py::TestDataset::test_interp_reindex_like[int64-method_interp_like-coords] - uses scipy XFAIL tests/test_variable.py::TestVariable::test_timedelta64_valid_range - pandas issue 36615 XFAIL tests/test_units.py::TestDataset::test_computation_objects[int64-data-method_rolling_exp] - numbagg functions are not supported by pint XFAIL tests/test_units.py::TestDataset::test_computation_objects[int64-coords-method_rolling_exp] - numbagg functions are not supported by pint XFAIL tests/test_variable.py::TestVariableWithDask::test_timedelta64_valid_range - pandas issue 36615 XFAIL tests/test_variable.py::TestVariableWithDask::test_pad[xr_arg4-np_arg4-median] - median is not implemented by Dask XFAIL tests/test_variable.py::TestVariableWithDask::test_pad[xr_arg4-np_arg4-reflect] - dask.array.pad bug XFAIL tests/test_units.py::TestPlots::test_units_in_line_plot_labels[coord_unit1-coord_attrs1] - indexes don't support units XFAIL tests/test_units.py::TestPlots::test_units_in_slice_line_plot_labels_sel[coord_unit1-coord_attrs1] - indexes don't support units XFAIL tests/test_variable.py::TestVariableWithDask::test_pad[xr_arg1-np_arg1-median] - median is not implemented by Dask XFAIL tests/test_units.py::TestPlots::test_units_in_slice_line_plot_labels_isel[coord_unit1-coord_attrs1] - pint.errors.UnitStrippedWarning XFAIL tests/test_variable.py::TestVariableWithDask::test_0d_object_array_with_list XFAIL tests/test_variable.py::TestVariableWithDask::test_pad[xr_arg0-np_arg0-median] - median is not implemented by Dask XFAIL tests/test_variable.py::TestIndexVariable::test_timedelta64_valid_range - pandas issue 36615 XFAIL tests/test_variable.py::TestVariableWithDask::test_array_interface XFAIL tests/test_variable.py::TestVariableWithDask::test_copy_index XFAIL tests/test_variable.py::TestVariableWithDask::test_pad[xr_arg2-np_arg2-median] - median is not implemented by Dask XFAIL tests/test_variable.py::TestVariableWithDask::test_eq_all_dtypes XFAIL tests/test_variable.py::TestVariableWithDask::test_pad[xr_arg2-np_arg2-reflect] - dask.array.pad bug XFAIL tests/test_variable.py::TestVariableWithDask::test_pad[xr_arg3-np_arg3-median] - median is not implemented by Dask XFAIL tests/test_variable.py::TestVariableWithDask::test_pad[xr_arg3-np_arg3-reflect] - dask.array.pad bug XPASS tests/test_backends.py::TestNetCDF4Data::test_vectorized_indexing_negative_step zarr without dask handles negative steps in slices incorrectly XPASS tests/test_backends.py::TestScipyInMemoryData::test_vectorized_indexing_negative_step zarr without dask handles negative steps in slices incorrectly XPASS tests/test_cftimeindex.py::test_multiindex https://github.com/pandas-dev/pandas/issues/24263 XPASS tests/test_backends.py::TestScipyFileObject::test_vectorized_indexing_negative_step zarr without dask handles negative steps in slices incorrectly XPASS tests/test_backends.py::TestNetCDF4ViaDaskData::test_vectorized_indexing_negative_step zarr without dask handles negative steps in slices incorrectly XPASS tests/test_backends.py::TestScipyFilePath::test_vectorized_indexing_negative_step zarr without dask handles negative steps in slices incorrectly XPASS tests/test_conventions.py::TestCFEncodedDataStore::test_vectorized_indexing_negative_step zarr without dask handles negative steps in slices incorrectly XPASS tests/test_backends.py::TestNetCDF3ViaNetCDF4Data::test_vectorized_indexing_negative_step zarr without dask handles negative steps in slices incorrectly XPASS tests/test_backends.py::TestZarrDictStore::test_vectorized_indexing_negative_step zarr without dask handles negative steps in slices incorrectly XPASS tests/test_backends.py::TestDask::test_vectorized_indexing_negative_step zarr without dask handles negative steps in slices incorrectly XPASS tests/test_backends.py::TestNetCDF4ClassicViaNetCDF4Data::test_vectorized_indexing_negative_step zarr without dask handles negative steps in slices incorrectly XPASS tests/test_backends.py::TestDask::test_encoding_mfdataset mfdataset loses encoding currently. XPASS tests/test_backends.py::TestZarrDictStore::test_dataset_caching Zarr caching not implemented XPASS tests/test_backends.py::TestDask::test_save_mfdataset_compute_false_roundtrip XPASS tests/test_backends.py::TestGenericNetCDFData::test_vectorized_indexing_negative_step zarr without dask handles negative steps in slices incorrectly XPASS tests/test_backends.py::TestZarrDirectoryStore::test_vectorized_indexing_negative_step zarr without dask handles negative steps in slices incorrectly XPASS tests/test_dataset.py::TestDataset::test_copy_coords[False-expected_orig1] XPASS tests/test_backends.py::TestZarrDirectoryStore::test_dataset_caching Zarr caching not implemented XPASS tests/test_options.py::TestAttrRetention::test_merge_attr_retention XPASS tests/test_dataarray.py::TestDataArray::test_copy_coords[False-expected_orig1] XPASS tests/test_rolling.py::TestDatasetRolling::test_raise_no_warning_dask_rolling_assert_close[numpy-mean-2] See https://github.com/pydata/xarray/pull/4369 or docstring XPASS tests/test_rolling.py::TestDatasetRolling::test_raise_no_warning_dask_rolling_assert_close[numpy-max-2] See https://github.com/pydata/xarray/pull/4369 or docstring XPASS tests/test_rolling.py::TestDatasetRolling::test_raise_no_warning_dask_rolling_assert_close[dask-mean-2] See https://github.com/pydata/xarray/pull/4369 or docstring XPASS tests/test_rolling.py::TestDatasetRolling::test_raise_no_warning_dask_rolling_assert_close[dask-max-2] See https://github.com/pydata/xarray/pull/4369 or docstring XPASS tests/test_units.py::TestDataArray::test_bivariate_ufunc[float64-without_unit] needs the type register system for __array_ufunc__ XPASS tests/test_units.py::TestDataArray::test_bivariate_ufunc[float64-dimensionless] needs the type register system for __array_ufunc__ XPASS tests/test_units.py::TestDataArray::test_bivariate_ufunc[float64-incompatible_unit] needs the type register system for __array_ufunc__ XPASS tests/test_units.py::TestDataArray::test_bivariate_ufunc[float64-identical_unit] needs the type register system for __array_ufunc__ XPASS tests/test_units.py::TestDataArray::test_bivariate_ufunc[int64-without_unit] needs the type register system for __array_ufunc__ XPASS tests/test_units.py::TestDataArray::test_bivariate_ufunc[int64-dimensionless] needs the type register system for __array_ufunc__ XPASS tests/test_units.py::TestDataArray::test_bivariate_ufunc[int64-incompatible_unit] needs the type register system for __array_ufunc__ XPASS tests/test_units.py::TestDataArray::test_bivariate_ufunc[int64-identical_unit] needs the type register system for __array_ufunc__ XPASS tests/test_units.py::TestDataArray::test_computation_objects[float64-method_rolling-coords] numpy.lib.stride_tricks.as_strided converts to ndarray XPASS tests/test_units.py::TestDataArray::test_computation_objects[int64-method_rolling-coords] numpy.lib.stride_tricks.as_strided converts to ndarray XPASS tests/test_units.py::TestDataset::test_computation_objects[float64-coords-method_rolling] strips units XPASS tests/test_variable.py::TestVariable::test_pad[xr_arg3-np_arg3-median] median is not implemented by Dask XPASS tests/test_variable.py::TestVariable::test_pad[xr_arg3-np_arg3-reflect] dask.array.pad bug XPASS tests/test_variable.py::TestVariable::test_pad[xr_arg3-np_arg3-linear_ramp] pint bug: https://github.com/hgrecco/pint/issues/1026 XPASS tests/test_variable.py::TestVariable::test_pad[xr_arg4-np_arg4-median] median is not implemented by Dask XPASS tests/test_variable.py::TestVariable::test_pad[xr_arg4-np_arg4-reflect] dask.array.pad bug XPASS tests/test_variable.py::TestVariable::test_pad[xr_arg4-np_arg4-linear_ramp] pint bug: https://github.com/hgrecco/pint/issues/1026 XPASS tests/test_variable.py::TestVariable::test_pad[xr_arg0-np_arg0-median] median is not implemented by Dask XPASS tests/test_variable.py::TestVariable::test_pad[xr_arg0-np_arg0-reflect] dask.array.pad bug XPASS tests/test_variable.py::TestVariable::test_pad[xr_arg0-np_arg0-linear_ramp] pint bug: https://github.com/hgrecco/pint/issues/1026 XPASS tests/test_variable.py::TestVariable::test_pad[xr_arg1-np_arg1-median] median is not implemented by Dask XPASS tests/test_variable.py::TestVariable::test_pad[xr_arg1-np_arg1-reflect] dask.array.pad bug XPASS tests/test_variable.py::TestVariable::test_pad[xr_arg1-np_arg1-linear_ramp] pint bug: https://github.com/hgrecco/pint/issues/1026 XPASS tests/test_variable.py::TestVariable::test_pad[xr_arg2-np_arg2-median] median is not implemented by Dask XPASS tests/test_variable.py::TestVariable::test_pad[xr_arg2-np_arg2-reflect] dask.array.pad bug XPASS tests/test_variable.py::TestVariable::test_pad[xr_arg2-np_arg2-linear_ramp] pint bug: https://github.com/hgrecco/pint/issues/1026 XPASS tests/test_variable.py::TestVariableWithDask::test_pad[xr_arg3-np_arg3-linear_ramp] pint bug: https://github.com/hgrecco/pint/issues/1026 XPASS tests/test_units.py::TestDataset::test_computation_objects[int64-coords-method_rolling] strips units XPASS tests/test_variable.py::TestVariableWithDask::test_pad[xr_arg4-np_arg4-linear_ramp] pint bug: https://github.com/hgrecco/pint/issues/1026 XPASS tests/test_variable.py::TestVariableWithDask::test_multiindex https://github.com/pydata/xarray/issues/6209#issuecomment-1025116203 XPASS tests/test_variable.py::TestVariableWithDask::test_pad[xr_arg1-np_arg1-reflect] dask.array.pad bug XPASS tests/test_variable.py::TestVariableWithDask::test_pad[xr_arg1-np_arg1-linear_ramp] pint bug: https://github.com/hgrecco/pint/issues/1026 XPASS tests/test_variable.py::TestVariableWithDask::test_pad[xr_arg0-np_arg0-reflect] dask.array.pad bug XPASS tests/test_variable.py::TestVariableWithDask::test_pad[xr_arg0-np_arg0-linear_ramp] pint bug: https://github.com/hgrecco/pint/issues/1026 XPASS tests/test_variable.py::TestVariableWithDask::test_pad[xr_arg2-np_arg2-linear_ramp] pint bug: https://github.com/hgrecco/pint/issues/1026 XPASS tests/test_plot.py::TestDatasetScatterPlots::test_datetime_hue[discrete] datetime,timedelta hue variable not supported. XPASS tests/test_plot.py::TestDatasetScatterPlots::test_datetime_hue[continuous] datetime,timedelta hue variable not supported. FAILED tests/test_backends.py::TestNetCDF4Data::test_roundtrip_numpy_datetime_data FAILED tests/test_backends.py::TestScipyInMemoryData::test_roundtrip_numpy_datetime_data FAILED tests/test_backends.py::TestScipyFileObject::test_roundtrip_numpy_datetime_data FAILED tests/test_backends.py::TestNetCDF4ViaDaskData::test_roundtrip_numpy_datetime_data FAILED tests/test_backends.py::TestScipyFilePath::test_roundtrip_numpy_datetime_data FAILED tests/test_conventions.py::TestCFEncodedDataStore::test_roundtrip_numpy_datetime_data FAILED tests/test_backends.py::TestNetCDF3ViaNetCDF4Data::test_roundtrip_numpy_datetime_data FAILED tests/test_backends.py::TestZarrDictStore::test_roundtrip_numpy_datetime_data FAILED tests/test_backends.py::TestNetCDF4ClassicViaNetCDF4Data::test_roundtrip_numpy_datetime_data FAILED tests/test_backends.py::TestGenericNetCDFData::test_roundtrip_numpy_datetime_data FAILED tests/test_coding_times.py::test_cf_datetime_nan[num_dates0-days since 2000-01-01-expected_list0] FAILED tests/test_backends.py::TestZarrDirectoryStore::test_roundtrip_numpy_datetime_data FAILED tests/test_coding_times.py::test_cf_datetime_nan[num_dates1-days since 2000-01-01-expected_list1] FAILED tests/test_coding_times.py::test_cf_datetime_nan[num_dates2-days since 2000-01-01-expected_list2] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[sum-1-None-True] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[sum-1-None-False] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[sum-1-1-True] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[sum-1-1-False] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[sum-1-2-True] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[sum-1-2-False] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[sum-1-3-True] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[sum-1-3-False] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[sum-2-None-True] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[sum-2-None-False] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[sum-2-1-True] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[sum-2-1-False] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[sum-2-2-True] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[sum-2-2-False] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[sum-2-3-True] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[sum-2-3-False] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[sum-3-None-True] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[sum-3-None-False] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[sum-3-1-True] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[sum-3-1-False] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[sum-3-2-True] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[sum-3-2-False] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[sum-3-3-True] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[sum-3-3-False] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[sum-4-None-True] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[sum-4-None-False] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[sum-4-1-True] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[sum-4-1-False] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[sum-4-2-True] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[sum-4-2-False] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[sum-4-3-True] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[sum-4-3-False] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[max-1-None-True] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[max-1-None-False] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[max-1-1-True] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[max-1-1-False] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[max-1-2-True] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[max-1-2-False] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[max-1-3-True] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[max-1-3-False] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[max-2-None-True] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[max-2-None-False] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[max-2-1-True] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[max-2-1-False] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[max-2-2-True] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[max-2-2-False] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[max-2-3-True] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[max-2-3-False] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[max-3-None-True] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[max-3-None-False] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[max-3-1-True] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[max-3-1-False] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[max-3-2-True] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[max-3-2-False] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[max-3-3-True] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[max-3-3-False] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[max-4-None-True] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[max-4-None-False] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[max-4-1-True] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[max-4-1-False] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[max-4-2-True] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[max-4-2-False] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[max-4-3-True] FAILED tests/test_rolling.py::TestDataArrayRolling::test_rolling_reduce_nonnumeric[max-4-3-False] = 78 failed, 14333 passed, 1880 skipped, 150 xfailed, 61 xpassed, 528 warnings in 1798.26s (0:29:58) = error: Bad exit status from /var/tmp/rpm-tmp.K1YMlG (%check) RPM build errors: Bad exit status from /var/tmp/rpm-tmp.K1YMlG (%check) Child return code was: 1 EXCEPTION: [Error('Command failed: \n # bash --login -c /usr/bin/rpmbuild -ba --noprep --noclean --target noarch --nodeps /builddir/build/SPECS/python-xarray.spec\n', 1)] Traceback (most recent call last): File "/usr/lib/python3.11/site-packages/mockbuild/trace_decorator.py", line 93, in trace result = func(*args, **kw) ^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/mockbuild/util.py", line 598, in do_with_status raise exception.Error("Command failed: \n # %s\n%s" % (command, output), child.returncode) mockbuild.exception.Error: Command failed: # bash --login -c /usr/bin/rpmbuild -ba --noprep --noclean --target noarch --nodeps /builddir/build/SPECS/python-xarray.spec