xarray 2024.2.0__tar.gz → 2024.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {xarray-2024.2.0 → xarray-2024.3.0}/.github/workflows/ci-additional.yaml +4 -4
- {xarray-2024.2.0 → xarray-2024.3.0}/.github/workflows/ci.yaml +1 -1
- {xarray-2024.2.0 → xarray-2024.3.0}/.github/workflows/nightly-wheels.yml +1 -1
- {xarray-2024.2.0 → xarray-2024.3.0}/.github/workflows/pypi-release.yaml +2 -2
- {xarray-2024.2.0 → xarray-2024.3.0}/.github/workflows/upstream-dev-ci.yaml +2 -2
- {xarray-2024.2.0/xarray.egg-info → xarray-2024.3.0}/PKG-INFO +1 -1
- {xarray-2024.2.0 → xarray-2024.3.0}/ci/install-upstream-wheels.sh +17 -5
- {xarray-2024.2.0 → xarray-2024.3.0}/ci/requirements/all-but-dask.yml +1 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/ci/requirements/doc.yml +1 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/ci/requirements/environment-3.12.yml +2 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/ci/requirements/environment-windows-3.12.yml +2 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/ci/requirements/environment-windows.yml +2 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/ci/requirements/environment.yml +1 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/ci/requirements/min-all-deps.yml +1 -0
- xarray-2024.3.0/design_notes/grouper_objects.md +240 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/design_notes/named_array_design_doc.md +33 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/conf.py +11 -11
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/user-guide/indexing.rst +5 -2
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/whats-new.rst +83 -2
- {xarray-2024.2.0 → xarray-2024.3.0}/pyproject.toml +1 -1
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/__init__.py +0 -1
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/backends/api.py +6 -14
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/backends/common.py +4 -4
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/backends/h5netcdf_.py +12 -9
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/backends/netCDF4_.py +1 -1
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/backends/scipy_.py +19 -2
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/backends/zarr.py +22 -9
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/coding/cftime_offsets.py +6 -2
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/coding/strings.py +19 -2
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/coding/variables.py +154 -59
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/core/_aggregations.py +0 -104
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/core/common.py +10 -32
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/core/coordinates.py +5 -2
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/core/dataarray.py +37 -17
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/core/dataset.py +19 -12
- xarray-2024.3.0/xarray/core/datatree.py +1559 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/core/groupby.py +287 -159
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/core/indexing.py +432 -180
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/core/merge.py +1 -21
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/core/options.py +3 -0
- xarray-2024.3.0/xarray/core/treenode.py +679 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/core/utils.py +2 -2
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/core/variable.py +57 -20
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/namedarray/core.py +4 -5
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/namedarray/parallelcompat.py +10 -3
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/namedarray/utils.py +2 -2
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/plot/dataarray_plot.py +3 -2
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/plot/utils.py +2 -2
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/__init__.py +18 -1
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/conftest.py +62 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_array_api.py +13 -6
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_backends.py +177 -58
- xarray-2024.2.0/xarray/tests/datatree/test_io.py → xarray-2024.3.0/xarray/tests/test_backends_datatree.py +33 -37
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_cftime_offsets.py +44 -1
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_coding.py +8 -7
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_coding_strings.py +1 -1
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_conventions.py +13 -2
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_coordinates.py +11 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_dask.py +24 -11
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_dataarray.py +39 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_dataset.py +43 -53
- xarray-2024.3.0/xarray/tests/test_datatree.py +732 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_groupby.py +153 -83
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_indexes.py +6 -5
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_indexing.py +89 -6
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_interp.py +3 -1
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_missing.py +6 -3
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_parallelcompat.py +12 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_plot.py +20 -6
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_sparse.py +0 -4
- xarray-2024.3.0/xarray/tests/test_treenode.py +405 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_variable.py +37 -3
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/util/generate_aggregations.py +19 -12
- {xarray-2024.2.0 → xarray-2024.3.0/xarray.egg-info}/PKG-INFO +1 -1
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray.egg-info/SOURCES.txt +6 -2
- xarray-2024.2.0/xarray/tests/datatree/conftest.py +0 -65
- {xarray-2024.2.0 → xarray-2024.3.0}/.binder/environment.yml +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/.codecov.yml +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/.git-blame-ignore-revs +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/.git_archival.txt +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/.gitattributes +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/.github/FUNDING.yml +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/.github/ISSUE_TEMPLATE/bugreport.yml +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/.github/ISSUE_TEMPLATE/config.yml +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/.github/ISSUE_TEMPLATE/misc.yml +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/.github/ISSUE_TEMPLATE/newfeature.yml +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/.github/config.yml +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/.github/dependabot.yml +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/.github/stale.yml +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/.github/workflows/benchmarks-last-release.yml +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/.github/workflows/benchmarks.yml +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/.github/workflows/configure-testpypi-version.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/.github/workflows/publish-test-results.yaml +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/.gitignore +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/.pep8speaks.yml +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/.pre-commit-config.yaml +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/.readthedocs.yaml +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/CITATION.cff +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/CODE_OF_CONDUCT.md +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/CONTRIBUTING.md +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/CORE_TEAM_GUIDE.md +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/HOW_TO_RELEASE.md +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/LICENSE +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/MANIFEST.in +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/README.md +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/asv_bench/asv.conf.json +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/asv_bench/benchmarks/README_CI.md +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/asv_bench/benchmarks/__init__.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/asv_bench/benchmarks/accessors.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/asv_bench/benchmarks/alignment.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/asv_bench/benchmarks/combine.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/asv_bench/benchmarks/dataarray_missing.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/asv_bench/benchmarks/dataset.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/asv_bench/benchmarks/dataset_io.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/asv_bench/benchmarks/groupby.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/asv_bench/benchmarks/import.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/asv_bench/benchmarks/indexing.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/asv_bench/benchmarks/interp.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/asv_bench/benchmarks/merge.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/asv_bench/benchmarks/pandas.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/asv_bench/benchmarks/polyfit.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/asv_bench/benchmarks/reindexing.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/asv_bench/benchmarks/renaming.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/asv_bench/benchmarks/repr.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/asv_bench/benchmarks/rolling.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/asv_bench/benchmarks/unstacking.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/ci/min_deps_check.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/ci/requirements/bare-minimum.yml +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/conftest.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/design_notes/flexible_indexes_notes.md +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/Makefile +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/README.rst +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/_static/.gitignore +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/_static/advanced_selection_interpolation.svg +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/_static/ci.png +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/_static/dask_array.png +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/_static/dataset-diagram.png +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/_static/index_api.svg +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/_static/index_contribute.svg +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/_static/index_getting_started.svg +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/_static/index_user_guide.svg +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/_static/logos/Xarray_Icon_Final.png +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/_static/logos/Xarray_Icon_Final.svg +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/_static/logos/Xarray_Logo_FullColor_InverseRGB_Final.png +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/_static/logos/Xarray_Logo_FullColor_InverseRGB_Final.svg +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/_static/logos/Xarray_Logo_RGB_Final.png +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/_static/logos/Xarray_Logo_RGB_Final.svg +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/_static/numfocus_logo.png +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/_static/opendap-prism-tmax.png +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/_static/style.css +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/_static/thumbnails/ERA5-GRIB-example.png +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/_static/thumbnails/ROMS_ocean_model.png +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/_static/thumbnails/area_weighted_temperature.png +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/_static/thumbnails/monthly-means.png +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/_static/thumbnails/multidimensional-coords.png +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/_static/thumbnails/toy-weather-data.png +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/_static/thumbnails/visualization_gallery.png +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/_static/view-docs.png +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/_templates/autosummary/accessor.rst +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/_templates/autosummary/accessor_attribute.rst +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/_templates/autosummary/accessor_callable.rst +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/_templates/autosummary/accessor_method.rst +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/api-hidden.rst +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/api.rst +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/contributing.rst +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/developers-meeting.rst +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/ecosystem.rst +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/examples/ERA5-GRIB-example.ipynb +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/examples/ROMS_ocean_model.ipynb +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/examples/_code/accessor_example.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/examples/apply_ufunc_vectorize_1d.ipynb +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/examples/area_weighted_temperature.ipynb +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/examples/blank_template.ipynb +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/examples/monthly-means.ipynb +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/examples/monthly_means_output.png +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/examples/multidimensional-coords.ipynb +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/examples/visualization_gallery.ipynb +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/examples/weather-data.ipynb +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/gallery/README.txt +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/gallery/plot_cartopy_facetgrid.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/gallery/plot_colorbar_center.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/gallery/plot_control_colorbar.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/gallery/plot_lines_from_2d.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/gallery.rst +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/gallery.yml +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/getting-started-guide/faq.rst +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/getting-started-guide/index.rst +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/getting-started-guide/installing.rst +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/getting-started-guide/quick-overview.rst +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/getting-started-guide/why-xarray.rst +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/howdoi.rst +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/index.rst +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/internals/chunked-arrays.rst +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/internals/duck-arrays-integration.rst +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/internals/extending-xarray.rst +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/internals/how-to-add-new-backend.rst +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/internals/how-to-create-custom-index.rst +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/internals/index.rst +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/internals/internal-design.rst +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/internals/interoperability.rst +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/internals/zarr-encoding-spec.rst +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/roadmap.rst +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/tutorials-and-videos.rst +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/user-guide/combining.rst +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/user-guide/computation.rst +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/user-guide/dask.rst +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/user-guide/data-structures.rst +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/user-guide/duckarrays.rst +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/user-guide/groupby.rst +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/user-guide/index.rst +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/user-guide/interpolation.rst +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/user-guide/io.rst +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/user-guide/options.rst +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/user-guide/pandas.rst +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/user-guide/plotting.rst +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/user-guide/reshaping.rst +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/user-guide/terminology.rst +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/user-guide/testing.rst +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/user-guide/time-series.rst +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/user-guide/weather-climate.rst +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/doc/videos.yml +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/licenses/DASK_LICENSE +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/licenses/ICOMOON_LICENSE +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/licenses/NUMPY_LICENSE +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/licenses/PANDAS_LICENSE +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/licenses/PYTHON_LICENSE +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/licenses/SCIKIT_LEARN_LICENSE +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/licenses/SEABORN_LICENSE +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/properties/README.md +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/properties/conftest.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/properties/test_encode_decode.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/properties/test_pandas_roundtrip.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/setup.cfg +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/setup.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/backends/__init__.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/backends/file_manager.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/backends/locks.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/backends/lru_cache.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/backends/memory.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/backends/netcdf3.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/backends/plugins.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/backends/pydap_.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/backends/pynio_.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/backends/store.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/coding/__init__.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/coding/calendar_ops.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/coding/cftimeindex.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/coding/frequencies.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/coding/times.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/conventions.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/convert.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/core/__init__.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/core/_typed_ops.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/core/accessor_dt.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/core/accessor_str.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/core/alignment.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/core/arithmetic.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/core/combine.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/core/computation.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/core/concat.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/core/dask_array_ops.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/core/dtypes.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/core/duck_array_ops.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/core/extensions.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/core/formatting.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/core/formatting_html.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/core/indexes.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/core/missing.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/core/nanops.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/core/npcompat.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/core/nputils.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/core/ops.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/core/parallel.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/core/pdcompat.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/core/resample.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/core/resample_cftime.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/core/rolling.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/core/rolling_exp.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/core/types.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/core/weighted.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/indexes/__init__.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/namedarray/__init__.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/namedarray/_aggregations.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/namedarray/_array_api.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/namedarray/_typing.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/namedarray/daskmanager.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/namedarray/dtypes.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/namedarray/pycompat.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/plot/__init__.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/plot/accessor.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/plot/dataset_plot.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/plot/facetgrid.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/py.typed +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/static/__init__.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/static/css/__init__.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/static/css/style.css +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/static/html/__init__.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/static/html/icons-svg-inline.html +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/testing/__init__.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/testing/assertions.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/testing/strategies.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/data/bears.nc +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/data/example.grib +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/data/example.ict +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/data/example.uamiv +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/data/example_1.nc +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/data/example_1.nc.gz +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_accessor_dt.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_accessor_str.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_assertions.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_backends_api.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_backends_common.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_backends_file_manager.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_backends_locks.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_backends_lru_cache.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_calendar_ops.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_cftimeindex.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_cftimeindex_resample.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_coarsen.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_coding_times.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_combine.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_computation.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_concat.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_cupy.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_deprecation_helpers.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_distributed.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_dtypes.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_duck_array_ops.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_error_messages.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_extensions.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_formatting.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_formatting_html.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_hashable.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_merge.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_namedarray.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_nputils.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_options.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_plugins.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_print_versions.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_rolling.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_strategies.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_tutorial.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_typed_ops.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_ufuncs.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_units.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_utils.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tests/test_weighted.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/tutorial.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/util/__init__.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/util/deprecation_helpers.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/util/generate_ops.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray/util/print_versions.py +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray.egg-info/dependency_links.txt +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray.egg-info/entry_points.txt +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray.egg-info/requires.txt +0 -0
- {xarray-2024.2.0 → xarray-2024.3.0}/xarray.egg-info/top_level.txt +0 -0
|
@@ -128,7 +128,7 @@ jobs:
|
|
|
128
128
|
python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report xarray/
|
|
129
129
|
|
|
130
130
|
- name: Upload mypy coverage to Codecov
|
|
131
|
-
uses: codecov/codecov-action@v4.0
|
|
131
|
+
uses: codecov/codecov-action@v4.1.0
|
|
132
132
|
with:
|
|
133
133
|
file: mypy_report/cobertura.xml
|
|
134
134
|
flags: mypy
|
|
@@ -182,7 +182,7 @@ jobs:
|
|
|
182
182
|
python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report xarray/
|
|
183
183
|
|
|
184
184
|
- name: Upload mypy coverage to Codecov
|
|
185
|
-
uses: codecov/codecov-action@v4.0
|
|
185
|
+
uses: codecov/codecov-action@v4.1.0
|
|
186
186
|
with:
|
|
187
187
|
file: mypy_report/cobertura.xml
|
|
188
188
|
flags: mypy39
|
|
@@ -243,7 +243,7 @@ jobs:
|
|
|
243
243
|
python -m pyright xarray/
|
|
244
244
|
|
|
245
245
|
- name: Upload pyright coverage to Codecov
|
|
246
|
-
uses: codecov/codecov-action@v4.0
|
|
246
|
+
uses: codecov/codecov-action@v4.1.0
|
|
247
247
|
with:
|
|
248
248
|
file: pyright_report/cobertura.xml
|
|
249
249
|
flags: pyright
|
|
@@ -302,7 +302,7 @@ jobs:
|
|
|
302
302
|
python -m pyright xarray/
|
|
303
303
|
|
|
304
304
|
- name: Upload pyright coverage to Codecov
|
|
305
|
-
uses: codecov/codecov-action@v4.0
|
|
305
|
+
uses: codecov/codecov-action@v4.1.0
|
|
306
306
|
with:
|
|
307
307
|
file: pyright_report/cobertura.xml
|
|
308
308
|
flags: pyright39
|
|
@@ -38,7 +38,7 @@ jobs:
|
|
|
38
38
|
fi
|
|
39
39
|
|
|
40
40
|
- name: Upload wheel
|
|
41
|
-
uses: scientific-python/upload-nightly-action@
|
|
41
|
+
uses: scientific-python/upload-nightly-action@b67d7fcc0396e1128a474d1ab2b48aa94680f9fc # 0.5.0
|
|
42
42
|
with:
|
|
43
43
|
anaconda_nightly_upload_token: ${{ secrets.ANACONDA_NIGHTLY }}
|
|
44
44
|
artifacts_path: dist
|
|
@@ -88,7 +88,7 @@ jobs:
|
|
|
88
88
|
path: dist
|
|
89
89
|
- name: Publish package to TestPyPI
|
|
90
90
|
if: github.event_name == 'push'
|
|
91
|
-
uses: pypa/gh-action-pypi-publish@v1.8.
|
|
91
|
+
uses: pypa/gh-action-pypi-publish@v1.8.14
|
|
92
92
|
with:
|
|
93
93
|
repository_url: https://test.pypi.org/legacy/
|
|
94
94
|
verbose: true
|
|
@@ -111,6 +111,6 @@ jobs:
|
|
|
111
111
|
name: releases
|
|
112
112
|
path: dist
|
|
113
113
|
- name: Publish package to PyPI
|
|
114
|
-
uses: pypa/gh-action-pypi-publish@v1.8.
|
|
114
|
+
uses: pypa/gh-action-pypi-publish@v1.8.14
|
|
115
115
|
with:
|
|
116
116
|
verbose: true
|
|
@@ -52,7 +52,7 @@ jobs:
|
|
|
52
52
|
strategy:
|
|
53
53
|
fail-fast: false
|
|
54
54
|
matrix:
|
|
55
|
-
python-version: ["3.
|
|
55
|
+
python-version: ["3.12"]
|
|
56
56
|
steps:
|
|
57
57
|
- uses: actions/checkout@v4
|
|
58
58
|
with:
|
|
@@ -143,7 +143,7 @@ jobs:
|
|
|
143
143
|
run: |
|
|
144
144
|
python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report
|
|
145
145
|
- name: Upload mypy coverage to Codecov
|
|
146
|
-
uses: codecov/codecov-action@v4.0
|
|
146
|
+
uses: codecov/codecov-action@v4.1.0
|
|
147
147
|
with:
|
|
148
148
|
file: mypy_report/cobertura.xml
|
|
149
149
|
flags: mypy
|
|
@@ -3,11 +3,13 @@
|
|
|
3
3
|
# install cython for building cftime without build isolation
|
|
4
4
|
micromamba install "cython>=0.29.20" py-cpuinfo
|
|
5
5
|
# temporarily (?) remove numbagg and numba
|
|
6
|
-
micromamba remove -y numba numbagg
|
|
6
|
+
micromamba remove -y numba numbagg sparse
|
|
7
|
+
# temporarily remove numexpr
|
|
8
|
+
micromamba remove -y numexpr
|
|
7
9
|
# temporarily remove backends
|
|
8
|
-
micromamba remove -y cf_units h5py
|
|
10
|
+
micromamba remove -y cf_units hdf5 h5py netcdf4
|
|
9
11
|
# forcibly remove packages to avoid artifacts
|
|
10
|
-
|
|
12
|
+
micromamba remove -y --force \
|
|
11
13
|
numpy \
|
|
12
14
|
scipy \
|
|
13
15
|
pandas \
|
|
@@ -30,8 +32,17 @@ python -m pip install \
|
|
|
30
32
|
scipy \
|
|
31
33
|
matplotlib \
|
|
32
34
|
pandas
|
|
35
|
+
# for some reason pandas depends on pyarrow already.
|
|
36
|
+
# Remove once a `pyarrow` version compiled with `numpy>=2.0` is on `conda-forge`
|
|
37
|
+
python -m pip install \
|
|
38
|
+
-i https://pypi.fury.io/arrow-nightlies/ \
|
|
39
|
+
--prefer-binary \
|
|
40
|
+
--no-deps \
|
|
41
|
+
--pre \
|
|
42
|
+
--upgrade \
|
|
43
|
+
pyarrow
|
|
33
44
|
# without build isolation for packages compiling against numpy
|
|
34
|
-
# TODO: remove once there are `numpy>=2.0` builds for
|
|
45
|
+
# TODO: remove once there are `numpy>=2.0` builds for these
|
|
35
46
|
python -m pip install \
|
|
36
47
|
--no-deps \
|
|
37
48
|
--upgrade \
|
|
@@ -51,13 +62,14 @@ python -m pip install \
|
|
|
51
62
|
--no-deps \
|
|
52
63
|
--upgrade \
|
|
53
64
|
git+https://github.com/dask/dask \
|
|
65
|
+
git+https://github.com/dask/dask-expr \
|
|
54
66
|
git+https://github.com/dask/distributed \
|
|
55
67
|
git+https://github.com/zarr-developers/zarr \
|
|
56
68
|
git+https://github.com/pypa/packaging \
|
|
57
69
|
git+https://github.com/hgrecco/pint \
|
|
58
|
-
git+https://github.com/pydata/sparse \
|
|
59
70
|
git+https://github.com/intake/filesystem_spec \
|
|
60
71
|
git+https://github.com/SciTools/nc-time-axis \
|
|
61
72
|
git+https://github.com/xarray-contrib/flox \
|
|
62
73
|
git+https://github.com/dgasmith/opt_einsum
|
|
74
|
+
# git+https://github.com/pydata/sparse
|
|
63
75
|
# git+https://github.com/h5netcdf/h5netcdf
|
|
@@ -8,6 +8,7 @@ dependencies:
|
|
|
8
8
|
# When upgrading python, numpy, or pandas, must also change
|
|
9
9
|
# doc/user-guide/installing.rst, doc/user-guide/plotting.rst and setup.py.
|
|
10
10
|
- python=3.9
|
|
11
|
+
- array-api-strict=1.0 # dependency for testing the array api compat
|
|
11
12
|
- boto3=1.24
|
|
12
13
|
- bottleneck=1.3
|
|
13
14
|
- cartopy=0.21
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
# Grouper Objects
|
|
2
|
+
**Author**: Deepak Cherian <deepak@cherian.net>
|
|
3
|
+
**Created**: Nov 21, 2023
|
|
4
|
+
|
|
5
|
+
## Abstract
|
|
6
|
+
|
|
7
|
+
I propose the addition of Grouper objects to Xarray's public API so that
|
|
8
|
+
```python
|
|
9
|
+
Dataset.groupby(x=BinGrouper(bins=np.arange(10, 2))))
|
|
10
|
+
```
|
|
11
|
+
is identical to today's syntax:
|
|
12
|
+
```python
|
|
13
|
+
Dataset.groupby_bins("x", bins=np.arange(10, 2))
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Motivation and scope
|
|
17
|
+
|
|
18
|
+
Xarray's GroupBy API implements the split-apply-combine pattern (Wickham, 2011)[^1], which applies to a very large number of problems: histogramming, compositing, climatological averaging, resampling to a different time frequency, etc.
|
|
19
|
+
The pattern abstracts the following pseudocode:
|
|
20
|
+
```python
|
|
21
|
+
results = []
|
|
22
|
+
for element in unique_labels:
|
|
23
|
+
subset = ds.sel(x=(ds.x == element)) # split
|
|
24
|
+
# subset = ds.where(ds.x == element, drop=True) # alternative
|
|
25
|
+
result = subset.mean() # apply
|
|
26
|
+
results.append(result)
|
|
27
|
+
|
|
28
|
+
xr.concat(results) # combine
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
to
|
|
32
|
+
```python
|
|
33
|
+
ds.groupby('x').mean() # splits, applies, and combines
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Efficient vectorized implementations of this pattern are implemented in numpy's [`ufunc.at`](https://numpy.org/doc/stable/reference/generated/numpy.ufunc.at.html), [`ufunc.reduceat`](https://numpy.org/doc/stable/reference/generated/numpy.ufunc.reduceat.html), [`numbagg.grouped`](https://github.com/numbagg/numbagg/blob/main/numbagg/grouped.py), [`numpy_groupies`](https://github.com/ml31415/numpy-groupies), and probably more.
|
|
37
|
+
These vectorized implementations *all* require, as input, an array of integer codes or labels that identify unique elements in the array being grouped over (`'x'` in the example above).
|
|
38
|
+
```python
|
|
39
|
+
import numpy as np
|
|
40
|
+
|
|
41
|
+
# array to reduce
|
|
42
|
+
a = np.array([1, 1, 1, 1, 2])
|
|
43
|
+
|
|
44
|
+
# initial value for result
|
|
45
|
+
out = np.zeros((3,), dtype=int)
|
|
46
|
+
|
|
47
|
+
# integer codes
|
|
48
|
+
labels = np.array([0, 0, 1, 2, 1])
|
|
49
|
+
|
|
50
|
+
# groupby-reduction
|
|
51
|
+
np.add.at(out, labels, a)
|
|
52
|
+
out # array([2, 3, 1])
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
One can 'factorize' or construct such an array of integer codes using `pandas.factorize` or `numpy.unique(..., return_inverse=True)` for categorical arrays; `pandas.cut`, `pandas.qcut`, or `np.digitize` for discretizing continuous variables.
|
|
56
|
+
In practice, since `GroupBy` objects exist, much of complexity in applying the groupby paradigm stems from appropriately factorizing or generating labels for the operation.
|
|
57
|
+
Consider these two examples:
|
|
58
|
+
1. [Bins that vary in a dimension](https://flox.readthedocs.io/en/latest/user-stories/nD-bins.html)
|
|
59
|
+
2. [Overlapping groups](https://flox.readthedocs.io/en/latest/user-stories/overlaps.html)
|
|
60
|
+
3. [Rolling resampling](https://github.com/pydata/xarray/discussions/8361)
|
|
61
|
+
|
|
62
|
+
Anecdotally, less experienced users commonly resort to the for-loopy implementation illustrated by the pseudocode above when the analysis at hand is not easily expressed using the API presented by Xarray's GroupBy object.
|
|
63
|
+
Xarray's GroupBy API today abstracts away the split, apply, and combine stages but not the "factorize" stage.
|
|
64
|
+
Grouper objects will close the gap.
|
|
65
|
+
|
|
66
|
+
## Usage and impact
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
Grouper objects
|
|
70
|
+
1. Will abstract useful factorization algorithms, and
|
|
71
|
+
2. Present a natural way to extend GroupBy to grouping by multiple variables: `ds.groupby(x=BinGrouper(...), t=Resampler(freq="M", ...)).mean()`.
|
|
72
|
+
|
|
73
|
+
In addition, Grouper objects provide a nice interface to add often-requested grouping functionality
|
|
74
|
+
1. A new `SpaceResampler` would allow specifying resampling spatial dimensions. ([issue](https://github.com/pydata/xarray/issues/4008))
|
|
75
|
+
2. `RollingTimeResampler` would allow rolling-like functionality that understands timestamps ([issue](https://github.com/pydata/xarray/issues/3216))
|
|
76
|
+
3. A `QuantileBinGrouper` to abstract away `pd.cut` ([issue](https://github.com/pydata/xarray/discussions/7110))
|
|
77
|
+
4. A `SeasonGrouper` and `SeasonResampler` would abstract away common annoyances with such calculations today
|
|
78
|
+
1. Support seasons that span a year-end.
|
|
79
|
+
2. Only include seasons with complete data coverage.
|
|
80
|
+
3. Allow grouping over seasons of unequal length
|
|
81
|
+
4. See [this xcdat discussion](https://github.com/xCDAT/xcdat/issues/416) for a `SeasonGrouper` like functionality:
|
|
82
|
+
5. Return results with seasons in a sensible order
|
|
83
|
+
5. Weighted grouping ([issue](https://github.com/pydata/xarray/issues/3937))
|
|
84
|
+
1. Once `IntervalIndex` like objects are supported, `Resampler` groupers can account for interval lengths when resampling.
|
|
85
|
+
|
|
86
|
+
## Backward Compatibility
|
|
87
|
+
|
|
88
|
+
Xarray's existing grouping functionality will be exposed using two new Groupers:
|
|
89
|
+
1. `UniqueGrouper` which uses `pandas.factorize`
|
|
90
|
+
2. `BinGrouper` which uses `pandas.cut`
|
|
91
|
+
3. `TimeResampler` which mimics pandas' `.resample`
|
|
92
|
+
|
|
93
|
+
Grouping by single variables will be unaffected so that `ds.groupby('x')` will be identical to `ds.groupby(x=UniqueGrouper())`.
|
|
94
|
+
Similarly, `ds.groupby_bins('x', bins=np.arange(10, 2))` will be unchanged and identical to `ds.groupby(x=BinGrouper(bins=np.arange(10, 2)))`.
|
|
95
|
+
|
|
96
|
+
## Detailed description
|
|
97
|
+
|
|
98
|
+
All Grouper objects will subclass from a Grouper object
|
|
99
|
+
```python
|
|
100
|
+
import abc
|
|
101
|
+
|
|
102
|
+
class Grouper(abc.ABC):
|
|
103
|
+
@abc.abstractmethod
|
|
104
|
+
def factorize(self, by: DataArray):
|
|
105
|
+
raise NotImplementedError
|
|
106
|
+
|
|
107
|
+
class CustomGrouper(Grouper):
|
|
108
|
+
def factorize(self, by: DataArray):
|
|
109
|
+
...
|
|
110
|
+
return codes, group_indices, unique_coord, full_index
|
|
111
|
+
|
|
112
|
+
def weights(self, by: DataArray) -> DataArray:
|
|
113
|
+
...
|
|
114
|
+
return weights
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### The `factorize` method
|
|
118
|
+
Today, the `factorize` method takes as input the group variable and returns 4 variables (I propose to clean this up below):
|
|
119
|
+
1. `codes`: An array of same shape as the `group` with int dtype. NaNs in `group` are coded by `-1` and ignored later.
|
|
120
|
+
2. `group_indices` is a list of index location of `group` elements that belong to a single group.
|
|
121
|
+
3. `unique_coord` is (usually) a `pandas.Index` object of all unique `group` members present in `group`.
|
|
122
|
+
4. `full_index` is a `pandas.Index` of all `group` members. This is different from `unique_coord` for binning and resampling, where not all groups in the output may be represented in the input `group`. For grouping by a categorical variable e.g. `['a', 'b', 'a', 'c']`, `full_index` and `unique_coord` are identical.
|
|
123
|
+
There is some redundancy here since `unique_coord` is always equal to or a subset of `full_index`.
|
|
124
|
+
We can clean this up (see Implementation below).
|
|
125
|
+
|
|
126
|
+
### The `weights` method (?)
|
|
127
|
+
|
|
128
|
+
The proposed `weights` method is optional and unimplemented today.
|
|
129
|
+
Groupers with `weights` will allow composing `weighted` and `groupby` ([issue](https://github.com/pydata/xarray/issues/3937)).
|
|
130
|
+
The `weights` method should return an appropriate array of weights such that the following property is satisfied
|
|
131
|
+
```python
|
|
132
|
+
gb_sum = ds.groupby(by).sum()
|
|
133
|
+
|
|
134
|
+
weights = CustomGrouper.weights(by)
|
|
135
|
+
weighted_sum = xr.dot(ds, weights)
|
|
136
|
+
|
|
137
|
+
assert_identical(gb_sum, weighted_sum)
|
|
138
|
+
```
|
|
139
|
+
For example, the boolean weights for `group=np.array(['a', 'b', 'c', 'a', 'a'])` should be
|
|
140
|
+
```
|
|
141
|
+
[[1, 0, 0, 1, 1],
|
|
142
|
+
[0, 1, 0, 0, 0],
|
|
143
|
+
[0, 0, 1, 0, 0]]
|
|
144
|
+
```
|
|
145
|
+
This is the boolean "summarization matrix" referred to in the classic Iverson (1980, Section 4.3)[^2] and "nub sieve" in [various APLs](https://aplwiki.com/wiki/Nub_Sieve).
|
|
146
|
+
|
|
147
|
+
> [!NOTE]
|
|
148
|
+
> We can always construct `weights` automatically using `group_indices` from `factorize`, so this is not a required method.
|
|
149
|
+
|
|
150
|
+
For a rolling resampling, windowed weights are possible
|
|
151
|
+
```
|
|
152
|
+
[[0.5, 1, 0.5, 0, 0],
|
|
153
|
+
[0, 0.25, 1, 1, 0],
|
|
154
|
+
[0, 0, 0, 1, 1]]
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### The `preferred_chunks` method (?)
|
|
158
|
+
|
|
159
|
+
Rechunking support is another optional extension point.
|
|
160
|
+
In `flox` I experimented some with automatically rechunking to make a groupby more parallel-friendly ([example 1](https://flox.readthedocs.io/en/latest/generated/flox.rechunk_for_blockwise.html), [example 2](https://flox.readthedocs.io/en/latest/generated/flox.rechunk_for_cohorts.html)).
|
|
161
|
+
A great example is for resampling-style groupby reductions, for which `codes` might look like
|
|
162
|
+
```
|
|
163
|
+
0001|11122|3333
|
|
164
|
+
```
|
|
165
|
+
where `|` represents chunk boundaries. A simple rechunking to
|
|
166
|
+
```
|
|
167
|
+
000|111122|3333
|
|
168
|
+
```
|
|
169
|
+
would make this resampling reduction an embarassingly parallel blockwise problem.
|
|
170
|
+
|
|
171
|
+
Similarly consider monthly-mean climatologies for which the month numbers might be
|
|
172
|
+
```
|
|
173
|
+
1 2 3 4 5 | 6 7 8 9 10 | 11 12 1 2 3 | 4 5 6 7 8 | 9 10 11 12 |
|
|
174
|
+
```
|
|
175
|
+
A slight rechunking to
|
|
176
|
+
```
|
|
177
|
+
1 2 3 4 | 5 6 7 8 | 9 10 11 12 | 1 2 3 4 | 5 6 7 8 | 9 10 11 12 |
|
|
178
|
+
```
|
|
179
|
+
allows us to reduce `1, 2, 3, 4` separately from `5,6,7,8` and `9, 10, 11, 12` while still being parallel friendly (see the [flox documentation](https://flox.readthedocs.io/en/latest/implementation.html#method-cohorts) for more).
|
|
180
|
+
|
|
181
|
+
We could attempt to detect these patterns, or we could just have the Grouper take as input `chunks` and return a tuple of "nice" chunk sizes to rechunk to.
|
|
182
|
+
```python
|
|
183
|
+
def preferred_chunks(self, chunks: ChunksTuple) -> ChunksTuple:
|
|
184
|
+
pass
|
|
185
|
+
```
|
|
186
|
+
For monthly means, since the period of repetition of labels is 12, the Grouper might choose possible chunk sizes of `((2,),(3,),(4,),(6,))`.
|
|
187
|
+
For resampling, the Grouper could choose to resample to a multiple or an even fraction of the resampling frequency.
|
|
188
|
+
|
|
189
|
+
## Related work
|
|
190
|
+
|
|
191
|
+
Pandas has [Grouper objects](https://pandas.pydata.org/docs/reference/api/pandas.Grouper.html#pandas-grouper) that represent the GroupBy instruction.
|
|
192
|
+
However, these objects do not appear to be extension points, unlike the Grouper objects proposed here.
|
|
193
|
+
Instead, Pandas' `ExtensionArray` has a [`factorize`](https://pandas.pydata.org/docs/reference/api/pandas.api.extensions.ExtensionArray.factorize.html) method.
|
|
194
|
+
|
|
195
|
+
Composing rolling with time resampling is a common workload:
|
|
196
|
+
1. Polars has [`group_by_dynamic`](https://pola-rs.github.io/polars/py-polars/html/reference/dataframe/api/polars.DataFrame.group_by_dynamic.html) which appears to be like the proposed `RollingResampler`.
|
|
197
|
+
2. scikit-downscale provides [`PaddedDOYGrouper`](
|
|
198
|
+
https://github.com/pangeo-data/scikit-downscale/blob/e16944a32b44f774980fa953ea18e29a628c71b8/skdownscale/pointwise_models/groupers.py#L19)
|
|
199
|
+
|
|
200
|
+
## Implementation Proposal
|
|
201
|
+
|
|
202
|
+
1. Get rid of `squeeze` [issue](https://github.com/pydata/xarray/issues/2157): [PR](https://github.com/pydata/xarray/pull/8506)
|
|
203
|
+
2. Merge existing two class implementation to a single Grouper class
|
|
204
|
+
1. This design was implemented in [this PR](https://github.com/pydata/xarray/pull/7206) to account for some annoying data dependencies.
|
|
205
|
+
2. See [PR](https://github.com/pydata/xarray/pull/8509)
|
|
206
|
+
3. Clean up what's returned by `factorize` methods.
|
|
207
|
+
1. A solution here might be to have `group_indices: Mapping[int, Sequence[int]]` be a mapping from group index in `full_index` to a sequence of integers.
|
|
208
|
+
2. Return a `namedtuple` or `dataclass` from existing Grouper factorize methods to facilitate API changes in the future.
|
|
209
|
+
4. Figure out what to pass to `factorize`
|
|
210
|
+
1. Xarray eagerly reshapes nD variables to 1D. This is an implementation detail we need not expose.
|
|
211
|
+
2. When grouping by an unindexed variable Xarray passes a `_DummyGroup` object. This seems like something we don't want in the public interface. We could special case "internal" Groupers to preserve the optimizations in `UniqueGrouper`.
|
|
212
|
+
5. Grouper objects will exposed under the `xr.groupers` Namespace. At first these will include `UniqueGrouper`, `BinGrouper`, and `TimeResampler`.
|
|
213
|
+
|
|
214
|
+
## Alternatives
|
|
215
|
+
|
|
216
|
+
One major design choice made here was to adopt the syntax `ds.groupby(x=BinGrouper(...))` instead of `ds.groupby(BinGrouper('x', ...))`.
|
|
217
|
+
This allows reuse of Grouper objects, example
|
|
218
|
+
```python
|
|
219
|
+
grouper = BinGrouper(...)
|
|
220
|
+
ds.groupby(x=grouper, y=grouper)
|
|
221
|
+
```
|
|
222
|
+
but requires that all variables being grouped by (`x` and `y` above) are present in Dataset `ds`. This does not seem like a bad requirement.
|
|
223
|
+
Importantly `Grouper` instances will be copied internally so that they can safely cache state that might be shared between `factorize` and `weights`.
|
|
224
|
+
|
|
225
|
+
Today, it is possible to `ds.groupby(DataArray, ...)`. This syntax will still be supported.
|
|
226
|
+
|
|
227
|
+
## Discussion
|
|
228
|
+
|
|
229
|
+
This proposal builds on these discussions:
|
|
230
|
+
1. https://github.com/xarray-contrib/flox/issues/191#issuecomment-1328898836
|
|
231
|
+
2. https://github.com/pydata/xarray/issues/6610
|
|
232
|
+
|
|
233
|
+
## Copyright
|
|
234
|
+
|
|
235
|
+
This document has been placed in the public domain.
|
|
236
|
+
|
|
237
|
+
## References and footnotes
|
|
238
|
+
|
|
239
|
+
[^1]: Wickham, H. (2011). The split-apply-combine strategy for data analysis. https://vita.had.co.nz/papers/plyr.html
|
|
240
|
+
[^2]: Iverson, K.E. (1980). Notation as a tool of thought. Commun. ACM 23, 8 (Aug. 1980), 444–465. https://doi.org/10.1145/358896.358899
|
|
@@ -87,6 +87,39 @@ The named-array package is designed to be interoperable with other scientific Py
|
|
|
87
87
|
|
|
88
88
|
Further implementation details are in Appendix: [Implementation Details](#appendix-implementation-details).
|
|
89
89
|
|
|
90
|
+
## Plan for decoupling lazy indexing functionality from NamedArray
|
|
91
|
+
|
|
92
|
+
Today's implementation Xarray's lazy indexing functionality uses three private objects: `*Indexer`, `*IndexingAdapter`, `*Array`.
|
|
93
|
+
These objects are needed for two reason:
|
|
94
|
+
1. We need to translate from Xarray (NamedArray) indexing rules to bare array indexing rules.
|
|
95
|
+
- `*Indexer` objects track the type of indexing - basic, orthogonal, vectorized
|
|
96
|
+
2. Not all arrays support the same indexing rules, so we need `*Indexing` adapters
|
|
97
|
+
1. Indexing Adapters today implement `__getitem__` and use type of `*Indexer` object to do appropriate conversions.
|
|
98
|
+
3. We also want to support lazy indexing of on-disk arrays.
|
|
99
|
+
1. These again support different types of indexing, so we have `explicit_indexing_adapter` that understands `*Indexer` objects.
|
|
100
|
+
|
|
101
|
+
### Goals
|
|
102
|
+
1. We would like to keep the lazy indexing array objects, and backend array objects within Xarray. Thus NamedArray cannot treat these objects specially.
|
|
103
|
+
2. A key source of confusion (and coupling) is that both lazy indexing arrays and indexing adapters, both handle Indexer objects, and both subclass `ExplicitlyIndexedNDArrayMixin`. These are however conceptually different.
|
|
104
|
+
|
|
105
|
+
### Proposal
|
|
106
|
+
|
|
107
|
+
1. The `NumpyIndexingAdapter`, `DaskIndexingAdapter`, and `ArrayApiIndexingAdapter` classes will need to migrate to Named Array project since we will want to support indexing of numpy, dask, and array-API arrays appropriately.
|
|
108
|
+
2. The `as_indexable` function which wraps an array with the appropriate adapter will also migrate over to named array.
|
|
109
|
+
3. Lazy indexing arrays will implement `__getitem__` for basic indexing, `.oindex` for orthogonal indexing, and `.vindex` for vectorized indexing.
|
|
110
|
+
4. IndexingAdapter classes will similarly implement `__getitem__`, `oindex`, and `vindex`.
|
|
111
|
+
5. `NamedArray.__getitem__` (and `__setitem__`) will still use `*Indexer` objects internally (for e.g. in `NamedArray._broadcast_indexes`), but use `.oindex`, `.vindex` on the underlying indexing adapters.
|
|
112
|
+
6. We will move the `*Indexer` and `*IndexingAdapter` classes to Named Array. These will be considered private in the long-term.
|
|
113
|
+
7. `as_indexable` will no longer special case `ExplicitlyIndexed` objects (we can special case a new `IndexingAdapter` mixin class that will be private to NamedArray). To handle Xarray's lazy indexing arrays, we will introduce a new `ExplicitIndexingAdapter` which will wrap any array with any of `.oindex` of `.vindex` implemented.
|
|
114
|
+
1. This will be the last case in the if-chain that is, we will try to wrap with all other `IndexingAdapter` objects before using `ExplicitIndexingAdapter` as a fallback. This Adapter will be used for the lazy indexing arrays, and backend arrays.
|
|
115
|
+
2. As with other indexing adapters (point 4 above), this `ExplicitIndexingAdapter` will only implement `__getitem__` and will understand `*Indexer` objects.
|
|
116
|
+
8. For backwards compatibility with external backends, we will have to gracefully deprecate `indexing.explicit_indexing_adapter` which translates from Xarray's indexing rules to the indexing supported by the backend.
|
|
117
|
+
1. We could split `explicit_indexing_adapter` in to 3:
|
|
118
|
+
- `basic_indexing_adapter`, `outer_indexing_adapter` and `vectorized_indexing_adapter` for public use.
|
|
119
|
+
2. Implement fall back `.oindex`, `.vindex` properties on `BackendArray` base class. These will simply rewrap the `key` tuple with the appropriate `*Indexer` object, and pass it on to `__getitem__` or `__setitem__`. These methods will also raise DeprecationWarning so that external backends will know to migrate to `.oindex`, and `.vindex` over the next year.
|
|
120
|
+
|
|
121
|
+
THe most uncertain piece here is maintaining backward compatibility with external backends. We should first migrate a single internal backend, and test out the proposed approach.
|
|
122
|
+
|
|
90
123
|
## Project Timeline and Milestones
|
|
91
124
|
|
|
92
125
|
We have identified the following milestones for the completion of this project:
|
|
@@ -316,22 +316,22 @@ htmlhelp_basename = "xarraydoc"
|
|
|
316
316
|
|
|
317
317
|
# Example configuration for intersphinx: refer to the Python standard library.
|
|
318
318
|
intersphinx_mapping = {
|
|
319
|
-
"
|
|
320
|
-
"
|
|
319
|
+
"cftime": ("https://unidata.github.io/cftime", None),
|
|
320
|
+
"cubed": ("https://cubed-dev.github.io/cubed/", None),
|
|
321
|
+
"dask": ("https://docs.dask.org/en/latest", None),
|
|
322
|
+
"datatree": ("https://xarray-datatree.readthedocs.io/en/latest/", None),
|
|
323
|
+
"flox": ("https://flox.readthedocs.io/en/latest/", None),
|
|
324
|
+
"hypothesis": ("https://hypothesis.readthedocs.io/en/latest/", None),
|
|
321
325
|
"iris": ("https://scitools-iris.readthedocs.io/en/latest", None),
|
|
326
|
+
"matplotlib": ("https://matplotlib.org/stable/", None),
|
|
327
|
+
"numba": ("https://numba.readthedocs.io/en/stable/", None),
|
|
322
328
|
"numpy": ("https://numpy.org/doc/stable", None),
|
|
329
|
+
"pandas": ("https://pandas.pydata.org/pandas-docs/stable", None),
|
|
330
|
+
"python": ("https://docs.python.org/3/", None),
|
|
323
331
|
"scipy": ("https://docs.scipy.org/doc/scipy", None),
|
|
324
|
-
"numba": ("https://numba.readthedocs.io/en/stable/", None),
|
|
325
|
-
"matplotlib": ("https://matplotlib.org/stable/", None),
|
|
326
|
-
"dask": ("https://docs.dask.org/en/latest", None),
|
|
327
|
-
"cftime": ("https://unidata.github.io/cftime", None),
|
|
328
332
|
"sparse": ("https://sparse.pydata.org/en/latest/", None),
|
|
329
|
-
"hypothesis": ("https://hypothesis.readthedocs.io/en/latest/", None),
|
|
330
|
-
"cubed": ("https://cubed-dev.github.io/cubed/", None),
|
|
331
|
-
"datatree": ("https://xarray-datatree.readthedocs.io/en/latest/", None),
|
|
332
333
|
"xarray-tutorial": ("https://tutorial.xarray.dev/", None),
|
|
333
|
-
"
|
|
334
|
-
# "opt_einsum": ("https://dgasmith.github.io/opt_einsum/", None),
|
|
334
|
+
"zarr": ("https://zarr.readthedocs.io/en/latest/", None),
|
|
335
335
|
}
|
|
336
336
|
|
|
337
337
|
|
|
@@ -549,6 +549,7 @@ __ https://numpy.org/doc/stable/user/basics.indexing.html#assigning-values-to-in
|
|
|
549
549
|
You can also assign values to all variables of a :py:class:`Dataset` at once:
|
|
550
550
|
|
|
551
551
|
.. ipython:: python
|
|
552
|
+
:okwarning:
|
|
552
553
|
|
|
553
554
|
ds_org = xr.tutorial.open_dataset("eraint_uvz").isel(
|
|
554
555
|
latitude=slice(56, 59), longitude=slice(255, 258), level=0
|
|
@@ -747,7 +748,7 @@ Whether array indexing returns a view or a copy of the underlying
|
|
|
747
748
|
data depends on the nature of the labels.
|
|
748
749
|
|
|
749
750
|
For positional (integer)
|
|
750
|
-
indexing, xarray follows the same rules as NumPy:
|
|
751
|
+
indexing, xarray follows the same `rules`_ as NumPy:
|
|
751
752
|
|
|
752
753
|
* Positional indexing with only integers and slices returns a view.
|
|
753
754
|
* Positional indexing with arrays or lists returns a copy.
|
|
@@ -764,8 +765,10 @@ Whether data is a copy or a view is more predictable in xarray than in pandas, s
|
|
|
764
765
|
unlike pandas, xarray does not produce `SettingWithCopy warnings`_. However, you
|
|
765
766
|
should still avoid assignment with chained indexing.
|
|
766
767
|
|
|
767
|
-
|
|
768
|
+
Note that other operations (such as :py:meth:`~xarray.DataArray.values`) may also return views rather than copies.
|
|
768
769
|
|
|
770
|
+
.. _SettingWithCopy warnings: https://pandas.pydata.org/pandas-docs/stable/indexing.html#returning-a-view-versus-a-copy
|
|
771
|
+
.. _rules: https://numpy.org/doc/stable/user/basics.copies.html
|
|
769
772
|
|
|
770
773
|
.. _multi-level indexing:
|
|
771
774
|
|